Skip to content

mizazhaider-ceh/Sub-Hunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SubHunter v5.0



  โ•”โ•โ•—โ•ฆ โ•ฆโ•”โ•— โ•ฆ โ•ฆโ•ฆ โ•ฆโ•”โ•—โ•”โ•”โ•ฆโ•—โ•”โ•โ•—โ•ฆโ•โ•—
  โ•šโ•โ•—โ•‘ โ•‘โ• โ•ฉโ•—โ• โ•โ•ฃโ•‘ โ•‘โ•‘โ•‘โ•‘ โ•‘ โ•‘โ•ฃ โ• โ•ฆโ•
  โ•šโ•โ•โ•šโ•โ•โ•šโ•โ•โ•ฉ โ•ฉโ•šโ•โ•โ•โ•šโ• โ•ฉ โ•šโ•โ•โ•ฉโ•šโ•  v5.0 PRO

โšก Advanced Subdomain Enumeration & Security Reconnaissance Framework

Built for penetration testers, bug bounty hunters, and security researchers


Python License Tests Platform

Async OSINT Cloud Takeover Code style


SubHunter discovers subdomains at scale using passive intelligence & active brute-forcing,
then probes, fingerprints, and reports on every host โ€” all in one async pipeline.


Getting Started ยท Screenshots ยท Features ยท Documentation ยท Security




๐Ÿ–ผ๏ธ Screenshots

๐ŸŽฎ Interactive TUI Mode โ€” Launch without arguments for a guided experience

SubHunter Interactive Mode

โšก Live Scan Output โ€” Real-time progress with color-coded phases

SubHunter Scan Output

๐Ÿ“Š HTML Report Dashboard โ€” Premium dark-themed reports with charts & tables

SubHunter HTML Report

โœ… Scan Summary โ€” Clear results at a glance

SubHunter Scan Summary




๐Ÿค” Why SubHunter?

โŒ The Problem

  • Manual enumeration across scattered tools
  • Wildcard DNS flooding results with false positives
  • No infrastructure context (cloud, tech, ports)
  • Flat text output with no actionable intelligence
  • No takeover or vulnerability detection
  • Slow, sequential scanning

โœ… SubHunter's Solution

  • All-in-one pipeline: enumerate โ†’ probe โ†’ scan โ†’ report
  • Smart wildcard detection filters false positives automatically
  • Cloud detection across 11 providers + tech fingerprinting
  • Premium HTML reports with charts, tables, and export
  • Takeover detection for 20+ services (S3, Heroku, GitHub, etc.)
  • Async architecture with 100+ concurrent queries



โœจ Features

๐Ÿ” Reconnaissance

Feature Details
Passive OSINT 6 sources: crt.sh, HackerTarget, AlienVault OTX, urlscan.io, RapidDNS, WebArchive
DNS Brute-force Dictionary attack with custom wordlist support
Recursive Discovery Sub-subdomains (dev.api.target.com) with configurable depth
Wildcard Filtering Auto-detect & filter wildcard DNS false positives

๐ŸŽฏ Security Analysis

Feature Details
Subdomain Takeover Detect vulnerable CNAMEs across 20+ services
VHost Discovery Hidden virtual hosts via Host header fuzzing
JS Analysis Extract API secrets, endpoints, and subdomains from JavaScript
Port Scanning 17 common ports (SSH, HTTP, MySQL, RDP, etc.)
HTTP Probing Status codes, headers, tech stack, response times

โ˜๏ธ Infrastructure Intelligence

Feature Details
Cloud Detection AWS, Azure, GCP, Cloudflare, Heroku, Vercel, Netlify + 4 more
Tech Fingerprinting WordPress, React, Angular, Django, Laravel, Nginx, Apache, etc.
CNAME Mapping Full CNAME chain resolution for every subdomain

๐Ÿ“Š Output & UX

Feature Details
HTML Reports Premium dark-themed dashboard with charts, tables, XSS-safe
Interactive TUI Beautiful terminal UI when run without arguments
Resume Scans Save & resume interrupted scans seamlessly
Multi-format Export to HTML, JSON, or plain text
Screenshot Capture Playwright or Selenium with auto-fallback



๐Ÿš€ Quick Start

