Complete 2026 guide to Active Directory Certificate Services (AD CS) security. Master ESC1/ESC8 misconfiguration mechanics, theoretical LDAP auditing, defensive GPO/IIS hardening, KB5014754 s
17 min read
Build a zero-dependency Python 3.11+ AST detection engine that transpiles Sigma rules into Microsoft KQL, Elastic EQL, and real-time in-memory event evaluators.
13 min read
Active Directory Certificate Services (AD CS) is Microsoft’s built-in Public Key Infrastructure (PKI) implementation. It issues X.509 certificates used for user authentication, VPN access, code signing, and SSL/TLS encryption.
When AD CS certificate templates or HTTP enrollment interfaces are misconfigured, low-privileged attackers can abuse Kerberos PKINIT authentication to request certificates for high-privilege identities (such as Domain Administrators) or relay authentication to HTTP endpoints to compromise Domain Controllers.
/certsrv (ESC8).ENROLLEE_SUPPLIES_SUBJECT flags, restricting template ACLs, enforcing Extended Protection for Authentication (EPA) + HTTPS, enforcing KB5014754 strong certificate mapping, and deploying KQL detection rules for Event ID 4887.To understand AD CS security, we must build a clear mental model of how digital certificates function as enterprise passports.
Imagine a government passport office operating inside a secure facility:
AD CS relies on Active Directory LDAP objects stored in the Configuration Partition (CN=Configuration,DC=domain,DC=com).
[ Client Request ]
|
v
+--------------------------------------------------------+
| AD CS Certification Authority (CA) |
| Reads Template: CN=Certificate Templates,CN=Public Key |
+--------------------------------------------------------+
|
+---> Checks msPKI-Certificate-Name-Flag
| (Flag 0x00010000 = CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT)
|
+---> Checks pKIExtendedKeyUsage
| (1.3.6.1.5.5.7.3.2 = Client Authentication / Smart Card Logon)
|
v
[ Issued X.509 Certificate with Custom UPN ]
|
v
[ Presented to KDC via Kerberos PKINIT (RFC 4556) ] ---> Returns TGT for Target UPN
| Attribute / Property | LDAP Attribute Field | Security Risk Indicator |
|---|---|---|
| Supply Subject in Request | msPKI-Certificate-Name-Flag | Flag contains CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT (0x00010000) |
| Authentication EKUs | pKIExtendedKeyUsage | Contains 1.3.6.1.5.5.7.3.2 (Client Auth) or 1.3.6.1.4.1.311.20.2.2 |
| Enrollment Rights | ntSecurityDescriptor | Grants Enroll / AutoEnroll permissions to broad groups (Domain Users) |
| Web Enrollment Security | IIS Service Settings | NTLM authentication enabled without EPA or HTTPS enforcement |
Security auditors evaluate AD CS posture by inspecting Active Directory LDAP attributes using PowerShell, LDAP queries, or native administrative tools.
# Querying LDAP Configuration Partition for permissive SAN templates
Get-ADObject -SearchBase "CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=corp,DC=local" `
-Filter {msPKI-Certificate-Name-Flag -band 0x00010000} `
-Properties DisplayName, pKIExtendedKeyUsage, msPKI-Certificate-Name-Flag |
Select-Object DisplayName, pKIExtendedKeyUsage
-SearchBase "CN=Certificate Templates...": Targets the LDAP partition where AD CS template objects are stored across the forest.-Filter {msPKI-Certificate-Name-Flag -band 0x00010000}: Performs a bitwise AND operation to find templates where the CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT bit is set.Select-Object DisplayName, pKIExtendedKeyUsage: Displays the template name alongside its Extended Key Usage flags (checking for Client Auth).certtmpl.msc (Certificate Templates MMC snap-in) on the CA.Domain Users and Authenticated Users from Enroll permissions./certsrv) is not required, uninstall the role service from the Server Manager.Authentication -> Windows Authentication -> Advanced Settings -> set to Required.Microsoft update KB5014754 enforces explicit mapping between X.509 certificates and Active Directory user accounts.
# Registry key to set Strong Certificate Binding Enforcement Mode (Mode 2)
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kdc]
"StrongCertificateBindingEnforcement"=dword:00000002
When Certificate Services auditing is enabled (auditpol /set /subcategory:"Certification Services" /success:enable), the CA generates Event ID 4887 for every issued certificate.
// Detects certificate issuance where the requester's account differs from the Subject/SAN identity
SecurityEvent
| where EventID == 4887
| extend RequesterName = tostring(EventData.RequesterName),
SubjectUserName = tostring(EventData.SubjectUserName),
TemplateName = tostring(EventData.TemplateName),
ClientIP = tostring(EventData.ClientAddress)
| where RequesterName !contains SubjectUserName
| where SubjectUserName contains "Admin" or SubjectUserName contains "DA" or SubjectUserName contains "svc"
| project TimeGenerated, RequesterName, SubjectUserName, TemplateName, ClientIP
// Detects computer accounts (ending in $) requesting user-type authentication templates
SecurityEvent
| where EventID == 4887
| extend RequesterName = tostring(EventData.RequesterName),
TemplateName = tostring(EventData.TemplateName),
ClientIP = tostring(EventData.ClientAddress)
| where RequesterName endswith "$"
| where TemplateName !in ("Machine", "DomainController", "DomainControllerAuthentication", "Computer")
| project TimeGenerated, RequesterName, TemplateName, ClientIP
0x00010000) combined with Client Authentication EKUs allow low-privileged users to request certificates for administrative accounts.4887.Authored by Syed Zada Abrar — Founder & Lead Researcher, Andrax Pentester.
Share this article
An in-depth analysis of Active Directory attack paths in 2026, focusing on assumed-breach models, BloodHound mapping, Kerberos misconfigurations, and escalation from low-privilege domain user
3 min read
Sign in to leave a comment.