Skip to main content

Subdomain Enumeration

Bug Bounty Β· Stage 2 β€” Recon Β· Level: L1 β†’ L4 Β· Reading time: ~12 min

Subdomains are where forgotten, less-tested applications live. The goal is to build a complete, resolved, probed list of hosts β€” then pick the interesting ones.

Passive sources ─┐
Cert transparency┼──► merge & de-dupe ──► resolve (DNS) ──► probe (HTTP) ──► ports ──► screenshots
Brute force ────── β”‚
Permutations β”€β”€β”€β”€β”˜ remove wildcards

1. Passive Enumeration​

Passive sources collect subdomains without touching the target: search engines, certificate logs, DNS datasets and threat-intelligence APIs.

subfinder -d example.com -all -silent -o subfinder.txt
assetfinder --subs-only example.com > assetfinder.txt
amass enum -passive -d example.com -o amass.txt

Certificate transparency directly:

curl -s "https://crt.sh/?q=%25.example.com&output=json" \
| jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u > crtsh.txt
Beginner lane

Add API keys for subfinder's sources (its provider config file). Many sources are free but need a key β€” with keys configured, passive results often grow dramatically.

Merge everything:

cat subfinder.txt assetfinder.txt amass.txt crtsh.txt | sort -u > passive.txt

2. Active Brute Force​

Passive sources miss hosts that never appeared publicly. Brute forcing tries likely names against the target's DNS:

puredns bruteforce best-dns-wordlist.txt example.com -r resolvers.txt -w brute.txt
TipWhy
Use good wordlists (Assetnote, SecLists DNS lists)Quality matters more than size
Use fresh, validated resolversBad resolvers produce false positives
Brute force deeper levels too (*.dev.example.com)Interesting hosts often sit two levels down

3. Permutations​

Generate variations of known names: api β†’ api-dev, api2, dev-api, api-staging…

cat passive.txt brute.txt | sort -u | alterx -silent | dnsx -silent > permutations.txt
Pro lane

Build target-specific wordlists from what you've already found: environment words (dev, stg, uat), regions (eu, us-east), product names, and team names pulled from JavaScript and documentation. Custom permutations often find hosts no public dataset contains.


4. Resolve and Handle Wildcards​

Combine and resolve everything, keeping only hosts with real DNS answers:

cat passive.txt brute.txt permutations.txt | sort -u > all-subs.txt
dnsx -l all-subs.txt -silent -a -resp -o resolved.txt

Wildcard DNS (*.example.com resolving to one IP) makes every random name look valid. puredns filters wildcards automatically; otherwise, test a random string like nonexistent-8f3a1c.example.com β€” if it resolves, treat that IP's results with suspicion.


5. Probe for Live Web Services​

dnsx -l all-subs.txt -silent | httpx -silent -sc -title -td -ip -cname -o live.txt

The flags show status code, page title, detected technologies, IP and CNAME β€” enough to triage hundreds of hosts quickly. Look for:

  • unusual titles (Jenkins, Grafana, Swagger UI, Index of /, Kibana),
  • 401/403 hosts (protected = something worth protecting),
  • default pages and error pages,
  • CNAMEs to third-party services (takeover candidates β€” see the infrastructure Hunt Cards).

6. Port Scanning​

Web apps don't only live on 80 and 443:

naabu -list resolved-hosts.txt -top-ports 1000 -silent -o ports.txt
httpx -l ports.txt -silent -sc -title -o live-ports.txt

Common interesting ports: 8080, 8443, 8000, 8888, 3000, 5000, 9000, 9200 (Elasticsearch), 5601 (Kibana), 6443 (Kubernetes API), 2375 (Docker API).

Port scanning and program rules

Some programs restrict or prohibit port scanning, or ask for low rates. Check the rules, and use conservative rates (-rate) on production infrastructure.


7. Screenshots​

Visually reviewing hundreds of hosts is faster than reading titles:

gowitness scan file -f live-urls.txt

Scroll through the gallery looking for login portals, admin panels, error pages and anything unusual.


The Whole Pipeline​

#!/usr/bin/env bash
d=$1
subfinder -d "$d" -all -silent | sort -u > subs.txt
httpx -l subs.txt -silent -sc -title -td -o live.txt
echo "[+] $(wc -l < subs.txt) subdomains, $(wc -l < live.txt) live"

Key Takeaways​

  • Combine passive sources, certificate logs, brute force and permutations.
  • Resolve with good resolvers, filter wildcards, then probe for live web services.
  • Check non-standard ports and take screenshots to triage quickly.
  • Always filter results against out-of-scope lists before testing.

Next​

Content & Endpoint Discovery