1---2name: pentest-http-smuggling3description: HTTP request smuggling, desync attacks, cache poisoning, and protocol-level vulnerability testing.4---56# Pentest HTTP Smuggling78## Purpose9Detect and exploit discrepancies between front-end proxies and back-end servers in HTTP request parsing. These attacks bypass security controls, poison caches, and hijack requests — entirely absent from standard taint analysis pipelines.1011## Prerequisites1213### Authorization Requirements14- **Written authorization** with explicit scope for protocol-level testing15- **Infrastructure awareness** — identify all reverse proxies, CDNs, load balancers in path16- **Rollback plan** for cache poisoning tests (CDN purge access)17- **Emergency contacts** for infrastructure team (smuggling can affect other users)1819### Environment Setup20- Python 3.x with raw socket capability for crafted HTTP requests21- Burp Suite Professional with HTTP Request Smuggler extension22- curl compiled with HTTP/2 support (`--http2-prior-knowledge`)23- Turbo Intruder for timing-sensitive attacks24- Network capture tool (Wireshark/tcpdump) for response analysis2526## Core Workflow271. **Stack Fingerprinting**: Identify reverse proxies (nginx, HAProxy, Cloudflare, AWS ALB), CDNs, load balancers. Determine HTTP version support (HTTP/1.1, HTTP/2) and parsing behavior.282. **CL.TE Smuggling**: Craft requests where front-end uses Content-Length and back-end uses Transfer-Encoding. Observe differential parsing and request boundary confusion.293. **TE.CL Smuggling**: Reverse scenario — front-end uses Transfer-Encoding, back-end uses Content-Length. Test with obfuscated TE headers.304. **TE.TE Smuggling**: Both sides use Transfer-Encoding but one can be confused with header obfuscation (capitalization, whitespace, duplicate headers).315. **HTTP/2 Downgrade**: Exploit H2-to-H1 translation at reverse proxies. Header injection via pseudo-headers, CRLF injection in H2 headers, request splitting through H2 CONTINUATION frames.326. **Cache Poisoning**: Poison cached responses with attacker-controlled content. Test cache key vs cache content discrepancies. Verify with different client sessions.337. **Host Header Attacks**: Host header injection, password reset poisoning, routing-based SSRF, web cache poisoning via ambiguous Host headers (WSTG-INPV-17).348. **Impact Validation**: Demonstrate cache poisoning, credential theft, request hijacking, or security control bypass as PoC.3536## WSTG Coverage3738| WSTG ID | Test Name | Status |39|---------|-----------|--------|40| WSTG-INPV-15 | HTTP Request Smuggling | ✅ |41| WSTG-INPV-17 | Host Header Injection | ✅ |4243## Tool Categories4445| Category | Tools | Purpose |46|----------|-------|---------|47| Smuggling Detection | smuggler.py, HTTP Request Smuggler (Burp) | Automated CL.TE/TE.CL detection |48| HTTP/2 Testing | h2csmuggler, curl --http2, nghttp | H2 downgrade and desync attacks |49| Timing Attacks | Turbo Intruder | Microsecond-precision request timing |50| Raw Requests | Python sockets, netcat | Crafted malformed HTTP requests |51| Cache Analysis | curl, custom scripts | Cache behavior verification |52| Traffic Capture | Wireshark, tcpdump | Response boundary analysis |5354## References55- `references/tools.md` - Tool function signatures and parameters56- `references/workflows.md` - Attack pattern definitions and test vectors