The Forgotten Attack Surface: Your Subdomain Inventory
Most organizations focus security attention on their primary domain — the main website, the login page, the customer-facing API. But over time, organizations accumulate dozens or hundreds of subdomains: staging environments for feature testing, microsites for past marketing campaigns, internal tools exposed for convenience, customer portals, developer documentation sites, admin interfaces, beta product environments, and legacy systems that were never properly decommissioned.
These subdomains often run older software versions that aren't included in the organization's standard update and patch cycle, have weaker authentication configurations because they were set up as "temporary," weren't included in security reviews, and aren't monitored by security operations teams who focus on production systems. From an attacker's perspective, they represent the easiest entry points into an organization's infrastructure — high-value targets with lower security controls than primary systems.
Certificate Transparency: Why Subdomain Secrecy Is Impossible
One of the most powerful and least understood aspects of modern subdomain discovery is Certificate Transparency (CT) logs. When any web server generates an HTTPS certificate — from Let's Encrypt, DigiCert, Sectigo, or any Certificate Authority — that certificate issuance is recorded in publicly accessible Certificate Transparency logs by requirement. This requirement exists for excellent security reasons: CT logs enable detection of unauthorized certificate issuance. But as a side effect, it means every subdomain that has ever had an HTTPS certificate issued is permanently documented in public logs.
Tools like crt.sh, Censys, and Facebook CT Monitor provide searchable interfaces to these public certificate logs. Searching for %.yourdomain.com on crt.sh returns every subdomain that has ever had a certificate issued, including subdomains that were deleted years ago. The subdomains remain in the logs even after deletion. "Security through obscurity" — hoping attackers don't know your staging environment URL — is completely ineffective against CT log-based discovery. The moment you issued an HTTPS certificate for staging.yourcompany.com, it was permanently documented in public logs.
Comprehensive Passive Enumeration Techniques
Passive enumeration discovers subdomains without sending any queries directly to the target organization — minimizing detection risk and gathering historical data that active scanning would miss:
- Certificate Transparency logs:
crt.shis the most commonly used free CT search interface. Search for%.yourdomain.comto retrieve all documented subdomains. Censys provides more structured CT data with additional metadata. Facebook's CT Monitor tracks certificates issued for specific domains in real-time. - Passive DNS databases: Organizations like SecurityTrails, PassiveDNS, and VirusTotal maintain historical DNS records — records of which IP addresses specific subdomains have resolved to, over time. These databases capture data continuously from DNS resolvers and provide historical DNS resolution history even after DNS records are changed or deleted.
- Search engine indexed subdomains: Google's
site:yourdomain.comsearch operator returns pages from your domain that Google has crawled and indexed. This captures subdomains that have publicly accessible web content. Similarly, Bing and DuckDuckGo have their own indexed subdomain data. - Web archive crawl data: The Wayback Machine (archive.org) has crawled and indexed web content going back decades. Analyzing archived pages from your domain can reveal subdomains and internal URL references that are no longer actively used but reveal forgotten infrastructure.
- Open-source intelligence (OSINT) sources: Job postings (mentioning specific internal system names), developer documentation (GitHub repositories with hardcoded staging URLs), bug bounty reports (containing previously reported subdomain discoveries), and conference presentations can all reveal internal subdomain information through inadvertent disclosure.
Subdomain Takeover: The High-Impact Consequence of DNS Debt
Subdomain takeover is one of the most impactful attacks enabled by subdomain enumeration findings. The scenario: a subdomain (blog.company.com) was set up to point to a third-party service (Tumblr, GitHub Pages, Shopify, Heroku, etc.). The company later stopped using the service but forgot to remove the DNS CNAME record. The subdomain's DNS still points to the now-unregistered or unclaimed external service.
An attacker discovers this dangling DNS record, registers the same service under their own account and claims the custom domain — taking control of blog.company.com. They now control a subdomain that is a trusted part of the victim organization's web presence. The attack enables:
- Credential harvesting: The attacker can serve a convincing phishing page at
blog.company.comthat collects credentials from users who trust the subdomain because it's part of the legitimate company domain. - Cookie theft: If the organization uses cookies scoped to
*.company.com(a wildcard domain cookie), the attacker's controlled subdomain can read those cookies — potentially including authentication session tokens. - Content spoofing: The attacker can serve any content at the trusted subdomain — malware, disinformation, fake customer support pages.
- CSP bypass: If the organization's CSP allowlists
*.company.com, a controlled subdomain provides an allowlisted origin for malicious script injection.
Vulnerable external services that commonly lead to subdomain takeover: Heroku, GitHub Pages, Tumblr, Shopify, Fastly, Amazon S3, Azure, Zendesk, Salesforce SiteCore, and many others.
Subdomain Security Audit Workflow
- Enumerate all known subdomains using passive sources: CT logs (crt.sh), passive DNS (SecurityTrails), search engines, and web archives. Compile a complete list including historical subdomains no longer in active DNS.
- Resolve current DNS state for each discovered subdomain. Which subdomains still have active DNS records? Which have DNS records but return errors or unexpected content? Which have no current DNS records?
- Identify dangling CNAME records — DNS CNAME records pointing to external services where the service account may no longer exist. For each CNAME target, verify the external service still has an active configuration for that domain.
- Assess SSL certificate status for all active subdomains. Expired certificates, mismatched certificates, or self-signed certificates on production subdomains indicate neglected infrastructure that may have additional security issues.
- Verify content and authentication. Does each active subdomain's content match expectations? Is authentication functioning? Are there admin interfaces or sensitive tools exposed without appropriate access controls?
- Document and track changes. Establish a baseline inventory of all subdomains and run automated monitoring that alerts on new subdomains appearing in CT logs (potential unauthorized certificate issuance) and existing subdomains changing DNS configuration.
Remediation Priorities After Discovery
After completing a subdomain audit, prioritize remediation by risk:
- Immediate (same day): Remove all dangling DNS records for services no longer in use. Each dangling CNAME is a potential takeover waiting to happen.
- This week: Renew all expired SSL certificates. Decommission or properly secure any subdomains serving sensitive functions without appropriate authentication.
- This month: Establish a formal subdomain inventory and change management process so new subdomains are documented when created and properly decommissioned when no longer needed.
- Ongoing: Implement CT log monitoring through services like Facebook CT Monitor or Certspotter to receive real-time alerts when new certificates are issued for your domain — enabling rapid detection of unauthorized certificate issuance or shadow IT subdomains created without security review.