TExcelTAD
Home › Ethical Hacking & Penetration Testing Methodology › Certificate Transparency as a Recon Source

Certificate Transparency as a Recon Source

Every certificate a public certificate authority issues for a website is now written into public, append-only logs, so that a wrongly issued certificate for someone's domain can't stay hidden. That rule protects everyone, and it has a side effect testers rely on: the logs are a near-complete list of the host names an organisation has ever put on a public certificate, including staging-payments, vpn-old and jira-test, the names nobody remembers to put in the asset inventory. This lesson explains how Certificate Transparency (CT) works, reads names from certificates in your sandbox, and analyses a synthetic CT export in Python.

The cryptography behind certificates, chains and CT is in Applied Cryptography; this lesson is about the recon use and its limits.

How CT works, in brief

  • Logs are append-only Merkle-tree structures run by several independent operators. The protocol is specified in RFC 6962 (version 1, the one deployed) and RFC 9162 (version 2.0).
  • A CA submits each certificate (in practice a precertificate, before final issuance) to several logs and receives signed certificate timestamps (SCTs), which it embeds in the certificate.
  • Major browsers reject publicly trusted TLS certificates without enough valid SCTs: Chrome for certificates issued from May 2018, Apple's platforms from October 2018, Firefox on desktop since version 135 (2025). So practically every public certificate issued since 2018 is logged.
  • Monitors watch the logs; search services index them by domain, so anyone can ask "every certificate for *.lab.test".

What this gives a tester is passive reconnaissance: querying a search service touches only the service, never the client. What it doesn't give: names on certificates from a private CA (internal PKI), hosts that serve no TLS, names covered only by a wildcard (*.lab.test hides which hosts exist), and whether any of the names still resolves.

Names from a certificate itself

