GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - keyuraghao/SubHunter: SubHunter is a unified, installable CLI tool for enterprise-grade subdomain enumeration and vulnerability scanning. It integrates multiple OSINT and offensive security sources into a single workflow:

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
resolver
resolver
 
 
subhunter
subhunter
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
build.sh
build.sh
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 
subhunter.py
subhunter.py
 
 

Repository files navigation

SubHunter

Modular subdomain enumeration · C++ DNS resolver · AI-powered analysis · HTML reports

CI Python C++17 License: MIT Platform Tests PRs Welcome

SubHunter aggregates subdomains from 5 OSINT sources, resolves them in parallel with a compiled C++ binary, optionally runs Nuclei for vulnerability scanning, and delivers both a rich terminal report and a self-contained HTML report - all powered by an optional AI security analysis via Claude or GPT-4o.


Demo

 ____        _     _   _             _
/ ___| _   _| |__ | | | |_   _ _ __ | |_ ___ _ __
\___ \| | | | '_ \| |_| | | | | '_ \| __/ _ \ '__|
 ___) | |_| | |_) |  _  | |_| | | | | ||  __/ |
|____/ \__,_|_.__/|_| |_|\__,_|_| |_|\__\___|_|

[*] Loaded 3 domain(s).
 Source       Status
 ─────────────────────────
 VirusTotal   ENABLED
 crt.sh       ENABLED
 GitHub       ENABLED
 Sublist3r    ENABLED
 Shodan       DISABLED

[*] Starting parallel subdomain enumeration...
 Enumerating ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:18

[+] Discovered 247 unique subdomains.
[*] Resolving 247 subdomains via C++ DNS resolver...
[+] DNS resolution complete: 193 alive / 54 dead.

 Hostname                    IP Address      Alive   Latency
 ─────────────────────────────────────────────────────────────
 api.example.com             1.2.3.4         YES      8 ms
 dev.example.com             1.2.3.5         YES     11 ms
 staging.example.com         -               NO       -
 ...

[+] Nuclei scan completed.
[+] HTML report written to: Reports/report.html
╭─────────────────── Scan Complete ──────────────────────╮
│  Total subdomains:  247                                  │
│  Alive (DNS):       193                                  │
│  Nuclei findings:   12                                   │
│  HTML report:       Reports/report.html                  │
╰──────────────────────────────────────────────────────────╯

Architecture

SubHunter is intentionally split across Python + C++ to use each language where it excels:

┌─────────────────────────────────────────────────────────┐
│                   subhunter.py  (entry point)            │
└───────────────────────┬─────────────────────────────────┘
                        │
┌───────────────────────▼─────────────────────────────────┐
│               subhunter/cli.py                           │
│         (argument parsing + pipeline orchestration)      │
└──┬────────────┬──────────────┬──────────────┬───────────┘
   │            │              │              │
   ▼            ▼              ▼              ▼
Enumerators  Resolvers      Output          AI
(Python)     (C++ / Py)     (Python)        (Python)
   │            │              │              │
   │     ┌──────┴───────┐  ┌───┴────────┐    │
   │     │  C++ binary  │  │ terminal   │    │
   │     │ dns_resolver │  │ html_report│    │
   │     └──────────────┘  └────────────┘    │
   │                                          │
   ▼                                          ▼
5 OSINT sources                          Claude / GPT-4o
VT · crt.sh · GitHub                     via official SDKs
Sublist3r · Shodan
Layer Language Why
OSINT queries Python Rich HTTP / parsing ecosystem
DNS resolution C++17 getaddrinfo + std::thread - thousands of hosts in seconds
Nuclei wrapper Python subprocess + CSV parsing
HTML / AI output Python Template generation, AI SDK calls
CLI orchestration Python argparse, concurrent.futures, rich

Directory Structure

SubHunter/
├── subhunter.py              ← entry-point shim
├── pyproject.toml            ← packaging + tool config (ruff, mypy, pytest)
├── requirements.txt          ← pinned runtime deps
├── Makefile                  ← make build / test / lint / clean
├── build.sh                  ← one-command C++ build
├── LICENSE
├── CHANGELOG.md
├── CONTRIBUTING.md
├── SECURITY.md
│
├── resolver/                 ← C++ DNS resolver
│   ├── dns_resolver.cpp      ← multi-threaded resolver source
│   └── Makefile
│
├── subhunter/                ← Python package
│   ├── __init__.py
│   ├── __main__.py           ← enables `python -m subhunter`
│   ├── py.typed              ← PEP 561 marker
│   ├── cli.py                ← pipeline orchestration + all CLI flags
│   ├── enumerators/          ← one file = one OSINT source
│   │   ├── virustotal.py
│   │   ├── crtsh.py
│   │   ├── github.py
│   │   ├── sublister.py
│   │   └── shodan.py
│   ├── resolvers/
│   │   └── dns_resolver.py   ← wraps C++ binary; auto-builds; Python fallback
│   ├── scanners/
│   │   └── nuclei.py         ← runner + CSV parser
│   ├── output/
│   │   ├── terminal.py       ← Rich tables, panels, progress
│   │   └── html_report.py    ← standalone HTML report generator
│   ├── ai/
│   │   └── analyzer.py       ← Claude + OpenAI integrations
│   └── utils/
│       └── helpers.py        ← shared I/O + normalisation
│
├── tests/                    ← pytest suite (42 tests, no network required)
│   ├── conftest.py
│   ├── test_helpers.py
│   ├── test_nuclei_parser.py
│   ├── test_resolver.py
│   └── test_html_report.py
│
└── .github/
    ├── workflows/ci.yml      ← CI: C++ build (Linux+macOS), Python 3.9–3.13, lint
    ├── ISSUE_TEMPLATE/
    └── PULL_REQUEST_TEMPLATE.md

Installation

Prerequisites

Tool Required Notes
Python ≥ 3.9 Yes python3 --version
g++ (C++17) Yes sudo apt install g++ make on Debian/Kali
Nuclei Optional For vulnerability scanning
Sublist3r Optional For extra enumeration

Quick start

# 1. Clone
git clone https://github.com/Keyur-Aghao/SubHunter.git
cd SubHunter

# 2. Install Python deps
pip install -r requirements.txt

# 3. Build the C++ DNS resolver
bash build.sh

# 4. (Optional) Install as a package with the `subhunter` CLI command
pip install -e .

Dev install (with tests, linting, type checking)

make dev-install   # pip install -e ".[all]" + build.sh

External tools

pip install sublist3r                                          # Sublist3r
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest  # Nuclei

Configuration

SubHunter reads API credentials from files or environment variables. Never commit secrets.

VirusTotal - vt_keys.csv

APIKEY,Remaining
YOUR_VT_KEY_HERE,500

GitHub - .tokens

ghp_xxxxxxxxxxxxxxxxxxxx
ghp_yyyyyyyyyyyyyyyyyy

Or: export GITHUB_TOKEN=ghp_xxxxx (tokens rotate automatically on rate-limit)

Shodan

export SHODAN_API_KEY=your_key
# or: --shodan-key YOUR_KEY

AI providers

export ANTHROPIC_API_KEY=sk-ant-xxxxx   # Claude (default)
export OPENAI_API_KEY=sk-xxxxx          # OpenAI (alternative)

Usage

Basic - enumerate subdomains

python subhunter.py -i domain_list.txt

DNS resolution + HTML report

python subhunter.py -i domain_list.txt --html -o Reports/

Full pipeline

python subhunter.py \
  -i domain_list.txt \
  --html \
  --nuclei \
  --ai \
  --ai-provider claude \
  -o Reports/scan_$(date +%F)

crt.sh only (no API keys needed)

python subhunter.py -i domains.txt \
  --disable-vt --disable-github --disable-sublister --disable-shodan

JSON output

python subhunter.py -i domains.txt --format json | jq '.subdomains[]'

OpenAI analysis with model override

python subhunter.py -i domains.txt --ai --ai-provider openai --ai-model gpt-4o-mini

Via installed package

subhunter -i domains.txt --html --ai
python -m subhunter -i domains.txt --html --ai

CLI Reference

Input / Output

Flag Default Description
-i, --input-domains domain_list.txt Root domains file (one per line)
-o, --output-dir Outputs All output files go here
--format terminal terminal | json | both
--html off Generate standalone HTML report

API Credentials

Flag Default Description
--vt-keys vt_keys.csv VirusTotal keys CSV
--github-tokens-file .tokens GitHub tokens (one per line)
--shodan-key env var Shodan API key

Enumeration Sources

Flag Description
--disable-vt Disable VirusTotal
--disable-crtsh Disable crt.sh
--disable-github Disable GitHub code search
--disable-sublister Disable Sublist3r
--disable-shodan Disable Shodan

DNS Resolution (C++ Resolver)

Flag Default Description
--no-resolve off Skip DNS resolution
--resolve-threads 100 Parallel threads in C++ binary
--resolve-timeout 3 Per-hostname timeout (seconds)

Nuclei

Flag Default Description
--nuclei off Run Nuclei after enumeration
--nuclei-templates built-in Custom templates path
--no-nuclei-csv off Skip CSV parsing

AI Analysis

Flag Default Description
--ai off Run AI security analysis
--ai-provider claude claude or openai
--ai-key env var API key override
--ai-model provider default e.g. claude-opus-4-6, gpt-4o

Performance

Flag Default Description
-w, --workers 8 Enumeration worker threads
--timeout 15 HTTP timeout (seconds)
-v, --verbose off Debug logging

Output Files

All files are written to --output-dir (default Outputs/):

File Contents
subdomains.txt Sorted list of all discovered subdomains
dns_results.json DNS resolution results (hostname, IP, alive, latency)
nuclei_raw.txt Raw Nuclei output
nuclei_parsed.csv Nuclei findings sorted by severity
ai_analysis.md AI analysis in Markdown
report.html Self-contained HTML security report

C++ DNS Resolver

The resolver at resolver/dns_resolver.cpp uses:

  • POSIX getaddrinfo for DNS resolution (IPv4 + IPv6)
  • std::thread for parallelism (up to 500 threads)
  • JSON output to stdout - consumed by the Python wrapper

The Python wrapper in subhunter/resolvers/dns_resolver.py:

  1. Checks if the binary exists
  2. Auto-builds it via make if not found
  3. Falls back to Python's socket.getaddrinfo if compilation fails
# Direct usage
echo -e "google.com\nexample.com" | ./resolver/dns_resolver -t 50 -timeout 3
[
  {"hostname":"example.com","ip":"93.184.216.34","alive":true,"latency_ms":12.4},
  {"hostname":"google.com","ip":"142.250.185.78","alive":true,"latency_ms":8.1}
]

AI Analysis

The AI module (subhunter/ai/analyzer.py) sends a structured security prompt to the chosen model, covering all discovered subdomains, DNS results, and Nuclei findings.

The AI returns a Markdown report with six sections:

  1. Attack Surface Summary - subdomain count, naming patterns, infrastructure inferences
  2. High-Priority Targets - most interesting alive hosts and why
  3. Vulnerability Analysis - per-finding risk, impact, and CVSS context
  4. Attack Chains - multi-step exploitation paths
  5. Recommended Next Steps - prioritised remediation checklist
  6. OSINT Notes - tech stack and operational inferences
Provider Default Model Env Variable
claude (default) claude-opus-4-6 ANTHROPIC_API_KEY
openai gpt-4o OPENAI_API_KEY

Testing

make test          # full suite with coverage
make test-fast     # stop on first failure

The suite (42 tests) requires no network access and no API keys - all external calls are mocked.

tests/test_helpers.py         12 tests - normalize, write_list
tests/test_nuclei_parser.py   12 tests - parser, severity sorting, CSV output
tests/test_resolver.py         7 tests - Python DNS fallback (mocked socket)
tests/test_html_report.py     11 tests - HTML generation, content, no-CDN guarantee

Adding a New Source

  1. Create subhunter/enumerators/mysource.py with a single enumerate(domain, ...) -> Set[str] function
  2. Wire --disable-mysource flag and flags["mysource"] in cli.py
  3. Write tests in tests/test_enumerators.py

See CONTRIBUTING.md for the full guide.


Legal Notice

SubHunter is intended exclusively for authorized security testing, bug bounty programs, CTF competitions, and educational use. Only scan domains you own or have explicit written permission to test. Unauthorized scanning may violate computer fraud laws in your jurisdiction.


Made for the security community — use responsibly.

About

SubHunter is a unified, installable CLI tool for enterprise-grade subdomain enumeration and vulnerability scanning. It integrates multiple OSINT and offensive security sources into a single workflow:

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.