Exploit database

GH-abe2ad96b80b02d002d3372d650c1c9f

craigsblackie/cve-2026-88771-netscaler

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-88771

9 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files68Next files →

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

analysis/compare_pyc_code.py

Python · 1,592 bytes
#!/usr/bin/env python3
"""Compare Python bytecode trees while ignoring build paths and pyc headers."""

from __future__ import annotations

import argparse
import hashlib
import marshal
import types
from pathlib import Path


def normalize(code: types.CodeType) -> types.CodeType:
    constants = tuple(
        normalize(value) if isinstance(value, types.CodeType) else value
        for value in code.co_consts
    )
    return code.replace(co_filename="<normalized>", co_consts=constants)


def code_hash(path: Path) -> str:
    with path.open("rb") as stream:
        stream.read(16)  # PEP 552 pyc header
        code = marshal.load(stream)
    if not isinstance(code, types.CodeType):
        raise ValueError(f"{path}: top-level marshal object is not code")
    return hashlib.sha256(marshal.dumps(normalize(code))).hexdigest()


def inventory(root: Path) -> dict[Path, str]:
    return {
        path.relative_to(root): code_hash(path)
        for path in sorted(root.rglob("*.pyc"))
    }


def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("old", type=Path)
    parser.add_argument("new", type=Path)
    args = parser.parse_args()

    old = inventory(args.old)
    new = inventory(args.new)
    for relative in sorted(old.keys() | new.keys()):
        if relative not in old:
            print(f"ADDED   {relative}")
        elif relative not in new:
            print(f"REMOVED {relative}")
        elif old[relative] != new[relative]:
            print(f"CHANGED {relative}")
    return 0


if __name__ == "__main__":
    raise SystemExit(main())