Skip to main content

A tool to detect sensitive information leaks in code

Project description

🚀 LeakHunt v2.2.2 - Production Ready Secret Scanner

Independent secret scanner for bug bounty hunters and security testers. Scans URLs, local files, and directories to detect exposed secrets using pattern matching, entropy analysis, and severity classification.

PyPI version Tests

What's New in v2.2.2

  • Full-secret preservation (no truncation) with masking moved strictly to display layer
  • Added explainable detection output with score and reasons fields per finding
  • Introduced hybrid scoring model combining pattern match, normalized entropy, and context signals
  • Replaced binary entropy threshold logic with weighted confidence scoring system
  • Added context-aware suppression for fake, test, dummy, example keywords
  • Added lightweight token-shape filter to reduce placeholder-based false positives
  • Implemented detect_input_mode() for automatic routing of file, URL, and raw text inputs
  • Fixed -U misinterpretation of raw secret lists as fetch targets
  • Improved CLI output consistency between stdout and -o JSON file export
  • Added --json flag for structured machine-readable output (CI/SOC ready)
  • Enhanced --safe-mode to only mask output layer without modifying internal detection values
  • Improved entropy normalization for stable scoring across varying token lengths
  • Added validation layer for ensuring pattern-triggered detections require minimum score thresholds
  • Refactored scanner pipeline into extraction → filtering → scoring → explanation stages
  • Improved logging clarity with severity + confidence visibility in verbose mode
  • All existing CLI flags (-f, -u, -U, -o, --patterns-dir) remain fully backward compatible
  • Test suite expanded for scoring engine, context filtering, and CLI output validation
  • All tests passing (14 passed) and bytecode compilation verified via python -m compileall leakhunt

Full history: CHANGELOG.md


⚙️ Installation

pip install -r requirements.txt
pip install .

🚀 CLI Usage

# mixed targets
leakhunt -t 8 -o findings.json https://example.com/app.js ./local.js

# multiple URLs
leakhunt -u https://example.com/app.js -u https://example.com/main.js

# targets from file
leakhunt -U lab/targets.txt -t 10 -v

# local files
leakhunt -f lab/index.html -f lab/test_private_key.txt

# Bug Bounty
leakhunt --safe-mode -t 15 -U targets.txt -o findings.json -v

# Lab Testing  
leakhunt --safe-mode -U lab/targets.txt

# Custom Patterns
leakhunt --patterns-dir patterns/ test.txt

# Dry Run
leakhunt --dry-run -U urls.txt

# Low Entropy
leakhunt --entropy-threshold 3.0 --safe-mode files/

🧪 Local Testing Lab

  1. Start a local server from repo root
  2. In another terminal: leakhunt -U lab/targets.txt -t 5 -v -o lab/results.json

Lab includes:

  • lab/index.html → dummy tokens
  • lab/test_private_key.txt → dummy private key

⚠️ Ethics Warning

Use LeakHunt only on systems you own or have explicit authorization to test. Unauthorized scanning may violate laws and responsible disclosure policies.

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

leakhunt-2.2.2.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

leakhunt-2.2.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file leakhunt-2.2.2.tar.gz.

File metadata

  • Download URL: leakhunt-2.2.2.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for leakhunt-2.2.2.tar.gz
Algorithm Hash digest
SHA256 63921530f0abd70aa729feeb8ff1a3e41217360220e35756a7db01c035c55b87
MD5 0d85235c12f9a2634ce0d8a2edda33be
BLAKE2b-256 fefbd049a1835e4ace4fe9e6cf45f7745aaad38976db01923f47a8794eeb7004

See more details on using hashes here.

File details

Details for the file leakhunt-2.2.2-py3-none-any.whl.

File metadata

  • Download URL: leakhunt-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for leakhunt-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 665647f7b766bd9e2f2bff4da8133d70c1d3b030fa556e6e3f8ea5003a27754e
MD5 11e7ea8e463805eecd1d2e26b130fc22
BLAKE2b-256 0fe579d49778efe916c671f0a529d65e0038cc15b0e758a813ba3a9fbf0748fc

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