Skip to content
OSINTblogs

Subdomain enumeration for OSINT: passive methods and free tools

How to find an organisation's subdomains without touching its systems. Certificate transparency, archives, search engines and passive DNS, the free tools that combine them, how to resolve and interpret results, and where passive research ends and active testing begins.

· 7 min read

OSINTblogs domains and infrastructure cover: passive sources first; no packets to the target

An organisation's main website is the part it wants you to see. Its subdomains show how it actually works: vpn, mail, staging, jira, partners, hr-portal, the name of an acquired company, the name of a product that has not launched. Each one is a system, a supplier or a project, and collectively they map the organisation's presence on the internet.

Finding them is called subdomain enumeration. It can be done entirely from public records, without sending anything to the organisation itself. This guide covers those passive methods, and marks clearly where they stop.

Passive and active

Passive

Active

Reads records held by third parties

Sends queries or connections to the target's own systems

Certificate logs, archives, search engines, DNS data sets

Guessing names against its DNS servers, zone transfer attempts, probing web servers

Invisible to the organisation

Visible in its logs

Open-source research

Security testing, which needs permission

Everything in the first half of this guide is passive. Resolving the names you find through a public DNS resolver sits on the border and is generally accepted. Connecting to the hosts is active, and belongs in an authorised test.

Certificate transparency

Every TLS certificate issued by a public authority is logged publicly, with the host names it covers. Since nearly every web service uses TLS, the logs are a near-complete record of names that have ever had a certificate.

curl -s "https://crt.sh/?q=%25.example.com&output=json" | jq -r '.[].name_value' | tr 'A-Z' 'a-z' | sort -u

%25 is an encoded %, the wildcard, so the query matches any name ending in .example.com. Each certificate can list several names on separate lines, which the command flattens and de-duplicates.

What to notice in the results:

  • Wildcard entries such as *.internal.example.com show that a whole level of names exists, without listing them.

  • Issue dates. The logs record when each certificate was issued, so you can see when a service first appeared.

  • Names on other domains in the same certificate. A certificate covering example.com and example-payments.net links the two.

  • Internal-sounding names. Certificates are sometimes requested for systems never meant to be public, and the name is logged anyway.

crt.sh can be slow or time out on large domains. Censys and other certificate search services hold the same underlying data.

Web archives

The Wayback Machine's index lists every host it has captured under a domain, including systems retired years ago.

curl -s "https://web.archive.org/cdx/search/cdx?url=example.com&matchType=domain&fl=original&collapse=urlkey" | awk -F/ '{print $3}' | sed 's/:.*//' | tr 'A-Z' 'a-z' | sort -u

Archived pages themselves contain links to other subdomains, and old JavaScript files often list API host names. See our guide to the Wayback Machine for OSINT.

Search engines

Search engines index pages on subdomains and will list them if you exclude the ones you already know.

site:example.com -site:www.example.com
site:example.com -site:www.example.com -site:shop.example.com -site:blog.example.com

Keep adding exclusions as new names appear. Results differ between search engines, so try more than one. See our Google dorks cheat sheet.

Passive DNS and aggregated data

Passive DNS databases record which names have resolved to which addresses, observed from resolvers and sensors around the world. They reveal names that never had a certificate and were never linked from a web page.

  • VirusTotal shows subdomains and resolution history on a domain's Relations tab.

  • SecurityTrails, DNSDumpster and similar services list known subdomains, with free tiers or free lookups.

  • Scan engines index host names from certificates and reverse DNS. See Shodan for OSINT.

  • Reverse lookups. Once you know an address range the organisation owns, reverse DNS and passive DNS for that range find further names. See IP address OSINT.

Also read the domain's own public DNS records. Mail, verification and policy records name third-party services:

dig +short MX example.com
dig +short TXT example.com
dig +short NS example.com

An SPF record listing several mail providers, or verification tokens for particular platforms, tells you which suppliers the organisation uses. This is a query to public DNS and reveals nothing unusual.

Tools that combine the sources

Two open-source tools query dozens of passive sources at once.

# subfinder: fast, passive by design
subfinder -d example.com -all -silent -o subfinder.txt

# amass: broader, slower. The passive flag keeps it to third-party sources
amass enum -passive -d example.com -o amass.txt

# merge everything
cat subfinder.txt amass.txt crtsh.txt wayback.txt | tr 'A-Z' 'a-z' | sort -u > all-names.txt

Both give better results with free API keys for the services they query, configured in their settings files. Without keys they still use the open sources. Check the documentation for the current flags, which change between versions. Broader frameworks such as SpiderFoot and recon-ng are set side by side in our comparison of OSINT frameworks.

No single source is complete. Certificate logs miss services without TLS, archives miss what was never crawled, and passive DNS misses what was never looked up near a sensor. Merging several is the method.

Which names are alive?

A list of names from historical sources includes many that no longer exist. Resolve them through a public resolver:

while read name; do
  ip=$(dig +short "$name" @1.1.1.1 | tail -n1)
  [ -n "$ip" ] && echo "$name $ip"
done < all-names.txt > resolved.txt

Dedicated tools such as dnsx do the same far faster.