# Clone
git clone https://github.com/mizazhaider-ceh/Sub-Hunter.git
cd Sub-Hunter

# Setup (recommended: virtual environment)
python -m venv venv
source venv/bin/activate        # Linux/macOS
# venv\Scripts\activate         # Windows

# Install
pip install -r requirements.txt

# Run
python subhunter.py -d example.com
๐Ÿ“ธ Optional: Screenshots Setup

Playwright (Recommended):

pip install playwright
playwright install chromium

Selenium (Fallback):

pip install selenium webdriver-manager

SubHunter auto-detects which engine is available.

๐Ÿ”‘ Optional: API Keys for Enhanced Results

Copy .env.example to .env and add keys for deeper passive enumeration:

cp .env.example .env
Source Key Required Free Tier
crt.sh No โˆž
HackerTarget No โˆž
AlienVault OTX No โˆž
urlscan.io No โˆž
SecurityTrails Optional 50/mo
Shodan Optional 100/mo



๐Ÿ“‹ Usage

Interactive Mode

python subhunter.py

Launches a guided TUI โ€” select features, enter domain, and go.

Command-Line Examples

# Basic scan (passive + brute-force + probing)
python subhunter.py -d target.com

# Full security audit โ€” everything enabled
python subhunter.py -d target.com --recursive --takeover --vhost --js-parse --ports --screenshots

# Passive only โ€” no active scanning
python subhunter.py -d target.com --no-brute --no-probe

# Custom wordlist + JSON output
python subhunter.py -d target.com -w /path/to/wordlist.txt -o results.json

# Resume an interrupted scan
python subhunter.py -d target.com --resume

# Quiet mode with high concurrency
python subhunter.py -d target.com -c 200 -q --html report.html

โš™๏ธ Full Options Reference

Option Description Default
-d, --domain Target domain (required) โ€”
-w, --wordlist Custom wordlist for brute-forcing Built-in (80 words)
-o, --output Output file (.txt or .json) โ€”
--html Custom HTML report path Auto โ†’ reports/
--recursive Enable recursive sub-subdomain discovery Off
--recursive-depth Max recursion depth 2
--takeover Check for subdomain takeover vulnerabilities Off
--vhost Discover virtual hosts via Host header fuzzing Off
--js-parse Extract secrets & endpoints from JS files Off
--ports Enable port scanning (17 ports) Off
--screenshots Capture screenshots of alive hosts Off
--no-brute Skip DNS brute-forcing Off
--no-probe Skip HTTP probing Off
--no-wildcard-filter Disable wildcard DNS filtering Off
--resume Resume previous scan Off
-c, --concurrency Concurrent queries 100
-q, --quiet Suppress output except results Off
--interactive Force interactive TUI mode Off



๐Ÿง  How It Works

Scanning Pipeline

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Phase 0   โ”‚โ”€โ”€โ”€โ–ถโ”‚   Phase 1    โ”‚โ”€โ”€โ”€โ–ถโ”‚   Phase 2     โ”‚โ”€โ”€โ”€โ–ถโ”‚  Phase 2.5    โ”‚
โ”‚  Wildcard   โ”‚    โ”‚   Passive    โ”‚    โ”‚  Brute-force  โ”‚    โ”‚  Recursive    โ”‚
โ”‚  Detection  โ”‚    โ”‚   OSINT (6)  โ”‚    โ”‚  DNS Wordlist โ”‚    โ”‚  Discovery    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                                    โ”‚
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚   Phase 3    โ”‚
              โ”‚  HTTP Probe  โ”‚ โ†โ”€โ”€ Tech Detection + Cloud ID + Headers
              โ”‚  + Tech + โ˜๏ธ  โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ–ผ                โ–ผ                โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Phase 4  โ”‚  โ”‚   Phase 5    โ”‚  โ”‚ Phase 6-7-8  โ”‚
โ”‚  Ports   โ”‚  โ”‚ Screenshots  โ”‚  โ”‚   Takeover   โ”‚
โ”‚ Scanner  โ”‚  โ”‚  Playwright  โ”‚  โ”‚ VHost ยท JS   โ”‚
โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     โ”‚               โ”‚                 โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚   Report    โ”‚
              โ”‚  Generator  โ”‚  โ†’  HTML / JSON / TXT
              โ”‚  (XSS-safe) โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Technical Details

