A high-concurrency CLI tool for detecting web cache poisoning vulnerabilities.
CPD-SEC is a security tool designed to identify vulnerabilities in web caching systems that allow cache poisoning attacks.
You can install CPD-SEC directly from PyPI:
pip install cpd-sec-
Clone the repository:
git clone https://github.com/kankburhan/cpd.git cd cpd -
Install dependencies using Poetry:
poetry install
Alternatively, calculate dependencies to requirements.txt and use pip:
pip install .
CPD-SEC supports multiple input methods and extensive configuration options.
Scan a single target URL.
# Installed via pip
cpd-sec scan --url https://example.com
# Using poetry
poetry run cpd-sec scan --url https://example.comPipe URLs from other tools (like waybackurls, gau, subfinder, or cat) directly into CPD-SEC. This is ideal for mass scanning.
# Scan URLs found by waybackurls
waybackurls target.com | cpd-sec scan
# Scan URLs from a file using cat
cat urls.txt | cpd-sec scan --concurrency 20Read URLs from a text file (one URL per line).
cpd-sec scan --file urls.txtScan using a raw HTTP request definition (e.g., copied from Burp Suite).
# Save your request to a file (e.g. request.txt)
cpd-sec scan --request-file request.txtAlternative: Direct String (--raw)
Use with caution due to shell escaping characters.
cpd-sec scan --raw "GET /api/foo HTTP/1.1
Host: example.com"Add custom headers to every request (e.g., cookies, authorization). You can use this flag multiple times.
cpd-sec scan -u https://admin.example.com \
-h "Cookie: session=12345" \
-h "Authorization: Bearer XYZ"Save the findings to a JSON or HTML file.
JSON Output:
cpd-sec scan -u https://example.com --output results.jsonHTML Report (NEW!): Generate a professional HTML security report with PoC details:
cpd-sec scan -u https://example.com --output report.htmlAuto-Open Report (--open):
Automatically open the HTML report in your browser:
cpd-sec scan -u https://example.com --output report.html --openHTML reports include:
- π¬ Evidence section with cache headers and variant URLs
- π― Proof-of-Concept URLs ready for manual verification
- π Copy-paste curl commands with malicious headers
β οΈ Reflected content sections showing where payloads appear
Control the number of simultaneous requests (default: 50).
cpd-sec scan -f targets.txt --concurrency 100Control output levels.
cpd-sec scan -u https://example.com -v # Debug logging
cpd-sec scan -u https://example.com -q # Only show findingsManually verify a vulnerability claim step-by-step.
cpd-sec validate --url https://target.com --header "X-Forwarded-Host: evil.com"Check for and install the latest version of CPD-SEC.
cpd-sec update- Auto Update Check: Automatically checks for new versions on run.
- High Concurrency: Built with
asyncioandaiohttpfor speed. - Smart Baseline: Establishes a stable baseline to reduce false positives.
- HTML Security Reports: Professional reports with PoC URLs, curl commands, and evidence details.
- Advanced Poisoning Detection:
- Header Injection:
X-Forwarded-Host,X-Forwarded-Scheme,Fastly-Client-IP, etc. - Path Normalization: Exploits backend URL decoding differences (
/foo\bar). - Query Parameter Normalization: Detects case-insensitive query param cache keys.
- Fat GET: Sends request bodies with GET requests.
- Unkeyed Query Params: Injects parameters to test cache key inclusion.
- Method Override: Tests
X-HTTP-Method-Override. - Cache Key Confusion: Tests URL encoding variants and cache key calculation.
- Header Injection:
- Pipeline Ready: Designed to integrate into your reconnaissance workflow.
We welcome contributions to improve CPD-SEC, especially for new poisoning signatures and false positive reductions.
If you encounter a false positive (a reported vulnerability that is benign), please open an Issue with:
- Replication Output: The output of the
validatecommand:cpd-sec validate --url <TARGET_URL> --header "KEY: VALUE"
- Context: Why you believe it is benign (e.g., "The server normalizes the path but returns the same content").
- Fork the repository.
- Clone your fork locally.
- Install dependencies:
poetry install. - Create a Branch for your feature/fix.
- Add/Modify Signatures in
cpd/logic/poison.py. - Add Tests in
tests/to verify your changes. - Submit a Pull Request!
If CPD-SEC helped you find vulnerabilities and improve security, consider supporting its development!
π³ PayPal:
paypal.me/kankburhan
π° Crypto (USDC):
0x4618393bf4ddc50eb3e75df849b46aca0d0f8e3c
Your support helps maintain and improve this open-source security tool. Thank you! π
MIT License - see LICENSE file for details.