Subdomain enumeration, active
- Noise
- Light active
- Reads
subs/all.txt- Writes
subs/brute.txtsubs/perms.txtsubs/all.txt
Scope checkActive phase. Check the program policy first. Send traffic only to in-scope assets, at the rate the program allows.
Other hunters run the same passive tools, so the names only brute force and permutation find are the ones nobody has tested. Find names that no public source has recorded. Two techniques do this:
- Brute force tries a wordlist of common labels:
admin.example.com,vpn.example.com, and so on. - Permutation mutates names you already know:
api.example.combecomesapi-dev.example.com,api2.example.com,dev.api.example.com.
Both resolve millions of candidate names. Your queries go to public resolvers, and cache misses reach the target’s authoritative nameservers. That is light traffic per name, but a lot of names, so check the program allows it.
| Tool | Noise | Role |
|---|---|---|
| MassDNS | Light active | The fast resolver engine underneath the others |
| PureDNS | Light active | Brute force and resolve with wildcard filtering and trusted-resolver validation |
| ShuffleDNS | Light active | ProjectDiscovery’s wrapper around MassDNS, with wildcard handling |
| alterx | Passive | Pattern-based permutation generator. Generates names, sends nothing |
| dnsgen | Passive | Permutation generator from known names and a word list |
| gotator | Passive | Permutation generator with depth and number options |
| regulator | Passive | Learns the target’s naming pattern from known names, then generates likelier guesses |
| Trickest resolvers | Passive | Daily validated public resolver lists |
| Assetnote and SecLists DNS lists | Passive | Wordlists built from real DNS data |
The generators are passive. The noise comes when you resolve their output.
When to use each technique
Section titled “When to use each technique”Brute force the root first, with a list built from real DNS such as the Assetnote best-dns list. vpn, sso, gitlab, and monitoring usually sit on the root or on one operational zone. Brute force will not invent a naming scheme the company made up.
Use alterx once you can see the pattern. If you already have api-prod-us.example.com and web-prod-us.example.com, alterx is the tool that tries api-dev-us and api-prod-eu. Cap it. Uncapped output on a big seed list is how you mint hundreds of millions of names.
Use dnsgen or gotator on a smaller seed list. A lot of their mutations are nonsense, so resolve before you keep anything. regulator is the smarter option on a mature target. Instead of pasting words onto every name, it learns the rules behind the names you already found and generates guesses that fit the scheme. Its output resolves at a higher rate.
Use PureDNS to resolve. It sprays lookups across public resolvers, then checks every hit again against a short trusted list such as 1.1.1.1, 8.8.8.8, and 9.9.9.9. That second pass is what drops poisoned answers. ShuffleDNS is the same idea if the rest of your pipeline is ProjectDiscovery tools. Do not keep raw MassDNS output. Without a wildcard filter and a trusted re-check, bad resolvers will hand you tens of thousands of fake names.
Wildcards first
Section titled “Wildcards first”A wildcard DNS record (*.example.com) makes every name resolve. Without filtering, brute force “finds” every word in your list. Test before you start.
# Resolve a random label; an answer means the zone has a wildcarddig +short "$(head -c 12 /dev/urandom | md5sum | cut -c1-12).example.com"PureDNS and ShuffleDNS detect wildcards and drop the fake results. If you resolve with plain MassDNS, filter wildcards yourself.
A clean root does not mean the zones under it are clean. *.dev.example.com can wildcard while example.com does not. Test the sub-zones you are about to brute force, or a dictionary run will log every word as a host.
What these records prove
Section titled “What these records prove”Confirmed A record
Section titled “Confirmed A record”;; QUESTION SECTION:;auth-staging.example.com. IN A
;; ANSWER SECTION:auth-staging.example.com. 300 IN A 203.0.113.25
;; Query time: 24 msec;; SERVER: 8.8.8.8#53(8.8.8.8)The authoritative server for example.com published an A record, and a trusted resolver returned it. It does not mean anything is listening on port 80 or 443. A firewall can drop every connection from outside the company.
Wildcard answer
Section titled “Wildcard answer”;; QUESTION SECTION:;x98dfh2ks0df.example.com. IN A
;; ANSWER SECTION:x98dfh2ks0df.example.com. 60 IN A 203.0.113.99*.example.com answers for labels nobody created. A brute force run that does not filter this will record the whole wordlist.
Poisoned resolver answer
Section titled “Poisoned resolver answer”;; QUESTION SECTION:;completely-made-up-name.example.com. IN A
;; ANSWER SECTION:completely-made-up-name.example.com. 10 IN A 198.51.100.1An untrusted resolver replaced NXDOMAIN with an address of its own, often an ad page or a captive portal. The company did not create that record. A trusted resolver is the check that matters.
Convincing duds
Section titled “Convincing duds”Nested wildcard
Section titled “Nested wildcard”A random label under example.com returns nothing, so you brute force anyway. Every word under dev.example.com then resolves to 203.0.113.80. The wildcard is *.dev.example.com. The root test never saw it, and the tool wrote down tens of thousands of fake names.
ISP redirect
Section titled “ISP redirect”A stale resolver list turns 500,000 candidates into 4,000 names at 198.51.100.14. dig @1.1.1.1 on any of them is NXDOMAIN. One public resolver was sending misses to an ISP landing page.
Dangling CNAME you cannot claim
Section titled “Dangling CNAME you cannot claim”Brute force finds status-preview.example.com:
status-preview.example.com. 300 IN CNAME example-old.statuspage.io.example-old.statuspage.io is NXDOMAIN. Statuspage will not attach a custom domain until you prove ownership with a TXT record. The CNAME is dead. It is not a takeover.
Preview hostname left behind
Section titled “Preview hostname left behind”Permutation finds pr-1842-web.example.com at 203.0.113.110. Port 443 returns HTTP 503 from an Nginx ingress. The pull request merged, the preview pod is gone, and the DNS cleanup job never deleted the record.
Step by step
Section titled “Step by step”-
Refresh resolvers. Stale resolvers are the top cause of junk results.
Terminal window # Download today's resolver listswget -qO ~/wordlists/resolvers.txt https://raw.githubusercontent.com/trickest/resolvers/main/resolvers.txtwget -qO ~/wordlists/resolvers-trusted.txt https://raw.githubusercontent.com/trickest/resolvers/main/resolvers-trusted.txt -
Brute force with PureDNS. It resolves through public resolvers, then re-checks hits against trusted resolvers to remove poisoned answers.
Terminal window # Brute force example.com with the Assetnote list, wildcard-awarepuredns bruteforce ~/wordlists/best-dns-wordlist.txt example.com \-r ~/wordlists/resolvers.txt --resolvers-trusted ~/wordlists/resolvers-trusted.txt \--rate-limit 3000 -w subs/brute.txtThe ShuffleDNS equivalent, if you prefer ProjectDiscovery tools:
Terminal window # Brute force with ShuffleDNS (newer versions need -mode)shuffledns -d example.com -w ~/wordlists/best-dns-wordlist.txt -r ~/wordlists/resolvers.txt -mode bruteforce -silent -o subs/brute-shuffle.txt -
Add brute force hits to the master list so permutations use them as seeds.
Terminal window # Record new names from brute forcecat subs/brute*.txt | anew subs/all.txt -
Generate permutations. Pick one generator to start. alterx learns words from your list with
-enrich. Cap the output, because permutations grow fast.Terminal window # alterx: patterns plus words extracted from known names, capped at 2 millionalterx -l subs/all.txt -enrich -limit 2000000 -silent > subs/perms-raw.txtTerminal window # dnsgen: classic permutation generator reading known names from a filednsgen subs/all.txt > subs/perms-dnsgen.txtTerminal window # gotator: depth 1, numbers up to 3, skip duplicate-looking mutationsgotator -sub subs/all.txt -perm ~/wordlists/perm-words.txt -depth 1 -numbers 3 -mindup -adv -md -silent > subs/perms-gotator.txtFor
perm-words.txt, start with 50 to 200 words: environments (dev,stg,uat), roles (api,admin,internal) and words from the target’s own names. -
Resolve the permutations.
Terminal window # Resolve generated names, wildcard-filtered, and keep the live onescat subs/perms-*.txt | sort -u | puredns resolve -r ~/wordlists/resolvers.txt \--resolvers-trusted ~/wordlists/resolvers-trusted.txt -w subs/perms.txtTerminal window # Record the new namesanew subs/all.txt < subs/perms.txt -
Repeat once. New names make new permutations. A second round on only the newly found names often finds a few more. Stop after two rounds; returns drop fast.
Other active checks
Section titled “Other active checks”Each of these is optional and worth one try per zone. They cost a handful of requests and now and then hand you the whole list.
-
Zone transfer. A misconfigured authoritative server hands out every record in the zone. Rare, but when it works you can stop brute forcing.
Terminal window # Ask each authoritative nameserver for a full zone transferfor ns in $(dig +short NS example.com); do dig AXFR @"$ns" example.com; doneA real transfer prints dozens of records.
Transfer failedor an empty answer is the normal, secure case. -
NSEC and NSEC3 walking. A DNSSEC-signed zone that uses NSEC answers a nonexistent name with the next name that does exist, so you can walk the whole zone without guessing. NSEC3 hashes the names, so you capture the hashes and crack them offline.
Terminal window # Walk an NSEC-signed zoneldns-walk example.comTerminal window # Enumerate NSEC/NSEC3 records, then crack NSEC3 hashes with nsec3walker or hashcatnsec3map -o dns/nsec3.txt example.com -
Virtual host brute force. A name can exist only as a
Hostheader on a shared IP, with no DNS record at all. The method lives in phase 11; run it once you have origin IPs from phase 4.
How the output feeds the next phase
Section titled “How the output feeds the next phase”subs/all.txtnow holds passive, brute force and permutation names. Phase 4 resolves all of it and records IPs and CNAMEs.subs/brute.txtandsubs/perms.txtare worth tagging in your notes. Names found only by active methods are the ones other hunters’ passive pipelines missed.
Common mistakes
Section titled “Common mistakes”- Using a home connection. Millions of DNS queries can knock your router over and get your ISP’s attention.
- Skipping resolver refresh, then chasing hundreds of fake subdomains.
- Running alterx with no
-limiton 20,000 seeds and generating hundreds of millions of names. - Brute forcing a wildcard zone with a tool that does not filter wildcards.
- Brute forcing on a program that bans automated testing.
- Names found only by brute force or permutation, such as
api-internalnext to a knownapi - Numbered siblings:
app2,app3where onlyappwas public - Environment variants of high-value hosts:
admin-staging,payments-uat - Deep names like
dev.api.eu.example.comthat hint at an internal naming scheme
Next, resolve every name and drop CDN addresses in phase 4.
Open local graph around this page
Recon AtlasFor authorized testing only. Your scope is the map edge.