Inside AD CS Escalation: Unpacking Advanced Misuse Techniques and Tools
How template misconfigurations and shadow credentials are redefining privilege escalation in modern PKI infrastructure
Executive Summary
Active Directory Certificate Services (AD CS) remains a foundational component of Windows enterprise infrastructure, managing the public key infrastructure (PKI) that underpins authentication and encryption across networks. Despite its critical role, AD CS is frequently undermined by insecure default configurations and inherent design complexities, creating a high-impact attack surface that is often under-monitored by security teams. Recent analysis from Unit 42 and Cyber Security Review highlights that adversaries are increasingly leveraging template misconfigurations and shadow credential misuse to escalate privileges and impersonate privileged accounts.
Unlike traditional exploitation vectors that rely on zero-day vulnerabilities or complex malware payloads, AD CS attacks predominantly exploit native certificate issuance mechanisms. By abusing overly permissive enrollment rights and misconfigured templates, attackers can issue certificates for high-value targets, establish persistence, and move laterally with minimal detection. These weaknesses are actively being weaponized by both financially motivated ransomware groups and state-sponsored actors, making AD CS a pivotal vector in modern threat campaigns.
Technical Analysis
The exploitation of AD CS centers on the abuse of certificate templates and enrollment permissions. Unit 42's analysis identifies two primary techniques: template misconfigurations and shadow credential misuse. These techniques allow attackers to issue certificates that grant access to domain controllers, enterprise admins, or other privileged entities without requiring their passwords.
Root Cause: Design Complexity and Default Configurations
AD CS suffers from a complex design where certificate templates define the properties of issued certificates, including enrollment permissions, key usage, and subject alternatives. Insecure default configurations, such as the SubCA and DomainController templates, often have Enroll permissions granted to Authenticated Users. This allows any domain user to request a certificate for these templates, provided the template is enabled and not expired.
Additionally, the introduction of shadow credentials allows an attacker to add a key to an object without knowing the current password. This technique bypasses the need for the msDS-KeyCredentialLink attribute to be writable by the user, enabling privilege escalation even when password changes are restricted.
Attack Chain Execution
The exploitation chain typically follows a sequence of reconnaissance, template abuse, and certificate issuance. The following table outlines the key steps in the AD CS escalation chain.
Key Configuration Parameters
Several AD CS configuration parameters play a critical role in enabling exploitation:
- msPKI-Certificate-Name-Flag: Controls the subject name requirements. Values like
ENROLLEE_SUPPLIES_SUBJECTallow the requester to specify the subject, enabling impersonation. - msPKI-Enrollment-Flag: Determines enrollment permissions. Flags such as
INCLUDE_SYMMETRIC_ALGORITHMScan allow weaker key exchange methods. - msPKI-Certificate-Policy: Defines the policies associated with a template. Misconfigurations here can allow unauthorized policy enrollment.
- Identify Vulnerable Templates. Use
certipy findto list templates withEnrollpermissions forAuthenticated Users. - Check Template Properties. Verify
msPKI-Certificate-Name-FlagandmsPKI-Enrollment-Flagfor exploitable settings. - Test Shadow Credentials. Attempt to add a key to a target user using
certipy shadow autoto confirm shadow credential abuse. - Request Certificate. Issue a certificate for the target using the identified template or shadow credential.
- Authenticate. Use the certificate to authenticate via
kerberosors4u2selffor further escalation.
Impact Assessment
The impact of AD CS exploitation extends beyond simple privilege escalation. By issuing certificates for privileged accounts, attackers can impersonate domain admins, enterprise admins, or even the domain controller itself. This enables unauthorized access to critical services, data exfiltration, and long-term persistence.
Unit 42 observations indicate that these weaknesses are actively exploited by financially motivated ransomware groups and state-sponsored actors. Ransomware groups use AD CS to quickly escalate privileges and encrypt critical systems, while APTs leverage certificate-based persistence to maintain access over extended periods.
Detection & Response
Effective detection of AD CS exploitation requires monitoring enrollment events, certificate usage, and shadow credential additions. Unit 42 emphasizes behavioral detection as a key strategy for identifying AD CS attacks.
Indicators of Compromise (IOCs)
- Unusual Enrollment Requests: High volume of certificate requests from a single user or computer.
- Shadow Credential Additions: New keys added to
msDS-KeyCredentialLinkattribute. - Certificate Usage: Certificates used for authentication to domain controllers or critical services.
- Template Abuse: Enrollment of templates with
ENROLLEE_SUPPLIES_SUBJECTflag.
Illustrative Detection Rules
A single rule cannot cover the AD CS attack surface — the techniques in the chain above leave fingerprints in at least four different Windows event sources (DC security log, CA operational log, Kerberos logon log, endpoint process telemetry). The Sigma-style rules below pair each escalation primitive with the high-fidelity event it generates, plus the false-positive filters and tuning guidance needed to keep them deployable. All rules are illustrative and should be baselined against legitimate Windows Hello for Business activity and your CA enrollment cadence before production use.
Audit Directory Service Changes (subcategory) is enabled on domain controllers and that the CA role’s Microsoft-Windows-CertificationAuthority/Operational channel is forwarded to your SIEM. By default, neither is collected and these rules will be silent until both are turned on.Rule 1 — Shadow credential write to msDS-KeyCredentialLink (DC Event ID 5136). This is the canonical detection for the Whisker / ntlmrelayx --shadow-credentials / certipy shadow auto primitive. The high-signal anomaly is a third-party principal writing the attribute — not the target object writing its own key (the legitimate Windows Hello for Business pattern).
Rule 2 — PKINIT TGT request that follows a shadow-credentials write (DC Event ID 4768 with CertificateIssuerName populated). The certificate gets used here, typically within seconds-to-minutes of the credential add. Correlating 4768 PKINIT events against the prior 5136 stream gives you the full kill chain rather than two isolated anomalies.
Rule 3 — Certificate template created or modified (CA Event IDs 4898–4900). ESC1-style template weaponization requires an attacker (or a coerced PKI admin) to flip ENROLLEE_SUPPLIES_SUBJECT, grant Enroll to Authenticated Users, or relax client authentication EKUs. Any template change outside an approved maintenance window deserves investigation.
Rule 4 — ESC1 high-fidelity: certificate issued whose SAN does not match the requester (CA Event ID 4887). This is the smoking gun for ESC1: an unprivileged principal authenticates to the CA, and the issued certificate names a different (privileged) account in the Subject Alternative Name. The match runs on the CA’s Microsoft-Windows-CertificationAuthority/Operational channel, which captures the issued SAN value.
Rule 5 — Endpoint tool indicators (Microsoft Defender for Endpoint / Sentinel KQL). The escalation primitives are usually executed from a foothold endpoint. Catching the tooling on that endpoint — certify.exe, certipy, Whisker, PSPKIAudit — gives the SOC a hunt that fires before any DC-side telemetry shows the attack.
Correlation guidance for the SOC analyst:
- The chain detection that matters most: a Rule 1 (shadow-cred write to
msDS-KeyCredentialLink) followed within ~10 minutes by a Rule 2 (PKINIT TGT for the same target). The two events on their own are noisy; the sequence is high-confidence compromise. - For ESC1: a Rule 5 (
certify.exe/certipyon an endpoint) followed by a Rule 4 (SAN mismatch on the CA) is the deterministic ESC1 chain. Either alone warrants triage; together, they warrant containment. - Time-of-day baselining matters. Most AD CS-relevant administrative activity (template changes, CA service restarts, WHfB enrollment) clusters during business hours. Anomalies are far more meaningful at 02:00 local.
- Pair with
certipy find -vulnerableoutput on a regular cadence. Detection without a clean baseline of which templates are exploitable today means analysts can’t triage the alerts. Re-run weekly and feed the vulnerable template list into Rule 4’s allow/deny logic.
Mitigation & Remediation
Remediating AD CS vulnerabilities involves reviewing template configurations, restricting enrollment rights, and monitoring for shadow credential misuse. The following actions should be prioritized by security teams.
- Audit Certificate Templates. Regularly review templates for permissive enrollment rights and exploitable flags.
- Restrict Enrollment Permissions. Remove
Enrollpermissions fromAuthenticated Userswhere possible. - Enable Shadow Credential Monitoring. Monitor
msDS-KeyCredentialLinkattribute changes for unauthorized key additions. - Implement Certificate Revocation. Ensure CRL and AIA configurations are correct to allow timely revocation of compromised certificates.
- Deploy Behavioral Detection. Use SIEM or EDR tools to detect anomalous enrollment and authentication patterns.
Strategic Context
As organizations continue to adopt digital transformation strategies, the intersection of cybersecurity and compliance creates a complex landscape where AD CS plays a pivotal role. The SEC's new cybersecurity disclosure rules, mandating a four-day reporting window for material incidents, place additional pressure on security teams to quickly identify and respond to AD CS attacks. Effective incident response requires the ability to rapidly analyze certificate enrollment data and determine the impact of compromised certificates.
AD CS: The Identity Backbone Under Siege
AD CS is no longer just a PKI component; it is a critical identity backbone that, when misconfigured, can undermine the entire enterprise security posture. The shift towards native certificate issuance exploitation highlights the need for defenders to move beyond traditional vulnerability management and embrace behavioral detection and template auditing.
As ransomware groups and APTs continue to weaponize AD CS weaknesses, organizations must prioritize AD CS hygiene, enforce least-privilege enrollment, and monitor for shadow credential abuse to maintain a robust defense-in-depth strategy.
Timeline
Sources & References
- Inside AD CS Escalation: Unpacking Advanced Misuse Techniques and Tools - Unit 42
- Inside AD CS Escalation: Unpacking Advanced Misuse Techniques - Cyber Security Review
- GPUGate Malware Abuses Google Ads and GitHub - IT Security News
- Navigating Cybersecurity and Compliance Challenges Today - Security News
- Unpacking The SEC's Cybersecurity Disclosure - Forensic Focus