Ethical Use Only - Authorized Security Testing
This repository provides tools for authorized security professionals, blue teams, and penetration testers only.
Unauthorized access to computer systems is illegal under CFAA (US), Computer Misuse Act (UK), TCK 243/244 (Turkey), and similar laws worldwide.
CVE-2026-129289 is a critical HTTP Request Smuggling vulnerability (CWE-444) in PHP-FPM.
The root cause is a request lifecycle defect: when an application opens the php://input stream but does not read it to completion, PHP-FPM does not discard the unread body bytes during request shutdown.
When the front-end web server (nginx, Apache, HAProxy) reuses the same FastCGI connection for a subsequent request (via fastcgi_keep_conn on or enablereuse=on), PHP-FPM interprets the leftover bytes as the beginning of a new FastCGI request.
The attacker can embed a fully controlled FastCGI parameter block within the smuggled bytes, setting SCRIPT_FILENAME, REMOTE_ADDR, and critically PHP_ADMIN_VALUE.
By injecting allow_url_include=1 and auto_prepend_file=php://input into PHP_ADMIN_VALUE, the attacker causes PHP-FPM to treat the original HTTP request body as PHP code, potentially achieving unauthenticated remote code execution.
The upstream fix was committed in PHP 8.2.36, 8.3.37, 8.4.28, and 8.5.13. The vulnerability has existed since PHP 5.6.
- Preparation — A multipart/form-data request is crafted with a hidden FastCGI parameter block following a legitimate form payload.
- Initial Request (N) — The front-end forwards the request to PHP-FPM. The target application opens
php://inputbut does not consume the entire body. - Connection Reuse — The front-end reuses the same persistent FastCGI connection for a subsequent request.
- Smuggling — PHP-FPM's FastCGI record parser reads leftover bytes as a new FastCGI record.
- RCE — Under the required conditions, PHP-FPM may execute attacker-controlled PHP code as the web worker user.
| PHP Branch | Vulnerable | Fixed |
|---|---|---|
| 8.2 | 8.2.0 - 8.2.35 | 8.2.36 |
| 8.3 | 8.3.0 - 8.3.36 | 8.3.37 |
| 8.4 | 8.4.0 - 8.4.27 | 8.4.28 |
| 8.5 | 8.5.0 - 8.5.12 | 8.5.13 |
Front-end requirements: nginx (fastcgi_keep_conn on), Apache (enablereuse=on), or HAProxy with connection reuse.
Application requirements: Must open php://input (or equivalent) without reading to EOF.
- Upgrade to a fixed PHP version for your branch.
- Disable persistent FastCGI connections:
- nginx:
fastcgi_keep_conn off - Apache:
enablereuse=off
- nginx:
- Restart PHP-FPM and web server services after configuration changes.
.
├── exploit/
│ └── exploit.py # Primary toolkit
├── poc/
│ └── poc.py # Safe FPM reachability probe
├── scanner/
│ └── scanner.py # Header-based PHP version scanner
├── lib/
│ ├── config.py # Banner, ranges, profiles, defaults
│ ├── logger.py # Colored output + rotating log
│ ├── fcgi.py # FastCGI record builder and parser
│ ├── http_client.py # HTTP client with proxy, tor, jitter
│ ├── php_ranges.py # Version parse and range check
│ └── reporting.py # JSON report helper
├── requirements.txt
└── README.md, .gitignore
| Tool | Purpose |
|---|---|
exploit/exploit.py |
Full toolkit for authorized testing |
poc/poc.py |
Safe proof. Sends FCGI_GET_VALUES, never RCE |
scanner/scanner.py |
Reads PHP version from HTTP headers. No trigger |
| Mode | Behavior | Reliability |
|---|---|---|
check |
Reads PHP version from headers and reports CANDIDATE / LIKELY_SAFE / UNKNOWN | DETERMINISTIC |
probe |
Sends FCGI_GET_VALUES to FPM port and confirms service availability | DETERMINISTIC |
exploit |
HTTP multipart smuggling | PROBABILISTIC |
direct |
Direct FPM socket testing | DETERMINISTIC (FPM reachable) |
shell |
Reverse-shell functionality | DETERMINISTIC |
persist |
Webshell persistence functionality | DETERMINISTIC |
exfil |
DNS or HTTPS output transfer | DETERMINISTIC |
| Profile | Front-end hint |
|---|---|
nginx |
fastcgi_keep_conn on |
apache |
enablereuse=on |
haproxy |
Retained backend connections |
lsapi |
LSAPI persistent |
generic |
Unknown |
Install the required dependencies:
pip install -r requirements.txtpython3 exploit/exploit.py --mode check --target http://authorized-host
python3 exploit/exploit.py --mode probe --fpm-host 127.0.0.1 --fpm-port 9000python3 poc/poc.py --fpm-host 127.0.0.1 --json poc.jsonpython3 scanner/scanner.py --target https://authorized-host --output scan.json
python3 scanner/scanner.py --file targets.txt --threads 20 --output scan.csv| Flag | Description |
|---|---|
--mode NAME |
check / probe / exploit / direct / shell / persist / exfil |
--target URL |
Target URL for check / exploit |
--cmd COMMAND |
Command argument (default: id) |
--profile NAME |
nginx / apache / haproxy / lsapi / generic |
--script-path PATH |
PHP script path |
--php-value VALUE |
PHP_ADMIN_VALUE override |
--fpm-host HOST |
PHP-FPM host (default: 127.0.0.1) |
--fpm-port PORT |
PHP-FPM port (default: 9000) |
--rev-shell IP:PORT |
Reverse shell target |
--persist-path PATH |
Webshell path |
--exfil-dns DOMAIN |
DNS exfiltration domain |
--exfil-https URL |
HTTPS exfiltration URL |
--proxy URL |
SOCKS5 proxy |
--tor |
Shortcut for SOCKS5 proxy |
--stealth |
Jitter between requests |
--timeout SEC |
Per-request timeout (default: 12) |
--json FILE |
Write JSON report |
-v, --verbose |
Verbose output |
| Flag | Description |
|---|---|
--target URL |
Single target |
--file FILE |
Targets file (# comments supported) |
--threads N |
Concurrent workers (default: 10) |
--timeout SEC |
Timeout (default: 12) |
--proxy URL |
SOCKS5 proxy |
--tor |
Shortcut for SOCKS5 proxy |
--stealth |
Jitter between requests |
--output FILE |
.json or .csv |
-v, --verbose |
Verbose output |
| Flag | Description |
|---|---|
--fpm-host HOST |
PHP-FPM host (default: 127.0.0.1) |
--fpm-port PORT |
PHP-FPM port (default: 9000) |
--timeout SEC |
Timeout (default: 10) |
--json FILE |
Write JSON report |
-v, --verbose |
Verbose output |
| # | Scenario | Description |
|---|---|---|
| 1 | Header check | PHP version identification |
| 2 | Safe FPM probe | FPM service availability check |
| 3 | HTTP smuggling | Authorized vulnerability validation |
| 4 | Direct FPM | Direct socket testing |
| 5 | Reverse shell | Controlled lab testing |
| 6 | Webshell persistence | Persistence behavior assessment |
| 7 | DNS exfil | Controlled data-transfer assessment |
| 8 | Safe PoC | Non-exploitative FPM probe |
| 9 | Mass scan | Version scanning |
| 10 | Tor + stealth | Proxy-based scanning configuration |
The direct mode connects to the PHP-FPM listening port (default 9000) via TCP and bypasses the front-end entirely.
The FastCGI protocol sequence consists of:
- FCGI_BEGIN_REQUEST — Starts a new request as responder (role = 1).
- FCGI_PARAMS — Contains request parameters such as
SCRIPT_FILENAME,PHP_ADMIN_VALUE,REQUEST_URI, andSERVER_*. - FCGI_STDIN — Contains the request body.
- FCGI_END_REQUEST — Closes the request.
This mode depends on direct PHP-FPM socket accessibility and should only be evaluated in an isolated, authorized test environment.
Sends a multipart/form-data POST request whose body contains a legitimate form field followed by a smuggled FastCGI parameter block.
The attack depends on the front-end reusing the same FastCGI connection. When the application does not consume the entire body, leftover bytes remain on the connection and may be parsed as a new FastCGI request.
Requirements:
- Front-end with persistent FastCGI connections.
- Application that opens
php://inputwithout reading to EOF.
Labelled PROBABILISTIC because it depends on front-end configuration.
Reads PHP version hints from HTTP response headers:
X-Powered-ByServerX-Application-Context
Never sends a trigger payload.
A CANDIDATE result is a triage hint, not a vulnerability verdict.
| Label | Meaning |
|---|---|
DETERMINISTIC |
Same input, same output. Prerequisites must be met. |
PROBABILISTIC |
Outcome depends on target configuration. May fail on some hosts. |
HINT |
Informational only. Not a vulnerability verdict. |
EXPERIMENTAL |
Not implemented — probes for hypothetical interface. |
- Only use these tools on systems you own or have explicit written permission to test.
- Unauthorized access is illegal and unethical.
- The authors are not responsible for any misuse.
- Always follow your country's laws and regulations.
- Direct PHP-FPM testing must only be performed in authorized environments.
- HTTP smuggling tests must not be run against production systems without authorization.
- Persistence functionality modifies the target system and requires explicit authorization.
- Scanner results are hints, not verdicts.
CANDIDATEorLIKELY_SAFEis not a security verdict. poc.pyonly sends FCGI_GET_VALUES. It does not attempt exploitation.
This software is provided for educational purposes and authorized security testing only.
First release. A toolkit for PHP-FPM version checks, FPM reachability testing, and security assessment.
Included:
exploit/— check, probe, exploit, direct, shell, persist, exfil modes.poc/— Safe GET_VALUES probe.scanner/— Header-based version scan with JSON/CSV output.lib/— Package containing config, logger, fcgi, http_client, php_ranges, and reporting.- Proxy, Tor, stealth, JSON, and verbose configuration options.
- Front-end profiles: nginx, apache, haproxy, lsapi, generic.
- Colored banner, rotating log file, thread-safe output.