๐Ÿง  Wildcard DNS Detection

SubHunter resolves 5 random subdomains (e.g., a8x9k2m1p3.target.com). If all return the same IP, wildcard DNS is detected and those IPs are filtered from all results to eliminate false positives. This prevents thousands of junk entries from polluting your data.

โ˜๏ธ Cloud Provider Detection (11 Providers)

Uses a priority-based detection strategy:

Priority Method Reliability Example
1st CNAME records โ˜…โ˜…โ˜… *.s3.amazonaws.com โ†’ AWS
2nd HTTP headers โ˜…โ˜…โ˜† cf-ray header โ†’ Cloudflare
3rd IP ranges โ˜…โ˜†โ˜† 104.16.x.x โ†’ Cloudflare

Supported Providers:

Provider CNAME Headers IP Range
AWS โœ… โœ… โœ…
Azure โœ… โœ… โœ…
GCP โœ… โœ… โœ…
Cloudflare โœ… โœ… โœ…
DigitalOcean โœ… โ€” โœ…
Heroku โœ… โœ… โ€”
Netlify โœ… โœ… โ€”
Vercel โœ… โœ… โ€”
Fastly โœ… โœ… โ€”
Akamai โœ… โ€” โ€”
GitHub Pages โœ… โ€” โœ…
๐ŸŽฏ Subdomain Takeover Detection (20+ Services)

SubHunter checks CNAME records against known vulnerable patterns, then verifies with HTTP response fingerprints:

Service CNAME Pattern Fingerprint
GitHub Pages *.github.io There isn't a GitHub Pages site here
Heroku *.herokuapp.com No such app
AWS S3 *.s3.amazonaws.com NoSuchBucket
Shopify *.myshopify.com Sorry, this shop is currently unavailable
Azure *.azurewebsites.net 404 Web Site not found
Surge.sh *.surge.sh project not found
Fastly *.fastly.net Fastly error: unknown domain
Ghost *.ghost.io The thing you were looking for is no longer here
Tumblr *.tumblr.com There's nothing here
WordPress *.wordpress.com Do you want to register
...and 10+ more
๐Ÿ” Port Scanner
Port Service Port Service
21 FTP 443 HTTPS
22 SSH 445 SMB
23 Telnet 993 IMAPS
25 SMTP 995 POP3S
53 DNS 3306 MySQL
80 HTTP 3389 RDP
110 POP3 5432 PostgreSQL
143 IMAP 8080 HTTP-Alt
8443 HTTPS-Alt



๐Ÿ—๏ธ Architecture

Sub-Hunter/
โ”œโ”€โ”€ subhunter.py             # CLI/TUI entry point โ€” dual-mode launcher
โ”œโ”€โ”€ core/                    # Core scanning engine
โ”‚   โ”œโ”€โ”€ dns.py               #   DNS resolution, brute-forcing, recursive discovery
โ”‚   โ”œโ”€โ”€ probe.py             #   HTTP probing + tech detection + cloud detection
โ”‚   โ”œโ”€โ”€ scanner.py           #   Async TCP port scanner
โ”‚   โ”œโ”€โ”€ wildcard.py          #   Wildcard DNS detection & filtering
โ”‚   โ”œโ”€โ”€ cloud.py             #   Cloud provider identification (11 providers)
โ”‚   โ”œโ”€โ”€ takeover.py          #   Subdomain takeover vulnerability detection
โ”‚   โ”œโ”€โ”€ vhost.py             #   Virtual host discovery via Host header fuzzing
โ”‚   โ”œโ”€โ”€ jsparse.py           #   JavaScript file analysis for secrets & endpoints
โ”‚   โ”œโ”€โ”€ screenshot.py        #   Screenshot capture (Playwright/Selenium fallback)
โ”‚   โ””โ”€โ”€ report.py            #   Premium HTML report generator (XSS-safe)
โ”œโ”€โ”€ sources/                 # Passive OSINT data collection
โ”‚   โ””โ”€โ”€ passive.py           #   6 passive sources with async parallel fetching
โ”œโ”€โ”€ utils/                   # Shared utilities & configuration
โ”‚   โ”œโ”€โ”€ config.py            #   Constants, wordlists, tech signatures, ports
โ”‚   โ”œโ”€โ”€ display.py           #   Terminal colors, banner, progress formatting
โ”‚   โ””โ”€โ”€ menu.py              #   Interactive TUI menu system
โ”œโ”€โ”€ tests/                   # Test suite (49 tests)
โ”‚   โ””โ”€โ”€ test_subhunter.py    #   Domain validation, cloud, XSS, CLI, takeover tests
โ”œโ”€โ”€ reports/                 # Auto-saved HTML scan reports
โ”œโ”€โ”€ assets/                  # README screenshots & media
โ”œโ”€โ”€ requirements.txt         # Python dependencies
โ”œโ”€โ”€ .env.example             # Environment variable template (API keys)
โ”œโ”€โ”€ SECURITY.md              # Security policy & responsible disclosure
โ””โ”€โ”€ LICENSE                  # MIT License



