Skip to main content

A high-concurrency CLI tool for detecting web cache poisoning vulnerabilities.

Project description

CachePoisonDetector (CPD)

A high-concurrency CLI tool for detecting web cache poisoning vulnerabilities.

Overview

CPD is a security tool designed to identify vulnerabilities in web caching systems that allow cache poisoning attacks.

Installation

  1. Clone the repository:

    git clone https://github.com/kankburhan/cpd.git
    cd cpd
    
  2. Install dependencies using Poetry:

    poetry install
    

    Alternatively, calculate dependencies to requirements.txt and use pip:

    pip install .
    

Usage

CPD supports multiple input methods and extensive configuration options.

1. Basic Scan (--url)

Scan a single target URL.

# Using poetry
poetry run cpd scan --url https://example.com

# As an installed package
cpd scan -u https://example.com

2. Pipeline Mode (Stdin)

Pipe URLs from other tools (like waybackurls, gau, subfinder, or cat) directly into CPD. This is ideal for mass scanning.

# Scan URLs found by waybackurls
waybackurls target.com | cpd scan

# Scan URLs from a file using cat
cat urls.txt | cpd scan --concurrency 20

3. File Input (--file)

Read URLs from a text file (one URL per line).

cpd scan --file urls.txt

4. Advanced Options

Custom Headers (--header)

Add custom headers to every request (e.g., cookies, authorization). You can use this flag multiple times.

cpd scan -u https://admin.example.com \
    -h "Cookie: session=12345" \
    -h "Authorization: Bearer XYZ"

Output to File (--output)

Save the findings to a JSON file.

cpd scan -u https://example.com --output results.json

Concurrency (--concurrency)

Control the number of simultaneous requests (default: 50).

cpd scan -f targets.txt --concurrency 100

Verbosity (--verbose, --quiet)

Control output levels.

cpd scan -u https://example.com -v  # Debug logging
cpd scan -u https://example.com -q  # Only show findings

5. Utilities

Validate Finding (validate)

Manually verify a vulnerability claim step-by-step.

cpd validate --url https://target.com --header "X-Forwarded-Host: evil.com"

Update Tool (update)

Check for and install the latest version of CPD.

cpd update

Features

  • Auto Update Check: Automatically checks for new versions on run. Auto Update
  • High Concurrency: Built with asyncio and aiohttp for speed.
  • Smart Baseline: Establishes a stable baseline to reduce false positives.
  • Advanced Poisoning:
    • Header Injection: X-Forwarded-Host, X-Forwarded-Scheme, Fastly-Client-IP, etc.
    • Path Normalization: Exploits backend URL decoding differences (/foo\bar).
    • 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.
  • Pipeline Ready: Designed to integrate into your reconnaissance workflow.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpd_sec-0.2.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cpd_sec-0.2.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file cpd_sec-0.2.0.tar.gz.

File metadata

  • Download URL: cpd_sec-0.2.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.9.25 Linux/6.11.0-1018-azure

File hashes

Hashes for cpd_sec-0.2.0.tar.gz
Algorithm Hash digest
SHA256 31f3ae4b506c7f92020b15445911a9d1be258c14add9421e8a44a9639070b25f
MD5 79c11aa3a2f1fd83bd711b767f6882c4
BLAKE2b-256 9427419987e1944f52c7eb169d7c6fe870043100eeacb2feebec19af7efbf071

See more details on using hashes here.

File details

Details for the file cpd_sec-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cpd_sec-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.9.25 Linux/6.11.0-1018-azure

File hashes

Hashes for cpd_sec-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5a69be289a82dbba48e83380f6ad45bf9506b7e0b58adc2c813a350435e6734
MD5 8f9fb3a53e926783d1788ec540a3e5d8
BLAKE2b-256 f3b823573c6b8274d3e167a0857484a60bac61a7e570b6489f89f44f937c6d63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page