Two things to watch for:

  • Wildcard DNS. Some domains answer for any name at all. Test a random name such as qz7x1k9.example.com. If it resolves, every guess will appear to exist, and you must compare addresses to separate real entries from the wildcard.

  • Names that resolve to private addresses. Records pointing to ranges such as 10.x.x.x or 192.168.x.x describe internal systems. They are not reachable from outside, but they show how the internal network is named.

Reading the results

What the names say

Pattern

Suggests

dev, test, staging, uat, beta

Pre-production systems, often less protected

vpn, remote, citrix, rdp

Remote access

mail, owa, autodiscover, smtp

Email systems and which platform

jira, confluence, gitlab, jenkins

Internal tools exposed to the internet

sso, login, auth, adfs

Identity systems

City or country names

Offices and regional operations

Another company's name

An acquisition, a partner or a client portal

A product name not yet announced

Plans

Dates or version numbers

Campaigns and legacy systems

Where they point

Group the resolved names by address and by the network that owns each address.

  • Names pointing to a cloud or software provider show which third-party services are in use: a help desk platform, a marketing tool, a shop system. A CNAME record names the supplier outright.

dig +short CNAME support.example.com
  • Names in the organisation's own address space show what it hosts itself.

  • Clusters on one address are services sharing a server or a load balancer.

Dangling records

A subdomain whose CNAME points to a cloud service that the organisation has since cancelled is "dangling". In some cases another person can claim the abandoned resource at the provider and serve content on the organisation's subdomain. This is known as subdomain takeover.

Passive research can identify candidates: a name resolving to a provider that returns its standard "no such site" error. Stop there. Claiming the resource to prove the point is taking over part of someone else's domain, and is not something to do without written authorisation. Report it to the organisation instead.

Where passive ends

These techniques are part of security testing and need permission from the domain's owner:

  • Brute-forcing names from a word list against the organisation's authoritative DNS servers.

  • Zone transfer requests to its name servers.

  • Probing discovered hosts for open ports, web titles or screenshots.

  • Virtual host discovery against its web servers.

  • Any attempt to log in or to access content not offered to ordinary visitors.

Tools make it easy to slide from one mode to the other with a single flag. Know which mode a command runs in before pressing Enter. Laws on unauthorised access and on scanning vary by country. See our overview of whether OSINT is legal.

For the organisation's own security team, with authority over the domain, the active steps are appropriate and worthwhile, and the passive list is where they start.

Using this defensively

Run the passive methods against your own organisation on a schedule.

  1. Enumerate from all sources and save the list with the date.

  2. Compare with last month's list. Investigate anything new.

  3. Compare with the official asset inventory. Names that are in public records and not in the inventory are the interesting ones.

  4. Check resolving names for dangling records and unexpected providers.

  5. Retire DNS records when services are retired.

  6. Avoid descriptive names for sensitive systems, and remember that requesting a public certificate publishes the name.

A worked example

Passive enumeration of a mid-sized company returns 140 names, of which 61 resolve.

  1. Certificate logs supply 95 names, archives 30 more and passive DNS another 15.

  2. A group of names carries the name of a firm the company acquired two years ago, still on that firm's old hosting.

  3. support is a CNAME to a help desk platform and shop to an e-commerce platform. Mail records point to a major cloud mail provider.

  4. staging-api resolves to a cloud address, with a certificate issued three weeks ago.

  5. careers-2021 is a CNAME to a site builder, and the provider returns its "site not found" page.

The findings: the company's suppliers for support, e-commerce and email are identifiable from DNS, the acquired firm's systems have not been migrated, a new API is in preparation, and one record appears to be dangling and should be reported. Every statement comes from third-party records and public DNS. See OSINT pivoting for taking each lead further, and preserving web evidence for keeping the outputs.

Frequently asked questions

What is subdomain enumeration?

Finding the subdomains that exist under a domain, such as mail.example.com or dev.example.com, in order to map an organisation's internet-facing systems.

How do I find all subdomains of a domain?

Combine several passive sources: certificate transparency logs, web archives, search engines and passive DNS, by hand or with tools such as subfinder and amass. No single source is complete.

Passive enumeration from public third-party records is lawful. Active techniques that query or probe the target's own systems are security testing, and should only be done with the owner's permission.

What is the best free subdomain finder?

There is no single best. crt.sh is the richest single source, and subfinder and amass combine many sources automatically.

What is a subdomain takeover?

When a subdomain still points to an external service the owner has stopped using, allowing someone else to claim that service and control what the subdomain shows.

Share this post

Written by

Dheeraj Yadav

Founder of OSINTverse, where I build OSINT tools for investigators and journalists. Self-taught ethical hacker working in bug hunting, malware analysis and digital forensics. Previously ran OSINTCon, now OSINT Collective.

Terms used in this post

CDX API
The Wayback Machine's index of captures, which can be queried to list every archived address, date and status code for a site.

More definitions in the OSINT glossary.

Newsletter

New OSINT write-ups by email

An email when there are new posts on OSINTblogs. No fixed schedule and no account needed.

We email a link to confirm. Unsubscribe at any time. See the privacy policy.

More from Dheeraj Yadav

Report this post