๐ดโโ ๏ธ Subdomain Enumeration for Bug Bounty Hunters: Tools & Techniques
๐ก Why Subdomain Enumeration Is a Core Weapon in Bug Bounty Recon
Subdomains are often the weak links in corporate security. While organizations focus on hardening their main applications, internal tools, staging environments, forgotten APIs, and test dashboards are frequently left vulnerable.
Why Subdomains Are Valuable for Hackers:
- ๐งฑ Legacy or Unmaintained Infrastructure: Old Jenkins panels, forgotten APIs, legacy WordPress instances.
- โ๏ธ Misconfigurations: CORS issues, open redirects, or improperly protected admin panels.
- ๐ High-Impact Vulnerabilities: SSRF, IDOR, RCE, unrestricted file uploads, and more.
๐ฏ The Mission: Find. Filter. Exploit.
- Identify as many subdomains as possible.
- Validate which are live and exploitable.
- Prioritize high-value targets (e.g., dev, admin, internal, staging).
- Launch precise, ethical attacks.
๐ Step 1: Passive Subdomain Enumeration โ Stealth Mode Activated
Passive reconnaissance avoids direct interaction with the target's infrastructure, keeping you invisible to security logs.
๐ง Top Passive Recon Tools & Techniques:
-
CRT.sh โ Certificate Transparency Logs
Advertisement
curl -s "https://crt.sh/?q=%25.target.com&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u
๐ง Pro Tip: Many organizations register internal subdomains in wildcard SSL certificates.
Subfinder by ProjectDiscovery
subfinder -d target.com -o subdomains.txt
๐ Pulls data from APIs like VirusTotal, Censys, AlienVault, and Shodan.
Advertisement
Amass (Passive Mode)
amass enum -passive -d target.com -o passive-amass.txt
๐ง Pro Tip: Use Amassโ config files to add custom sources like GitHub.
Threat Intel APIs (Hackertarget, SecurityTrails)
Advertisement
curl -s "https://api.hackertarget.com/hostsearch/?q=target.com"
๐ Bonus: Merge and Deduplicate Results
cat *.txt | sort -u > all-passive-subdomains.txt
๐ฅ Step 2: Active Subdomain Enumeration โ Time to Get Loud
Active enumeration uncovers hidden, dynamically generated, and unindexed subdomains.
๐งฐ Best Active Recon Tools:
-
dnsx โ DNS Bruteforcing Beast
dnsx -d target.com -w wordlist.txt -o valid.txt
Altdns โ Permutation + Mutation Generator
Advertisement
altdns -i all-passive-subdomains.txt -o permutations.txt -w words.txt
MassDNS โ High-Speed DNS Resolver
massdns -r resolvers.txt -t A -o S -w resolved.txt domains.txt
AXFR โ Zone Transfer Testing
dig axfr @ns1.target.com target.com
๐ Bonus Tool: DNSDumpster.com
Visualize DNS records, mail servers, and subdomains in a neat graph.
Advertisement
๐ Step 3: JS File Recon โ Where Devs Leave Skeletons in Closets
Public JavaScript files often contain hardcoded API keys, endpoints, and dev URLs.
Tools for JS Recon:
-
Katana โ Modern Crawler for JavaScript
katana -u "https://target.com" -d 2 -o js-files.txt
Grep Out Subdomains from JS
Advertisement
grep -Eo "https?://[a-zA-Z0-9./?=_-]*" js-files.txt | grep target.com
LinkFinder (by @Gwen001)
python3 linkfinder.py -i js-files.txt -o output.html
๐ต๏ธโโ๏ธ Step 4: Discovering Wildcard & Shadow Subdomains
Tools for Wildcard & Shadow Subdomains:
-
Wildcard Test with dnsx
echo "randomname123.target.com" | dnsx -a -resp-only
Shadow Subdomains
Advertisement
subfinder -d staging.target.com -o shadow.txt
๐งช Step 5: Filter for Live, Juicy Targets
Tools to Prioritize Targets:
-
httpx โ Check for Live Services
cat all-subdomains.txt | httpx -silent -o live.txt
nuclei โ Vulnerability Detection Framework
nuclei -l live.txt -t vulnerabilities/ -o vulns.txt
Regex Goldmine
Advertisement
cat live.txt | grep -E "admin|api|test|dev|staging"
waybackurls โ Historical Endpoints
cat live.txt | waybackurls | tee archived.txt
๐ง TL;DR โ Subdomain Enumeration Mastery Checklist
- ๐ Start passive for stealth and breadth.
- ๐ฅ Go active to uncover real-time DNS entries and hidden targets.
- ๐ Analyze JavaScript for internal routes, endpoints, and dev secrets.
- ๐ฏ Hunt for wildcards and forgotten shadow zones.
- ๐งช Use tools like httpx, nuclei, and regex filters to prioritize high-value targets.
๐ Bonus Tools to Explore:
- gau โ for grabbing archived URLs.
- gospider โ fast content discovery spider.
- dnsgen โ generate permutations intelligently.
- dirsearch โ for digging into discovered subdomains.
Stay sharp, stay stealthy, and may your next recon lead to a $10,000 bounty.
Advertisement