๐Ÿงช Testing

# Run all 49 tests
python -m pytest tests/ -v

# Run with coverage report
python -m pytest tests/ -v --tb=short

# Run specific test class
python -m pytest tests/test_subhunter.py::TestCloudDetection -v

Test Coverage:

Test Suite Tests What's Tested
TestDomainValidation 14 Valid/invalid domain regex patterns
TestCloudDetection 11 CNAME, header, IP-based cloud identification
TestWildcardDetection 5 Wildcard result parsing, filtering, random generation
TestReportSecurity 3 XSS payload escaping in HTML reports
TestConfig 3 Wordlists, ports, tech signatures
TestDisplay 3 Version, colors, banner rendering
TestCLI 6 Argument parsing (all flags including v5.0 additions)
TestTakeoverSignatures 2 Signature loading, fingerprint structure
TestStateManagement 2 Save/load/clear scan state



๐Ÿ›ก๏ธ Security Considerations

Area Policy
Authorization Only scan domains you have explicit permission to test
SSL Verification Intentionally disabled for security assessment (standard pentest practice)
XSS Prevention All user-controlled data is HTML-escaped in generated reports
Secrets Management API keys stored in .env (git-ignored), never hardcoded
State Files Plaintext JSON โ€” delete after scan completion
Rate Limiting Use -c flag to control concurrency and avoid API abuse

๐Ÿ“‹ See SECURITY.md for our responsible disclosure policy.




๐Ÿ”ฎ Roadmap

Feature Status Priority
WAF Detection (Cloudflare, Akamai, AWS WAF) ๐Ÿ”œ Planned High
Permutation Scanning (dev-api, v1-test, stg-app) ๐Ÿ”œ Planned High
Email Harvesting from discovered hosts ๐Ÿ”œ Planned Medium
API Key Integrations (Shodan, SecurityTrails, Censys) ๐Ÿ”œ Planned Medium
CI/CD Pipeline Integration (GitHub Actions) ๐Ÿ”œ Planned Low
Docker Container ๐Ÿ”œ Planned Low



๐Ÿ“ฆ Tech Stack

Layer Technology Purpose
Runtime Python 3.8+ Core language
Async I/O asyncio High concurrency (100+ simultaneous queries)
HTTP httpx Modern async HTTP client with HTTP/2
DNS aiodns Async DNS resolution via c-ares
Screenshots Playwright / Selenium Headless browser capture with auto-fallback
Reports HTML / CSS / JS Premium dark-themed dashboard reports
Testing pytest 49 unit & integration tests



๐Ÿค Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Please read SECURITY.md before submitting security-related changes.




๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.




๐Ÿ‘ค Author

Mizaz Haider (MIHx0)

GitHub LinkedIn

Cybersecurity Student ยท Junior DevSecOps Engineer

Powered by The PenTrix โšก




SubHunter v5.0

Hunt them all ๐ŸŽฏ

โš ๏ธ For authorized security testing only. Always obtain written permission before scanning any target.

About

๐ŸŽฏ Intelligent subdomain enumeration and discovery tool for bug bounty hunters | Fast, efficient web recon with multiple data sources and automated validation | Find hidden attack surfaces in seconds

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors