Skip to main content

Automated subdomain takeover scanner for AWS S3, GitHub Pages, and Azure

Project description

๐Ÿ” Subdomain Takeover Scanner

A Python tool that discovers subdomains and checks them for takeover vulnerabilities against AWS S3, GitHub Pages, and Azure.

โš ๏ธ For authorized use only. Always obtain written permission before scanning.


๐Ÿง  How It Works

  1. Passive recon โ€” Queries crt.sh (Certificate Transparency logs) for known subdomains
  2. Active brute-force โ€” Resolves subdomains from a wordlist via multi-threaded DNS
  3. CNAME matching โ€” Checks CNAME records against known vulnerable cloud service patterns
  4. HTTP fingerprinting โ€” Fetches each subdomain and looks for "unclaimed" error pages
  5. Reporting โ€” Outputs terminal table, HTML dashboard, and PDF report

โš™๏ธ Setup

1. Clone the repository

git clone https://github.com/adarshvardhansingh12/subdomain-takeover-scanner.git
cd subdomain-takeover-scanner

2. Create virtual environment

python3 -m venv venv

3. Activate virtual environment

Linux / Kali / macOS

source venv/bin/activate

Windows

venv\Scripts\activate

4. Install dependencies

pip install -r requirements.txt

5. Verify installation (optional)

python3 main.py -h

๐Ÿš€ Usage

# Basic scan (passive + brute-force)
python3 main.py -d example.com

# Passive only (no brute-force)
python3 main.py -d example.com --no-bruteforce

# Custom wordlist + output name
python3 main.py -d example.com -w wordlists/subdomains.txt -o results/example_scan

# More threads for faster scanning
python3 main.py -d example.com -t 50

๐Ÿ“Š Output

Each run produces:

  • ๐Ÿ–ฅ๏ธ Terminal โ€” color-coded findings table with severity and confidence
  • ๐ŸŒ HTML report โ€” executive summary cards + full findings + all subdomains table
  • ๐Ÿ“„ PDF report โ€” professional pentest-style report with remediation steps

โ˜๏ธ Supported Takeover Services

Service Severity Detection Method
AWS S3 Critical CNAME + NoSuchBucket response
GitHub Pages High CNAME + There isn't a GitHub Pages site here
Azure Critical CNAME + 404 Web Site not found

๐Ÿ“ Project Structure

subdomain-takeover-scanner/
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ scanner/
โ”‚   โ”œโ”€โ”€ enumerator.py
โ”‚   โ”œโ”€โ”€ detector.py
โ”‚   โ”œโ”€โ”€ fingerprints.py
โ”œโ”€โ”€ reports/
โ”‚   โ”œโ”€โ”€ html_report.py
โ”‚   โ”œโ”€โ”€ pdf_report.py
โ”‚   โ”œโ”€โ”€ terminal_report.py
โ”œโ”€โ”€ wordlists/
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

โš ๏ธ Limitations

  • Depends on external APIs (may fail or rate-limit)
  • Possible false positives
  • Limited fingerprint database
  • No rate limiting (yet)

๐Ÿš€ Roadmap

  • crt.sh passive enumeration
  • Multi-threaded DNS brute-force
  • AWS S3 / GitHub Pages / Azure detection
  • HTML + PDF + terminal reports
  • Heroku / Netlify / Fastly fingerprints
  • Slack/email alerting
  • CI/CD integration mode

๐Ÿ’ผ Resume Line

Built a subdomain takeover scanner that combines passive CT log enumeration (crt.sh) with active DNS brute-forcing and HTTP fingerprinting to detect unclaimed AWS S3, GitHub Pages, and Azure resources. Generates PDF/HTML pentest reports with remediation guidance.


๐Ÿค Contributors

  • Adarshvardhan Singh
  • Lincy Pandit

โญ Support

If you found this useful:

  • โญ Star the repo
  • ๐Ÿด Fork it
  • ๐Ÿ› ๏ธ Contribute improvements

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

subdomain_takeover_scanner-1.0.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

subdomain_takeover_scanner-1.0.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file subdomain_takeover_scanner-1.0.0.tar.gz.

File metadata

File hashes

Hashes for subdomain_takeover_scanner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cfdf13d1f4f4d7969b09a7e347131e1acd5f4c869b7006e7574ee7dbaecc637f
MD5 f804e78da5ba6d9b06b9f85730fd3db7
BLAKE2b-256 f7b18d14ccc45427e5ef58a39a0e321f5c00a0a0edcb115c68b448879aa499e4

See more details on using hashes here.

File details

Details for the file subdomain_takeover_scanner-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for subdomain_takeover_scanner-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e70a7e735c3daabe1501c981b576879edc76710c85b2ce32429a6ed4513f618a
MD5 571109e07ff6dd0a87e03c8af0f4229b
BLAKE2b-256 738acfc148feb7bc3b39cd28bdb00e2edc6162b058e8ae61781ea998a4c8f8fe

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