Subdomain Enumeration
Each of an organization’s subdomains (mail., dev., vpn., jira., admin.) is a potential door, and often the weakest: forgotten, staging, or third-party-service subdomains tend to be worse protected than the main domain. Enumerating subdomains widens the attack surface, and it’s one of the first recon steps because each finding opens new lines of work.
Three complementary approaches
Section titled “Three complementary approaches”You combine all three for maximum coverage; none is enough on its own:
- Passive: ask third-party sources that already know subdomains.
- Brute force: try a dictionary of names against the target’s DNS.
- Permutations: generate variations of what you already found.
The flow chains discovery, resolution, and live filtering:
flowchart LR
A[Domain] --> B[Passive: CT, aggregators]
A --> C[DNS brute force]
A --> D[Permutations]
B --> E[Raw candidate list]
C --> E
D --> E
E --> F[Resolve with dnsx]
F --> G[Probe live with httpx]
G --> H[Individual fingerprint]
Passive (without touching the target)
Section titled “Passive (without touching the target)”Aggregators query dozens of sources at once:
subfinder -d target.com -all -silentamass enum -passive -d target.comCertificate Transparency is especially powerful: every issued certificate lands in public logs and reveals internal subdomains that were never published. Direct query to crt.sh:
curl -s "https://crt.sh/?q=%25.target.com&output=json" \ | jq -r '.[].name_value' | sed 's/\*\.//' | sort -uOther passive sources: SecurityTrails, VirusTotal, Censys, DNSDumpster.
DNS brute force
Section titled “DNS brute force”Try a dictionary of common names against the target’s DNS, resolving with your own resolver list to go fast:
puredns bruteforce subs.txt target.com -r resolvers.txtgobuster dns -d target.com -w subdomains.txtffuf -w subs.txt -u https://FUZZ.target.com # by HTTP responseThe SecLists wordlists (DNS/ folder) are the usual starting point.
Permutations and alterations
Section titled “Permutations and alterations”From what you found, generate variations (dev1, dev-api, api.dev) and resolve them:
gotator -sub subs.txt -perm permutations.txt | puredns resolve -r resolvers.txt# alternatives: altdns, dnsgenResolve and filter live
Section titled “Resolve and filter live”Separate two things: DNS resolution (does the host exist?) and HTTP probing (is there a web app?). A subdomain that doesn’t resolve is dropped; but one that resolves and does not answer over HTTP isn’t useless: it may expose DNS, mail, VPN, SSH or another non-web service. Don’t discard it just because httpx doesn’t flag it alive:
dnsx -l subs.txt -a -resp # does it resolve? to which IP?httpx -l resolved.txt -title -status-code -tech-detect # alive? what is it?What to do with the subdomains
Section titled “What to do with the subdomains”- Subdomain takeover: does any CNAME point to a released third-party service? (see Subdomain Takeover).
- Staging/dev environments: usually have fewer controls, default credentials, and debug mode on.
- Admin panels, APIs, and VPN: high-value authentication surface.
- Different technologies per subdomain: fingerprint each one individually (see Technology Fingerprinting).
Virtual hosts (vhosts)
Section titled “Virtual hosts (vhosts)”Several sites on the same IP are told apart by the Host header. There may be vhosts not listed in DNS, appearing only when you fuzz that header:
ffuf -w vhosts.txt -u https://target.com -H "Host: FUZZ.target.com" -fs <base_size>gobuster vhost -u https://target.com -w vhosts.txtCommon mistakes
Section titled “Common mistakes”- Staying only passive: you miss the subdomains that aren’t in any third-party source.
- Brute force without reliable resolvers: false positives from wildcard DNS and inconsistent results.
- Not detecting the wildcard (
*.target.comthat resolves everything): you must filter the wildcard IP. - Enumerating but not probing live: a huge list without
httpxprioritizes nothing.
Defensive note
Section titled “Defensive note”Reduce exposure: don’t leave dev/staging subdomains reachable from the Internet, clean up stale DNS records (prevents takeovers), monitor Certificate Transparency to spot unexpected certificates or subdomains, and apply the same controls to the humblest subdomain as to the main one.
Testing checklist
Section titled “Testing checklist”- Passive enumeration (subfinder / amass / crt.sh).
- DNS brute force with a good dictionary (SecLists).
- Permutations of what you found (gotator / dnsgen).
- Resolve and filter live (dnsx + httpx).
- Look for subdomain takeover (dangling CNAMEs).
- Identify staging / dev / admin / API / VPN.
- Discover vhosts via the
Hostheader. - Individual fingerprint of each interesting subdomain.