Any TLS server presents its certificate to anyone who connects, and the certificate lists its names in the Subject Alternative Name extension. In your sandbox a lab server runs on 127.0.0.1:8443 with the lab certificate (issued by the course's private lab CA, keys from a fixed seed, lab-only):

bash · try it yourself
openssl s_server -accept 127.0.0.1:8443 -cert $SAMPLES/pki/lab.test.crt -key $SAMPLES/pki/lab.test.key -quiet >/dev/null 2>&1 &
for i in $(seq 50); do ss -Htln 'sport = :8443' | grep -q . && break; sleep 0.1; done
openssl s_client -connect 127.0.0.1:8443 -servername lab.test </dev/null 2>/dev/null \
  | openssl x509 -noout -subject -issuer -enddate -ext subjectAltName
echo "== embedded SCTs (CT log receipts)?"
openssl x509 -in $SAMPLES/pki/lab.test.crt -noout -text | grep -c 'CT Precertificate SCTs' || true
kill %1
subject=C = XX, O = ExcelTAD Lab, OU = Web, CN = lab.test
issuer=C = XX, O = ExcelTAD Lab, CN = ExcelTAD Lab Root CA
notAfter=Jan  1 00:00:00 2028 GMT
X509v3 Subject Alternative Name:
    DNS:lab.test, DNS:www.lab.test
== embedded SCTs (CT log receipts)?
0

The certificate names lab.test and www.lab.test, and it has no SCTs: it was issued by a private CA, so it appears in no public log. A public certificate would show a "CT Precertificate SCTs" extension listing the logs that recorded it. Connecting to a server to read its certificate is active recon (one TLS handshake), which is why on an engagement it belongs to the scanning phase; the CT search below needs no connection at all.

Analysing a CT export

CT search services return one record per logged certificate with its names, issuer and validity. The export below is synthetic, for the lab domain, in that shape. The analysis a tester runs on it: split multi-name entries, normalise case, separate wildcards, keep the issuance dates, and flag names that look like non-production systems.

python · try it yourself
from collections import defaultdict
from datetime import date

ct_export = [  # synthetic CT search results for lab.test
    {"names": "lab.test\nwww.lab.test", "issuer": "Lab Public CA R1", "not_before": "2026-09-01", "not_after": "2026-11-30"},
    {"names": "lab.test\nwww.lab.test", "issuer": "Lab Public CA R1", "not_before": "2026-11-01", "not_after": "2027-01-30"},
    {"names": "mail.lab.test", "issuer": "Lab Public CA R1", "not_before": "2026-10-12", "not_after": "2027-01-10"},
    {"names": "vpn.lab.test\nvpn-old.lab.test", "issuer": "Lab Public CA R1", "not_before": "2024-03-05", "not_after": "2024-06-03"},
    {"names": "staging-pay.lab.test", "issuer": "Lab Public CA R1", "not_before": "2026-11-15", "not_after": "2027-02-13"},
    {"names": "*.app.lab.test", "issuer": "Lab Public CA E2", "not_before": "2026-08-20", "not_after": "2027-08-20"},
    {"names": "JIRA-test.lab.test", "issuer": "Lab Public CA R1", "not_before": "2025-01-10", "not_after": "2025-04-10"},
    {"names": "lab.test.evil-lookalike.test", "issuer": "Other CA", "not_before": "2026-11-18", "not_after": "2027-02-16"},
]
TODAY = date(2026, 11, 22)
NONPROD = ("staging", "test", "dev", "old", "uat")

names = defaultdict(list)
wildcards = set()
for cert in ct_export:
    for n in cert["names"].lower().split("\n"):
        if not (n == "lab.test" or n.endswith(".lab.test")):
            print(f"not ours (lookalike? report to the client): {n}")
            continue
        if n.startswith("*."):
            wildcards.add(n)
            continue
        names[n].append((date.fromisoformat(cert["not_before"]), date.fromisoformat(cert["not_after"])))

print(f"\n{'name':<22} certs  last issued  currently valid  note")
for n in sorted(names):
    spans = names[n]
    last = max(b for b, _ in spans)
    valid = any(b <= TODAY <= a for b, a in spans)
    label = n.removesuffix("lab.test")           # judge the host part, not the domain
    note = "non-production name" if any(w in label for w in NONPROD) else ""
    if (TODAY - last).days <= 14:
        note = (note + ", " if note else "") + "new this fortnight"
    print(f"{n:<22} {len(spans):>5}  {last}   {str(valid):<15}  {note}")
print("\nwildcards (hide host names):", ", ".join(sorted(wildcards)))
not ours (lookalike? report to the client): lab.test.evil-lookalike.test

name                   certs  last issued  currently valid  note
jira-test.lab.test         1  2025-01-10   False            non-production name
lab.test                   2  2026-11-01   True
mail.lab.test              1  2026-10-12   True
staging-pay.lab.test       1  2026-11-15   True             non-production name, new this fortnight
vpn-old.lab.test           1  2024-03-05   False            non-production name
vpn.lab.test               1  2024-03-05   False
www.lab.test               2  2026-11-01   True

wildcards (hide host names): *.app.lab.test

Each row is a lead with context:

  • staging-pay.lab.test is new this fortnight and named like a payment staging system: a high-priority lead, if it resolves to an in-scope address.
  • vpn-old and jira-test have only expired certificates. They may be decommissioned, or still running with an expired certificate (a finding in itself), or the names may now point somewhere else. Resolve each and screen it against the scope.
  • The wildcard *.app.lab.test hides which application hosts exist; DNS guessing and the client's inventory fill the gap.
  • lab.test.evil-lookalike.test isn't the client's domain. A lookalike certificate is a phishing indicator; it goes to the client as an observation, and nobody tests it.

How CT is used for detection

CT is primarily a defensive tool, and that is the right way to explain it in a report:

  • Mis-issuance: domain owners monitor the logs for certificates they didn't request (a CA error or a compromised validation). CAA DNS records restrict which CAs may issue for the domain at all.
  • Phishing: new certificates for lookalike names (lab-test-login.example) are an early warning of a campaign.
  • Shadow IT: a team that gets a certificate for a new service shows up in the logs before it shows up in the inventory.

How exposure is reduced

Names in public certificates are public forever; the logs are append-only. Options, each a trade-off:

  • Use a private CA for internal-only services (their certificates never reach public logs, but clients must trust the private root).
  • Use wildcard certificates for groups of hosts, accepting that one key now protects many names.
  • Don't encode secrets or roles into host names (staging-pay, admin-backdoor); assume every public name is known.
  • Monitor CT for your own domains and treat unexpected names as inventory gaps.

Pitfalls

  • Treating CT names as live hosts. Many are expired, renamed or moved. Resolve and screen before anything else.
  • Missing internal names. CT only covers public certificates; internal services need DNS, the inventory and scanning.
  • Testing lookalike domains. They belong to someone else, possibly an attacker; observe and report.

Practice

  1. Add a record for api.app.lab.test issued yesterday. Which line of the output changes, and what does it tell you that the wildcard didn't?
  2. Why does the session's lab certificate have no SCTs, and would a tester expect SCTs on the client's VPN portal certificate?
Answers
  1. A new row api.app.lab.test 1 2026-11-21 True new this fortnight: a concrete host behind the wildcard, recently deployed.
  2. It was issued by a private lab CA, which doesn't log to public CT. A VPN portal reachable from the Internet normally uses a publicly trusted certificate, so it should carry SCTs; if it uses a private CA instead, users must trust that root, which is worth noting.

Test yourself

Why does a CT log search count as passive reconnaissance?

  1. It is slow
  2. The query goes to a third-party log or search service; the client's systems receive nothing
  3. CT logs are encrypted
  4. It only finds expired names

Which hosts will CT logs NOT reveal?

  1. Hosts with public certificates
  2. Hosts using certificates from a private CA, and hosts hidden behind a wildcard certificate
  3. Recently issued names
  4. Mail servers with public certificates

A CT search shows staging-pay.lab.test, issued last week. What is the next step?

  1. Scan it at once
  2. Resolve it and screen its address against the scope before any request
  3. Report it as a vulnerability
  4. Ignore it, staging is never in scope

Which DNS record lets a domain owner limit which CAs may issue certificates for it?

  1. MX
  2. CAA
  3. PTR
  4. SRV