RDP TLS Certificate Extraction
RDP over TLS often exposes a self-signed cert or an internal CA-issued cert. The subject and SANs frequently contain the real hostname and internal domain. That naming is immediately useful for DNS, SMB, LDAP, Kerberos, and spraying formats.
Grab the leaf certificate fast
This pulls the first cert the server presents and prints only fields you’ll actually use.
What you expect:
subject: usually includes CN with a hostname
issuer: self-signed or internal CA name
notBefore/notAfter: tells you if it’s stale or recently rolled
If you want SANs (often better than CN):
Subject: CN = WIN10-WS01.contoso.local Issuer: CN = CONTOSO-CA Not Before: Jan 2 08:11:20 2026 GMT Not After : Jan 2 08:11:20 2028 GMT DNS:win10-ws01.contoso.local, DNS:WIN10-WS01
Dump the full chain
Use this when you want to identify the internal PKI (CA naming, intermediate CAs) or when the leaf cert is generic but the chain leaks org details.
What to do with it:
If you see a non-public issuer and meaningful CNs, treat it as an internal CA deployment.
If the issuer CN looks like a Windows CA hostname, you just got another internal naming pivot.
How to use the certificate data
If you extract a hostname like WIN10-WS01.contoso.local:
Set
$DOMAINto the internal domain you found.Add host mappings to avoid “name unknown” issues in tooling.
What this changes immediately:
SMB/LDAP/Kerberos tooling becomes cleaner when you can use real hostnames and a consistent
$DOMAIN.You can pivot into DNS enumeration using the discovered suffix, then expand hostlists for lateral checks.
With domain context confirmed, proceed to credential attacks — see RDP Brute Force and Password Spray.
If OpenSSL fails on older endpoints
Some older Windows builds only speak legacy TLS or present weak/old signature chains that modern OpenSSL rejects by default.
Warning
This is a legacy compatibility workaround. It relaxes OpenSSL’s security level so you can enumerate old RDP TLS stacks. Prefer fixing negotiation with a modern client when possible.
If the cert suddenly appears after lowering security level, treat the endpoint as “old enough to be annoying” and validate with your RDP client early.
Alternative: Nmap ssl-cert against RDP
If you want a quick, scriptable output without dealing with s_client noise:
What you get:
Subject and issuer summary
Validity window
SANs when present
This is often enough to recover host/domain naming and decide your next pivot.
References
-
Nmap ssl-cert NSE scriptnmap.org/nsedoc/scripts/ssl-cert.html (opens in new tab)
Pulls and summarizes X.509 certs from TLS services (works on RDP TLS)
-
OpenSSL s_client manualdocs.openssl.org/master/man1/openssl-s_client (opens in new tab)
TLS handshake client for certificate retrieval and debugging
-
OpenSSL x509 manualdocs.openssl.org/master/man1/openssl-x509 (opens in new tab)
Parsing and extracting fields from X.509 certificates
Was this helpful?
Your feedback helps improve this page.