Lesson 4 of 9 · 26m
Subdomain Enumeration Without Fooling Yourself
Build a realistic inventory from passive DNS, certificate transparency, crawling, cloud assets, and internal sources — then reconcile it against DNS.
You cannot defend subdomains you do not know exist. Enumeration is not just a red-team hobby; it is asset inventory with hostile assumptions. The goal is not the biggest list. The goal is a reconciled list where every name has an owner, a target, and a reason to exist.
Start with passive sources
Certificate Transparency is the highest-value public source because certificates are hard to use quietly:
curl -s 'https://crt.sh/?q=%25.acme-corp.com&output=json' | jq -r '.[].name_value' | tr '\n' ' ' | tr ' ' '\n' | sed 's/^\*\.//' | sort -uPassive DNS databases, search engines, public scan data, GitHub references, JavaScript files, and mobile app strings add more candidates. None of them is complete. Historical data is especially important because dangling records often reference services deleted years ago.
Active resolution is validation, not discovery
Tools can brute-force names, but brute force should be the cleanup step rather than the foundation:
subfinder -d acme-corp.com -silent -o passive.txt
amass enum -passive -d acme-corp.com -o amass.txt
cat passive.txt amass.txt | sort -u > candidates.txt
dnsx -l candidates.txt -a -cname -resp -silent -o resolved.txtA resolving name is active today. A non-resolving name is not automatically irrelevant — it may be dormant, split-horizon, geo-dependent, or only visible through a specific resolver.
Your internal sources matter more
- DNS zone exports from every provider, not just the primary one.
- Terraform, Pulumi, CloudFormation, and deployment history.
- Cloud load balancer, CDN, object storage, and API gateway inventories.
- SaaS admin consoles for custom hostname configuration.
- Old incident tickets and launch checklists.
The worst dangling records usually bypassed infrastructure-as-code. If a record is not represented in code or a documented system, treat it as unowned until proven otherwise.
Build the reconciliation table
hostname record type target owner status
campaign.acme-corp.com CNAME acme.azurewebsites.net marketing verify
status.acme-corp.com CNAME acme.statuspage.io sre active
vpn.lab.acme-corp.com A 203.0.113.44 it investigateVerification is a decision, not a scanner verdict. The table gives a human enough context to decide safely.
Field notes
- Wildcard DNS (
*.acme-corp.com) makes naive enumeration noisy; resolve random labels first to detect it. - Include apex-adjacent delegated zones in scope. A dangling NS above
labis more dangerous than one dead marketing CNAME. - Respect scope and authorization for active probing. Passive collection is not a blanket permission to attack discovered assets.
- Re-run enumeration continuously. DNS inventory is a stream of changes, not an annual spreadsheet.
Was this lesson helpful?