toolhq.io

All posts
7 min readby Jameel Haider

Finding the subdomains you forgot you had, using certificate transparency logs

Ask any team to list their hostnames and you will get the ones in the load balancer. The dangerous ones are the others: staging-old.example.com still pointing at a server nobody patches, jenkins.example.com from a migration three years ago, a vendor subdomain delegated for a campaign that ended.

Certificate transparency logs find them, because almost every one of those hosts needed a certificate at some point, and every publicly trusted certificate is published.

Why CT is a better inventory than a DNS scan

Since 2018, Chrome has required that a certificate appear in public, append only transparency logs before it will trust it. Every public CA now submits what it issues. The logs cannot be edited and cannot be selectively deleted.

That changes what subdomain discovery looks like. The traditional approach is brute force: guess dev, staging, api, vpn, and see what resolves. It finds only names you thought to guess, and it generates noticeable traffic.

CT inverts it. Instead of guessing names, you read a record of names that were certainly real enough for someone to request a certificate. It needs no traffic to the target, finds hosts with unguessable names, and surfaces hosts that no longer resolve at all but may still be running.

It also has a property people miss: the logs are historical. A certificate issued in 2022 for a host decommissioned in 2023 is still in the record. That is often exactly the host worth asking about.

What CT will and will not show you

CT is strong evidence, not a complete map. Worth being honest about the limits before you build a process on it.

It will show you any hostname that appeared in the subject or the subject alternative name list of a publicly trusted certificate, including hosts that are gone, internal names that leaked into a public certificate, and names from vendors issuing on your behalf.

It will not show you a host that only ever used a self signed or private CA certificate, because those are never submitted. It will not show you a host covered solely by a wildcard: if everything sits behind *.example.com, the log holds the wildcard and tells you nothing about what hides underneath. It also will not tell you whether anything is still listening; that is a separate check.

So treat CT as the first pass. It produces a candidate list far better than guessing, and you confirm from there.

Reading the result

Search the logs for your domain and you get a list of certificates, each with issue and expiry dates, the issuing CA, and the hostnames it covers. The certificate transparency lookup does this against the public logs and groups what it finds by hostname.

Four patterns are worth looking for.

Names you do not recognise. The point of the exercise. Each one is a question: what was it, is it still running, who owns it now.

A CA you do not use. If your organisation standardised on one issuer and a certificate appears from another, somebody provisioned something outside the normal process. That is usually a forgotten vendor trial or a team that went around procurement, and occasionally it is worse.

Certificates still being renewed for hosts nobody claims. Automated renewal keeps a decommissioned host's certificate fresh for years. A current certificate on a host no one will claim means something is still running and still has a valid key.

An internal name in a public certificate. payments-internal.example.com in a public log tells an attacker your naming scheme and hints at what to look for. The certificate is not the vulnerability, but the disclosure is real and permanent.

Turning the list into something actionable

A list of hostnames is not yet useful. Three cheap steps make it so.

First, resolve each one. A name with no DNS record is historical and you can set it aside, though note it: an unclaimed name that still has a record pointing at infrastructure you no longer control is the setup for a subdomain takeover. The DNS lookup will tell you what each name currently points at.

Second, check what is actually listening and what certificate it serves. A host answering on 443 with a current certificate is live regardless of what your inventory says. For more than a handful of names at once, the bulk SSL checker will take the whole list and report expiry and chain state for each.

Third, look at the whole picture for anything that surprised you. The domain X-ray pulls DNS, certificate, and header information for one hostname in a single pass, which is usually enough to work out what a mystery host is before you go asking around.

Using it the other way round

The same property that makes CT useful for finding your own hosts makes it a monitor. Because issuance is public and near real time, a certificate issued for your domain by a CA you do not use shows up within hours.

That is the practical value of a CAA record. CAA names in DNS which authorities may issue for your domain, and CT tells you whether anyone ignored it. One sets the policy, the other audits it. The CAA checker shows what your domain currently permits, and the CAA records explainer covers how the record is read.

Neither prevents a determined attacker with control of your DNS. Together they shorten the time between a certificate being issued without your knowledge and you finding out about it, which for most organisations is the gap that matters.

Where to start

Run your apex domain through CT and read the hostname list end to end rather than skimming it. Most teams find between three and a dozen names they cannot account for on a first pass. Resolve them, check what answers, and write down the ones you choose to keep, because the next person to run this search will have the same questions you just had.