🔎 Certificate Transparency Recon: Find Subdomains, Prove What's Real
The moment a team gets a publicly trusted certificate for staging.example.com, that hostname is written into public, append-only logs that anyone can search. Nobody has to link to it, and it doesn't have to be in public
The moment a team gets a publicly trusted certificate for staging.example.com, that hostname is written into public, append-only logs that anyone can search. Nobody has to link to it, and it doesn't have to be in public DNS. It just has to be on a certificate.
That makes Certificate Transparency (CT) one of the cheapest passive recon sources you have. It also makes it one of the noisiest. A CT search hands you names, and a name is not an asset. It may have stopped resolving months ago. It may sit on a certificate shared with domains that belong to someone else. It may point at a vendor that isn't in scope.
This article covers how to pull names from CT, clean them up, and prove which ones are real, live and yours to test before you spend a minute on them.
Only run this against domains you own or are explicitly authorized to test. The examples use
example.com, the domain reserved for documentation.
What CT actually is
Certificate Transparency was first specified in RFC 6962 (June 2013), which RFC 9162, "Certificate Transparency Version 2.0" (December 2021), now obsoletes. Both are Experimental RFCs. The idea: certificates get recorded in public logs, and clients refuse certificates that aren't, which in effect pushes CAs to log everything they issue. Each log is a Merkle tree, so entries can be appended but not quietly removed, and anyone can audit what a CA issued.
It's not optional in practice. Chrome requires publicly trusted TLS certificates to be CT compliant before they validate, and Apple's CT policy says the same for its platforms. Let's Encrypt states that it submits all certificates it issues to CT logs.
For a tester, the useful part is the data: every logged certificate carries the DNS names it's valid for, taken from the Subject Alternative Names and the subject common name. Collect those across all of a domain's certificates and you get a list of hostnames that someone, at some point, wanted to serve over TLS.
What CT does not tell you:
- whether the name resolves today
- who runs the server behind it
- whether it's in your scope
- whether anything on it is vulnerable
Those four gaps are the whole job.
Step 1: Pull the names
OWASP's Web Security Testing Guide covers CT logs in WSTG-INFO-04 (Attack Surface Identification) and uses https://crt.sh/?q=%25.example.com as its example. It also notes that crt.sh has occasional downtime and lists Merklemap and SSLMate's Cert Spotter as fallbacks. That note is accurate: crt.sh returned 502 errors for me while I was writing this.
For scripting, I like Cert Spotter's search API because it's documented and returns structured JSON. Two details from its docs matter here:
- It coalesces the certificate and the precertificate for one issuance into a single object, so you don't get every name twice.
- The listing endpoint returns unexpired issuances only. Names that appeared only on expired certificates won't show up, so use a second source if you want history.
The API pages with an after parameter: pass the id of the last issuance you received and repeat until you get an empty page.
# ct_fetch.py - list unexpired issuances for a domain and its subdomains
import json, sys, time, urllib.parse, urllib.request
API = "https://api.certspotter.com/v1/issuances"
def fetch_all(domain):
issuances, after = [], None
while True:
params = [("domain", domain), ("include_subdomains", "true"),
("expand", "dns_names")]
if after:
params.append(("after", after))
url = API + "?" + urllib.parse.urlencode(params)
with urllib.request.urlopen(url, timeout=30) as resp:
page = json.load(resp)
if not page: # an empty page means you have everything
return issuances
issuances.extend(page)
after = page[-1]["id"]
time.sleep(1) # be polite to a free API
if __name__ == "__main__":
json.dump(fetch_all(sys.argv[1]), sys.stdout, indent=1)
python3 ct_fetch.py example.com > issuances.json
If you already use subfinder, its -s flag limits it to chosen passive sources, for example subfinder -d example.com -s crtsh. Merging a second source is worth it here, because the Cert Spotter listing above leaves out names that only appeared on expired certificates.
Step 2: Clean the list before you trust it
Raw CT output has three kinds of noise, and each one wastes time differently.
Names that aren't your target. One certificate can cover many unrelated domains. When I ran ct_fetch.py on example.com on 22 November 2026, one certificate in the results also covered example.net, example.org and example.edu. On a real target, that's how you end up probing a partner's or a hosting provider's domain by accident. Keep only names equal to, or ending in, your in-scope suffix.
Wildcards. *.example.com tells you a wildcard certificate exists. It doesn't name a host. Keep wildcards in a separate list: they're a hint that hosts may exist that CT will never show you by name, so other discovery methods are worth the effort.
Formatting. Lowercase everything and strip a trailing dot, or Old-Admin.example.com. and old-admin.example.com become two "different" hosts.
Step 3: Prove each name before you test it
This is where CT recon usually goes wrong. A long subdomain list feels like progress, but every name on it is still a lead. I want four answers for each one before it gets any real testing time:
- Does it resolve now? If not, it may be retired, or it may exist only in internal DNS. Either way there's nothing to test from the outside, so park it.
- Does it resolve to something you'd expect? If the name is a CNAME pointing to another company's service, the server isn't the target's, and it may not be in scope.
- Does it answer over HTTPS? A 401, 403 or 404 is still an answer. It proves a server is there.
- Is resolution itself meaningful? If the zone has wildcard DNS, every made-up name resolves, and "it resolves" proves nothing. You need a control.
That last check is the one people skip. The fix is the same as in any other proof: run a request that should fail and make sure it does. Resolve a random name under the suffix first. If that resolves, compare every host's response against the random one before you call anything "live".
Here's a triage script that does all four with the standard library:
# ct_triage.py - turn CT names into checked leads
import argparse, json, secrets, socket, urllib.error, urllib.request
def under(name, suffix):
return name == suffix or name.endswith("." + suffix)
def collect(issuances, suffix):
names, wildcards, other = {}, set(), set()
for iss in issuances:
for raw in iss.get("dns_names", []):
name = raw.strip().lower().rstrip(".")
if not under(name.lstrip("*."), suffix):
other.add(name) # shared cert, not your target
elif name.startswith("*."):
wildcards.add(name) # tells you a pattern, not a host
else:
names[name] = max(names.get(name, ""), iss["not_after"])
return names, wildcards, other
def resolve(name, suffix):
try:
info = socket.getaddrinfo(name, 443, proto=socket.IPPROTO_TCP,
flags=socket.AI_CANONNAME)
except socket.gaierror:
return "no-dns", ""
canon = (info[0][3] or name).lower().rstrip(".")
if canon != name and not under(canon, suffix):
return "off-domain", canon # CNAME to someone else's service
return "resolves", canon
def probe(name):
req = urllib.request.Request(f"https://{name}/", method="GET")
try:
with urllib.request.urlopen(req, timeout=10) as resp:
return str(resp.status)
except urllib.error.HTTPError as e:
return str(e.code) # a 401/403/404 is still an answer
except Exception as e:
return type(e).__name__
if __name__ == "__main__":
ap = argparse.ArgumentParser()
ap.add_argument("issuances") # JSON from ct_fetch.py
ap.add_argument("--suffix", required=True)
ap.add_argument("--probe", action="store_true",
help="send one HTTPS GET per resolving name (in scope only)")
a = ap.parse_args()
with open(a.issuances, encoding="utf-8") as f:
names, wildcards, other = collect(json.load(f), a.suffix)
# Control: a made-up name should NOT resolve. If it does, the zone has
# wildcard DNS and "resolves" proves nothing on its own.
control = f"ct-control-{secrets.token_hex(6)}.{a.suffix}"
if resolve(control, a.suffix)[0] != "no-dns":
print(f"WARNING: {control} resolves (wildcard DNS); "
"compare each host's response against it\n")
for name in sorted(names):
status, canon = resolve(name, a.suffix)
http = probe(name) if a.probe and status == "resolves" else "-"
extra = f"-> {canon}" if status == "off-domain" else ""
print(f"{name:28} {status:11} https:{http:5} "
f"cert until {names[name][:10]} {extra}")
print(f"\nwildcards (patterns, not hosts): {', '.join(sorted(wildcards)) or '-'}")
print(f"other names on the same certs: {', '.join(sorted(other)) or '-'}")
The CNAME check uses AI_CANONNAME, which asks the resolver for the canonical name at the end of any CNAME chain. It's not a full DNS client, so confirm anything interesting with dig.
I ran it against a stand-in issuance file: six certificates for made-up example.com hosts, including a wildcard, a cert shared with example.net, and a name with odd casing and a trailing dot. Real DNS answered, since example.com and www.example.com really exist and the rest don't:
$ python3 ct_triage.py standin.json --suffix example.com --probe
api.example.com no-dns https:- cert until 2026-12-09
app.example.com no-dns https:- cert until 2026-12-09
example.com resolves https:200 cert until 2026-12-02
old-admin.example.com no-dns https:- cert until 2026-11-30
staging.example.com no-dns https:- cert until 2026-12-30
www.example.com resolves https:200 cert until 2027-03-01
wildcards (patterns, not hosts): *.example.com
other names on the same certs: example.net, www.example.net
Six names went in, and two are worth a browser tab. Old-Admin.example.com. was normalized to one host, the wildcard was set aside, and example.net never got a request.
To check the other two paths, I re-ran it with the resolver patched so every name resolves and app.example.com CNAMEs to a stand-in vendor host:
(output trimmed)
WARNING: ct-control-d0819a5169de.example.com resolves (wildcard DNS); compare each host's response against it
api.example.com resolves https:- cert until 2026-12-09
app.example.com off-domain https:- cert until 2026-12-09 -> shop.saas-vendor.example.net
...
Without the control line, that run would have looked like five live hosts, three of them forgotten staging and admin boxes.
Step 4: What to do with each bucket
- resolves + answers: a real lead. Now do the actual work: fingerprint it, map it, test it like any other target in scope. CT got you here; the finding (if there is one) comes from what you prove on that host.
-
off-domain: check the program's scope for the third-party service before sending anything. If the CNAME target looks unclaimed, that's a possible subdomain takeover lead. OWASP's WSTG-CONF-08 lays out manual validation: confirm the record with
dig, compare the response with the provider's known fingerprint, and confirm the resource is unclaimed without claiming it. Report what you observed; don't register anything to "prove" it. - no-dns: park it. Note it in your recon file; a name on a recent certificate that doesn't resolve publicly may be internal, retired or not launched yet, and that's context, not a finding.
- wildcards: a reason to try other discovery methods, not a host to test.
None of these buckets is a vulnerability by itself. "Your staging host is in CT logs" is not a bug report. That host serving an unauthenticated admin panel, proven with a request and a response, might be.
If you're on the defending side
Everything above works the same for your own domains, and it's worth running before someone else does:
- Assume every name on a publicly trusted certificate is public. If a hostname shouldn't be known, it shouldn't be on a public certificate. The browser CT requirements apply to publicly trusted certificates, so purely internal services can use an internal CA instead.
- Clean up DNS when you retire a service. WSTG-CONF-08's remediation is to remove dangling records and keep checking periodically. A CT-derived list of your own names, run through the triage script, is a cheap way to find records that point at things you no longer run.
- Watch for certificates you didn't request. That's what CT was built for. Cert Spotter's API supports polling for new issuances, and its issuer data includes the CAA domains for each CA, so you can compare issuers against your CAA records.
Try it yourself
- Run
ct_fetch.py example.comand look at the raw JSON. You'll see the shared certificate and the wildcard described above. - Run it on a domain you own, then run
ct_triage.pywith--probe. Look for names you forgot about, and for anything off-domain. - If you do bug bounty, pick a program whose scope explicitly includes
*.target, read its rules on automated traffic, and run the same flow. Compare Cert Spotter's list withsubfinder -s crtshand see what each one misses.
Conclusion
CT logs are a gift for recon: one query, no traffic to the target, and you get names people never meant to publish. But the list is a set of leads, and most of them die the moment you check. Clean the list, resolve with a control, check where each name really points, and only then spend testing time. The name in the log was never the finding; what you prove on the host is.
Further reading
- RFC 6962: Certificate Transparency and RFC 9162: Certificate Transparency Version 2.0
- MDN: Certificate Transparency
- Chrome Certificate Transparency Policy and Apple's Certificate Transparency policy
- Let's Encrypt: Certificate Transparency (CT) Logs
- OWASP WSTG-INFO-04: Attack Surface Identification
- OWASP WSTG-CONF-08: Subdomain Takeover
- SSLMate Certificate Transparency Search API v1
- subfinder (ProjectDiscovery)
I'm Krishna, a pentester and the founder of Xalgorix, an open-source AI pentester that only reports vulnerabilities it has actually exploited.
🔐 If this was useful, follow me for more hands-on web & API security write-ups.
🔗 Connect with me on LinkedIn: https://www.linkedin.com/in/xalgord/
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.