# Subdomain Enumeration > Building the most complete, resolvable list of hostnames under a target's root domains by combining passive datasets (CT logs, passive DNS, archives) with active generation (brute force, permutations, vhosts), then filtering wildcards and probing for live services. ## How it works The pipeline is the same across nearly every methodology and framework in the sources: **root domains → passive collection → resolve/filter → active generation (brute force + permutations) → resolve/filter again → HTTP probe**. Wiz's masterclass phases it as passive (subfinder) → resolution (puredns, dig) → active (puredns, alterx) → root-domain discovery (acquisitions, WHOIS) → public exposure (httpx), and puts a medium-sized company at 30–60 minutes of work. - **Passive** never touches the target's infrastructure: CT logs, passive-DNS aggregators, search engines, web archives. Fast and stealthy, but accepts stale or bogus names blindly. - **Active** sends DNS queries to the target's authoritative servers (brute force, alterations, zone transfer, NSEC walking) or HTTP requests to its web servers (vhost fuzzing, crawling). It finds names that never appeared in any public dataset. - Enumeration only finds *names*. Volume is not attack surface: wildcard DNS, CDNs and dead records inflate the count until the list is resolved and fingerprinted. Root-domain expansion (acquisitions, reverse WHOIS, ASN/org search) comes before this step and lives in [[Asset Discovery]]. [[OWASP Amass]] `intel` handles part of it. ## Techniques / commands ### Passive sources | Source | Command | |---|---| | subfinder (dozens of passive APIs) | `subfinder -d target.com -all -recursive -silent` · JSON: `-oJ` | | Chaos (ProjectDiscovery dataset, API key) | `chaos -d target.com -silent` | | assetfinder / findomain | `assetfinder --subs-only target.com` · `findomain -t target.com -q` | | Amass passive | `amass enum -passive -d target.com -src` | | crt.sh (CT logs) | `curl -s "https://crt.sh/?q=%25.target.com&output=json" \| jq -r '.[].name_value' \| sed 's/\*\.//g' \| sort -u` | | Wayback CDX | `curl -s "http://web.archive.org/cdx/search/cdx?url=*.target.com/*&output=text&fl=original&collapse=urlkey" \| unfurl -u domains` | | gau | `gau target.com --threads 10 --subs \| unfurl -u domains` | | Others with plain HTTP APIs | hackertarget `hostsearch`, Anubis (`jldc.me`), subdomain.center, WhoisXML, Riddler | | Search / internet scanners | `site:*.target.com -site:www.target.com` ([[Google Dorking]]); Shodan `hostname:target.com`; Censys | | theHarvester | `theHarvester -d target.com -b all -f out.json`. Also yields emails, ASNs and IPs | Notes: - Configure API keys (`~/.config/subfinder/provider-config.yaml`, Chaos `~/.config/chaos/config.yaml`, Amass `datasources.yaml`). Keyless runs return a fraction of the results. - **Certificate Transparency** leaks internal app names whenever an org requests a public cert for an internal host. Use the Certspotter API (throttled free tier) for one-off lookups and `gungnir` to stream new certs within seconds of issuance. `ctfr-reloaded -d target.com --source all --resolve --alive --takeover --tls --cdn` combines CT lookup with resolution, liveness and takeover hints, and has `--watch --interval 1800` for monitoring and `--pipe | httpx` for chaining. - Normalize and dedupe immediately: `cat subs_*.txt | tr '[:upper:]' '[:lower:]' | sort -u`. ### Resolution and resolvers - `puredns resolve subs.txt -r resolvers.txt` wraps massdns. Its value is **wildcard and DNS-poisoning filtering**: public resolvers return bogus answers that ruin raw massdns output. ProjectDiscovery's one-shot script found 28,711 names with shuffledns, and `puredns resolve` cut that to 12,039 after detecting the wildcard root `*.signon.aws.amazon.com`. - Resolver lists must be validated (reconFTW uses `dnsvalidator`). Bad resolvers produce both false positives and silent drops. BBOT 3.1 samples `dns.brute_max_resolvers` (default 600) at random, drops dead resolvers at startup, and reports resolver diagnostics when brute-force delivery drops. - Don't treat one failed resolution as proof a name is gone. Quasar keeps passive candidates that fail PureDNS resolution because a DNS failure at one point in time is not permanent. ### Brute force ```bash puredns bruteforce wordlist.txt target.com -r resolvers.txt shuffledns -d target.com -w n0kovo_subdomains_huge.txt -r resolvers.txt -o out.txt gobuster dns -d target.com -w wordlist.txt amass enum -brute -w wordlist.txt -d target.com # see [[OWASP Amass]] ``` Results depend on the wordlist. Build a target-specific list from naming patterns in passive results, then expand it with `mksub` (Trickest). SecLists and n0kovo lists are the common bases. ### Permutations / alterations Naming conventions are predictable. If `dev-billing` exists, try `staging-billing`, `qa-billing` and `dev-billing-v2`, and go deeper than one level (`api-v2.dev.us-east.target.com`): ```bash cat all_passive_subs.txt | alterx -silent | dnsx -silent -a -resp -o resolved_permutations.txt amass enum -alts -d target.com # or hashcat-style masks: -awm / -wm "zzz-?l?l?l" ``` - **Subwiz** (Hadrian) is an ML model that predicts likely subdomains from known ones. v1.0 was retrained on a 5x larger dataset that includes the apex and TLD, adds `--multi-apex`, and has a recursive mode where iteration *k* output seeds iteration *k+1* up to `max-recursion`. Starting from only `www` of a large social network, it found ~1,200 subdomains. - **BBOT** `-p subdomain-enum` combines passive APIs with recursive DNS brute force using target-specific mutations. `-rf passive` restricts it to passive sources. In 3.1, massdns was replaced by blastdns 2.0, which halved wall time on a large wildcard scan with the same results. New passive sources: `otilabs` and `scanmalware` (opt-in). ### Other active sources - **Vhost fuzzing**: names that share an IP but are routed by `Host`: `ffuf -c -r -u 'https://www.target.com/' -H 'Host: FUZZ.target.com' -w dns-wordlist.txt`. Flag outlier responses. - **Reverse DNS** over discovered or ASN IP ranges: `cat ips.txt | dnsx -ptr -resp-only`. subdive also sweeps the /24 around each discovered IP. - **TLS SANs** from handshakes against resolved hosts, and AXFR attempts against every authoritative NS (subdive, `amass enum -active`). - **Crawling and JS**: Burp's passive crawl and headless DOM analysis pull API and microservice hostnames out of a single page visit. See [[JavaScript Analysis]]. ### Wildcard handling Test first: `dig +short randomstring998877.target.com`. If it resolves, use puredns's wildcard filtering, or filter by IP and page size at the HTTP-probe stage. BBOT 3.1 fixed nested wildcard detection (`is_wildcard`), which matters because wildcards are often scoped to a sub-zone (`*.api.target.com`). ### Probe and fingerprint ```bash httpx -silent -ports 80,443,8080,8000,8888 -threads 200 < subs.txt > alive.txt httpx -silent -sc -title -tech-detect < alive.txt > alive-info.txt ``` Then hand off to [[Port Scanning]], [[Content Discovery]] and takeover checks ([[Subdomain Takeover]]: dangling CNAMEs, and BBOT's baddns `DELEGATION` checks for `_acme-challenge`, `_dmarc` and DKIM selectors). ### Rate limiting / WAF Active enumeration across many hosts behind one bot-protection vendor can get you banned from all of them. Rate-limit, rotate egress and follow program rules. BBOT 3.1 filters CDN/WAF ports in its core by default; `--allow-cdn-ports` turns that off. - **SUBX** (`pip install subx-recon`, Python): async passive enumeration across 12 sources (Shodan, Censys, VirusTotal, crt.sh, Chaos and others), in-scope/out-of-scope filtering, then `dnsx` resolution and `httpx` probing that runs only on hosts that resolve. Results go to SQLite or PostgreSQL with `first_seen`/`last_seen`/`last_seen_alive` timestamps for change monitoring ([[raw/pypi.org/subx-subdomain-recon-and-asset-management-framework-13903|PyPI]]). See also [[OSINT]] and [[Python Security]]. ## Notable cases - **100K subdomains → 2 assets**: an external assessment started from ~100,787 names that all resolved to one IP (wildcard DNS). After correlating DNS, redirects and fingerprints, two real assets remained. One was an outdated SmarterMail (build 100.0.7242, 2019) in affected ranges for CVE-2025-52691 (unauthenticated file upload to RCE) and CVE-2026-23760 (password-reset auth bypass). Its `POST /api/v1/auth/force-reset-password` reached server-side processing unauthenticated, and webmail login was served over plaintext HTTP. Lesson: recon quality beats quantity. - **CT logs exposing internal tools**: certificates issued for internal and staging apps reveal names that are often reachable from the internet and expose unauthenticated APIs. The proposed fix is private PKI or wildcard certs (`*.internal.foo.com`) to shrink the leak. - **YesWeHack walkthrough on ATG's public program**: Censys and Shodan `hostname:`, subfinder `-oJ`, Amass, a `site:` dork, gobuster DNS, ffuf vhosts, dnsx PTR and the Burp crawler, all run against one real scope. ## Defenses - Monitor your own CT logs (gungnir or Certspotter) and run periodic `amass track`-style diffs to catch shadow assets before attackers do. See [[Asset Discovery]]. - Use private PKI or wildcard certificates for internal-only hostnames. - Remove dangling records and delegations. See [[Subdomain Takeover]]. ## Related - [[Reconnaissance]] (hub) - [[OWASP Amass]] · [[Asset Discovery]] · [[Subdomain Takeover]] · [[Port Scanning]] · [[Content Discovery]] · [[JavaScript Analysis]] · [[Google Dorking]] - [[Bug Bounty Automation]] · [[Bug Bounty Methodology]] · [[Domain and Infrastructure OSINT]] ## Sources - [[raw/projectdiscovery.io/reconnaissance-102-subdomain-enumeration-projectdiscovery-2917|ProjectDiscovery: Reconnaissance 102, Subdomain Enumeration]] - [[raw/yeswehack.com/subdomain-enumeration-expand-attack-surface-with-active-passive-method-4464|YesWeHack: Subdomain enumeration with active and passive methods]] - [[raw/blog.projectdiscovery.io/building-a-fast-one-shot-recon-script-for-bug-bounty-4875|ProjectDiscovery: Building a fast one-shot recon script]] - [[raw/wiz.io/reconnaissance-overview-bug-bounty-masterclass-11938|Wiz: Reconnaissance Overview, Bug Bounty Masterclass]] - [[raw/codefam.co/the-practical-web-recon-playbook-automated-pipeline-field-tricks-15377|The Practical Web Recon Playbook]] - [[raw/r4gh4v.medium.com/advanced-recon-taking-your-subdomain-discovery-to-the-next-level-4449|Advanced Recon: Taking subdomain discovery to the next level]] - [[raw/medium.com/ultimate-guide-to-subdomain-enumeration-for-bug-bounty-3642|Ultimate Guide to Subdomain Enumeration for Bug Bounty]] - [[raw/medium.com/recon-methodology-subdomain-enumeration-4461|Recon Methodology: Subdomain Enumeration]] - [[raw/naveensrinivasan.com/finding-hidden-internal-apps-through-public-certificate-logs-11391|Finding Hidden Internal Apps Through Public Certificate Logs]] - [[raw/pypi.org/ctfr-reloaded-certificate-transparency-subdomain-discovery-13747|ctfr-reloaded: CT subdomain discovery]] - [[raw/github.com/subwiz-v1-0-ai-subdomain-discovery-release-13461|Subwiz v1.0 release]] - [[raw/github.com/bbot-3-1-0-faster-dns-brute-forcing-and-new-passive-subdomain-sources-14515|BBOT 3.1.0 release notes]] - [[raw/github.com/github-blacklanternsecurity-bbot-the-recursive-internet-scanner-for-ha-6049|blacklanternsecurity/bbot]] - [[raw/github.com/subdive-subdomain-enumerator-14953|subdive: subdomain enumerator]] - [[raw/execure.medium.com/quasar-a-cross-platform-subdomain-enumeration-framework-for-modern-cyb-12911|Quasar: cross-platform subdomain enumeration framework]] - [[raw/github.com/reconftw-automated-recon-tool-4279|reconFTW: Automated Recon Tool]] - [[raw/medium.com/from-100k-subdomains-to-a-real-attack-surface-an-external-security-ass-14397|From 100K Subdomains to a Real Attack Surface]] - [[raw/pypi.org/subx-subdomain-recon-and-asset-management-framework-13903|SUBX: subdomain recon and asset management framework]]