Subdomain enumeration, passive
- Noise
- Passive
- Reads
org/domains.txt- Writes
subs/passive.txtsubs/all.txt
A name you never list is a host nobody tests. Build the biggest list of subdomain names you can from third-party data: Certificate Transparency logs, passive DNS databases, search engines, code search and scan indexes. None of these tools contact the target, so you can run them on any program.
Passive results include dead names. That is fine. Phase 4 sorts live from dead.
| Tool | Noise | Strength | Status |
|---|---|---|---|
| Subfinder | Passive | Fast, many sources, easy API key config | Maintained |
| Amass enum | Passive | Deepest source coverage, graph database of results | Maintained, CLI changed in v4 and v5 |
| Assetfinder | Passive | Tiny, pipes well | Works, rarely updated |
| Findomain | Passive | Fast Rust binary | Maintained |
| Chaos | Passive | ProjectDiscovery’s dataset for bug bounty programs | Maintained, needs a free key |
| github-subdomains | Passive | Names mentioned in public GitHub code | Maintained |
| uncover | Passive | Queries Shodan, Censys, FOFA and others from one CLI | Maintained |
| shosubgo | Passive | Subdomains Shodan has seen for a domain, needs a Shodan key | Maintained |
| AlienVault OTX | Passive | Passive DNS and URLs from the Open Threat Exchange, free | Online service |
| BeVigil | Passive | Subdomains and URLs pulled out of the company’s mobile apps | Online service, free tier |
| crt.sh | Passive | Certificate Transparency, free, no key | Online service, slow at times |
| Sublist3r | Passive | Historical favourite | Old and mostly unmaintained. Subfinder covers its sources |
When to use each source
Section titled “When to use each source”| Source | What you get | What you do not get | Tool |
|---|---|---|---|
| Certificate Transparency | Every name a public certificate authority (CA) put on a certificate | Hosts that never requested a public certificate: internal VPN, plain HTTP, SSH | Subfinder, crt.sh |
| Passive DNS | Names resolvers actually answered, with first-seen and last-seen dates | Bulk history, unless you pay SecurityTrails, VirusTotal, or DNSDB | SecurityTrails, VirusTotal, DNSDB |
| Public code | Staging URLs and CI hosts pasted into scripts | Mock hostnames and sample configs that were never registered | github-subdomains |
| Internet-wide scans | Names from TLS (encrypted connection) handshakes and HTTP responses the scanners stored | Anything that does not answer on a port those scanners touch | uncover, Shodan, Censys |
| Curated bounty sets | A ready list for programs Chaos already tracks | New names on a mature program. Other hunters already pulled the same set | Chaos |
Subfinder is the default aggregator. -all adds the slow sources a quick run skips. Run Amass when you want it to walk archived HTML for names the API tools never indexed. That run is slow and heavy on memory. Query crt.sh yourself when an API quota dies or you suspect the aggregator dropped names. Use github-subdomains with a personal access token when you are hunting staging names in code. Use uncover when the name exists only in a banner or a certificate a scanner stored.
What these records prove
Section titled “What these records prove”Certificate Transparency log record
Section titled “Certificate Transparency log record”{ "issuer_name": "C=US, O=Let's Encrypt, CN=R3", "common_name": "dev-api.example.com", "name_value": "dev-api.example.com\napi-v2-dev.example.com", "id": 1827409123, "entry_timestamp": "2024-03-12T14:22:01.450"}A public log recorded that a CA issued a certificate for dev-api.example.com and api-v2-dev.example.com on 12 March 2024. It does not mean either name resolves today, that a server is up, or that Example Inc still holds the domain.
Passive DNS observation
Section titled “Passive DNS observation”Domain: vpn-backup.example.comRecord Type: AValue: 203.0.113.77First Seen: 2022-11-04Last Seen: 2023-06-19Source: Recursive Resolver TelemetrySome resolver saw vpn-backup.example.com answer 203.0.113.77 between November 2022 and June 2023. It does not mean that name still points there, or that the address still belongs to Example Inc.
GitHub code reference
Section titled “GitHub code reference”# Leaked in .github/workflows/deploy.ymlenv: STAGING_GATEWAY: "https://internal-metrics.example.com" AUTH_SERVICE: "https://auth-qa.example.com"Someone committed those strings. It does not mean either name was ever in public DNS. The line can be a plan that never shipped, or a split-horizon name you cannot resolve from the internet.
Trade-offs
Section titled “Trade-offs”Unauthenticated calls to free endpoints get rate-limited or stuck on a Cloudflare captcha. Keys for Chaos, Shodan, Censys, and SecurityTrails take setup time and return fuller lists that finish.
Convincing duds
Section titled “Convincing duds”Wildcard certificate with no apex
Section titled “Wildcard certificate with no apex”CT shows *.internal.example.com. You strip the star, add internal.example.com, and resolve it:
dig +short internal.example.com# emptyThe certificate covered customer tenants or pods. Nobody ever published an A or AAAA for the apex.
Abandoned SaaS vanity name
Section titled “Abandoned SaaS vanity name”Passive DNS still lists ideas.example.com as a CNAME to example.uservoice.com from 2018. Live DNS is NXDOMAIN. The UserVoice contract ended and the CNAME was deleted. There is nothing to probe unless the CNAME is still in live DNS.
Mock hostname in a test
Section titled “Mock hostname in a test”GitHub search hits sandbox-billing-db.example.com inside client_test.go. The label looks expensive. It was a string in a unit test. Nobody created the DNS record.
Sold brand on a parking page
Section titled “Sold brand on a parking page”A search cache still has example-store.com and a pile of product URLs. The company sold that brand three years ago. The name now points at a broker’s parking page.
Step by step
Section titled “Step by step”-
Subfinder with every source.
-alluses every source, including slow ones. With API keys configured, this is usually your biggest single list.Terminal window # Enumerate subdomains for every root domain using all sourcessubfinder -dL org/domains.txt -all -silent -o subs/subfinder.txtSubfinder reads provider keys from
~/.config/subfinder/provider-config.yaml, and AlienVault OTX works with no key at all. The full file, including the Shodan and Censys entries, is in field kit setup. Confirm the sources it will actually query:Terminal window # Show which sources subfinder sees as configuredsubfinder -ls -
Amass. Amass stores results in a local database, then you query names out of it. In v5,
enumruns without active techniques unless you pass-active.Terminal window # Run an Amass enumeration for one root domain (no -active flag)amass enum -d example.comTerminal window # Print the subdomain names Amass has stored for that domainamass subs -names -d example.com > subs/amass.txt -
Small fast tools. They overlap with Subfinder but each one finds a few names the others miss.
Terminal window # Assetfinder: subdomains only, no related domainsassetfinder --subs-only example.com > subs/assetfinder.txtTerminal window # Findomain: quiet mode prints only subdomainsfindomain -t example.com -q > subs/findomain.txtTerminal window # Chaos dataset (reads PDCP_API_KEY)chaos -d example.com -silent > subs/chaos.txtTerminal window # shosubgo: subdomains Shodan has indexed for the domainshosubgo -d example.com -s "$SHODAN_API_KEY" > subs/shosubgo.txtTerminal window # AlienVault OTX passive DNS, no key neededcurl -s "https://otx.alienvault.com/api/v1/indicators/domain/example.com/passive_dns" | jq -r '.passive_dns[].hostname' | sort -u > subs/otx.txtBeVigil indexes names and URLs taken apart from the company’s published mobile apps, which is a source none of the DNS or certificate tools reach. Query it from its web UI or API with a free key when the target ships an app.
-
Certificate Transparency directly. Useful as a cross-check and when your API quotas run out.
Terminal window # Pull every name crt.sh has seen for the domain, strip wildcardscurl -s "https://crt.sh/?q=%25.example.com&output=json" | jq -r '.[].name_value' | tr '[:upper:]' '[:lower:]' | sed 's/^\*\.//' | sort -u > subs/crtsh.txtWhen the JSON endpoint rate-limits or returns 502, query crt.sh’s Postgres database directly. It is the same data, usually faster, and it never serves a captcha.
Terminal window # Same names straight from the crt.sh Postgres mirrorpsql -h crt.sh -p 5432 -U guest certwatch -At -c \"SELECT ci.name_value FROM certificate_identity ci WHERE reverse(lower(ci.name_value)) LIKE reverse(lower('%.example.com'));" \| tr '[:upper:]' '[:lower:]' | sed 's/^\*\.//' | sort -u > subs/crtsh-pg.txt -
GitHub code. Developers paste hostnames into configs, CI files and READMEs.
Terminal window # Search public GitHub code for subdomains of the targetgithub-subdomains -d example.com -t "$GITHUB_TOKEN" -o subs/github.txt -
Scan indexes through uncover. These return hosts that internet scanners saw serving the target’s certificates.
Terminal window # Ask Shodan and Censys for hosts with the domain in TLS data, print hostnamesuncover -q 'ssl:"example.com"' -e shodan,censys -f host -silent > subs/uncover.txt -
Merge, clean and record. Keep only names under your root domains, lowercase them, and add new ones to the master list.
Terminal window # Merge every source, keep names under example.com, dedupecat subs/subfinder.txt subs/amass.txt subs/assetfinder.txt subs/findomain.txt subs/chaos.txt subs/shosubgo.txt subs/otx.txt subs/crtsh.txt subs/crtsh-pg.txt subs/github.txt subs/uncover.txt 2>/dev/null \| tr '[:upper:]' '[:lower:]' | grep -E '(^|\.)example\.com$' | sort -u > subs/passive.txtTerminal window # Append only new names to the master list and print themanew subs/all.txt < subs/passive.txt
How the output feeds the next phase
Section titled “How the output feeds the next phase”subs/all.txtis the seed for permutations and brute force in phase 3.subs/all.txtgoes straight into resolution in phase 4 if the program bans active DNS work.- The word list you can extract from
subs/all.txt(dev,staging,api-v2) shapes the permutation patterns next.
Common mistakes
Section titled “Common mistakes”- Running Subfinder without API keys and concluding the target is small.
- Forgetting
-all, which skips slower but valuable sources. - Keeping out-of-scope names in the list, then probing them later by accident.
- Trusting Sublist3r alone because an old tutorial used it.
- Treating passive output as live hosts. Many names are years old.
- Throwing away a name that showed up in only one source. A single GitHub hit or one old certificate is often the host nobody else tested.
- Environment words:
dev,stage,staging,uat,qa,test,sandbox,preprod - Internal tool names:
jenkins,gitlab,jira,grafana,kibana,sonar,vault,argo - Version and legacy markers:
old,legacy,v1,beta,2019 - Regional or customer-specific hosts:
eu-west,customer-acme,partner - Names that appear in only one source, especially GitHub or certificates
Next, guess the names no source recorded with brute force and permutations in phase 3.
Open local graph around this page
Linked from here
Recon AtlasFor authorized testing only. Your scope is the map edge.