WhatschatDocsSoftware Tools
Related
Before You Quit Your Day Job: How to Build a Solo Business Without Risking EverythingAndroid 17 Launches 'Screen Reactions' Video Tool; Instagram Overhauls Collaboration Features10 Secrets of Unknowable Math: How Gödel's Theorems Protect Your PrivacyHow to Stop AI Code Errors from Wasting Your Reviewers' TimeLocal-First Web Development: Practical Insights and Key DistinctionsGitHub Dungeons: AI-Powered Tool Turns Code Repositories into Playable Roguelike GamesCommand-Line Observability: How gcx Bridges the Gap Between Agents and ProductionUbuntu Drops GNOME Terminal: Ptyxis to Become Default Emulator in Upcoming Release

10 Critical Insights into AD CS Escalation: Misconfigurations, Shadow Credentials, and Defense Strategies

Last updated: 2026-05-19 14:09:36 · Software Tools

Introduction

Active Directory Certificate Services (AD CS) is a powerful component that, when misconfigured, can become a prime vector for privilege escalation in enterprise environments. This article unpacks the most common exploitation techniques—including template misconfigurations and shadow credential abuse—while also offering behavioral detection strategies for defenders. Whether you're a security professional hardening your infrastructure or an incident responder analyzing an attack, these ten insights will help you understand the mechanics, tools, and mitigation methods surrounding AD CS misuse.

1. The Core Misconfiguration: Weak Certificate Templates

One of the most frequently exploited weaknesses in AD CS involves template settings that allow low-privileged users to request certificates with elevated rights. For example, templates that permit Client Authentication combined with Enrollment Rights granted to 'Domain Users' can be abused to obtain certificates that authenticate as high-value accounts. Attackers scan for templates where the 'msPKI-Certificate-Name-Flag' is set to allow requester-supplied subject names—this gives them the ability to impersonate anyone. Tools like Certipy automate the process of identifying such vulnerable templates and issuing forged certificates, leading to lateral movement and domain dominance.

10 Critical Insights into AD CS Escalation: Misconfigurations, Shadow Credentials, and Defense Strategies
Source: unit42.paloaltonetworks.com

2. The ESC1 Attack Path: Abuse of Subject Name Specification

ESC1 is the most well-known AD CS escalation technique, targeting templates that permit the requester to specify a subject alternative name (SAN). If a template has the ‘Supply in request’ flag enabled for the subject name, and the template is used for authentication (e.g., smart card logon), an attacker with basic enrollment rights can request a certificate for any user account, including a domain admin. As noted earlier, this directly leverages template misconfigurations. Defenders should audit templates for the presence of the 'CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT' flag and restrict enrollment permissions to only necessary users and groups. The impact is critical—immediate full domain compromise.

3. ESC2: Exploiting ‘Any Purpose’ Templates

Certificates with the ‘Any Purpose’ enhanced key usage (EKU) are essentially swiss army knives—they can be used for any cryptographic operation, including authentication, encryption, and code signing. If a template grants the ‘Enroll’ permission to standard users and allows the requester to supply a subject name, the exposure is severe. Attackers can issue a certificate that functions as both a client and server authentication credential, enabling them to impersonate any machine or user. This path is often overlooked because the EKU appears innocuous. For defense, ensure that no template uses the ‘Any Purpose’ EKU unless absolutely required and tightly scoped.

4. ESC3: Chaining Vulnerable Templates with Enrollment Agents

ESC3 exploits a chain of templates where one template permits enrollment agent functionality and another allows subject name specification. Typically, an enrollment agent certificate is designed to issue certificates on behalf of others. If an attacker can enroll for an enrollment agent certificate (via a weak template) and then use it to request a certificate from a vulnerable template that accepts subject name from the requester, they can impersonate any user. This two-step attack requires careful chaining, but tools like Certipy and PKINITtools automate the process. Mitigation involves strict control over enrollment agent certificates and blocking cross-template request flows.

5. ESC4: The Danger of Supervisor Override

Some AD CS templates incorporate a “supervisor approval” requirement, meaning a certificate manager must manually approve each request. However, if the template misconfiguration allows the requester to supply a subject name and the approval mechanism is weak, attackers can bypass this by either compromising the supervisor account or finding an alternative enrollment path that doesn’t require approval. Shadow credentials (discussed later) can also be used to elevate privileges after obtaining a supervisor’s credentials. Auditing approval logs and ensuring separation of duties are key defensive measures.

6. ESC5: CA-Level Misconfigurations and Unsecure Private Key Storage

Beyond templates, the Certification Authority (CA) itself can be misconfigured. For example, if the CA server has weak permissions on its private key file (stored in the registry or file system), an attacker who gains local admin on the CA server can export the CA’s private key. With that, they can sign arbitrary certificates, effectively becoming a rogue CA. Additionally, allowing low-privileged users to manage CA roles—like the ‘Certificate Manager’ role—exposes the entire PKI. Hardening the CA server, using Hardware Security Modules (HSMs), and regularly reviewing role assignments are essential to prevent this elevation of privilege.

7. Shadow Credentials: Abusing Key Credential Link Attacks

Shadow credentials refer to the technique of adding a key credential to a target user or computer object in Active Directory without the owner’s knowledge. This is possible if an attacker has write permissions (e.g., via a misconfigured ACL) on the object’s ‘msDS-KeyCredentialLink’ attribute. By doing so, they can request a certificate for that object using the new key pair, effectively gaining the ability to authenticate as that object (e.g., a domain admin account). This technique bypasses traditional password-based protections and is often used in conjunction with template attacks. Detection relies on monitoring changes to the key credential attribute.

10 Critical Insights into AD CS Escalation: Misconfigurations, Shadow Credentials, and Defense Strategies
Source: unit42.paloaltonetworks.com

8. Real-World Tooling: Certipy, PKINITtools, and Rubeus

Modern AD CS exploitation is heavily automated. Certipy is a Python tool that identifies vulnerable templates, issues forged certificates, and requests Kerberos TGTs. PKINITtools enables using certificates for Kerberos initial authentication (PKINIT), allowing attackers to obtain service tickets without knowing passwords. Rubeus, a popular tool for Kerberos abuse, also supports AS-REQ with certificates. These tools drastically reduce the skill barrier for attackers. Defenders should monitor for spikes in certificate enrollment requests (especially for high-privilege subjects), unusual PKINIT authentication attempts, and the use of known tool signatures in network logs.

9. Behavioral Detection for Defenders: What to Look For

Instead of relying solely on static signatures, defenders should adopt behavioral detection rules. Key indicators include: multiple certificate requests from the same user for different subjects (potential SAN abuse), enrollment attempts from non-domain-joined machines or unusual IP ranges, requests for templates with ‘Enrollee Supplies Subject’ where the requester is not authorized, and changes to the ‘msDS-KeyCredentialLink’ attribute on sensitive accounts. Shadow credential additions can be detected via Windows Event ID 4742 (security-enabled group modification) or by auditing LDAP modifications. Additionally, monitoring for the use of Certipy or similar tools via process creation events (e.g., Python.exe spawning certificate services commands) can raise early alerts.

10. Mitigation Strategies and Hardening Best Practices

To defend against AD CS escalation, follow these practices: (1) Auditing all certificate templates—disable unused templates, remove dangerous flags, and restrict enrollment rights to only authorized personnel. (2) Enforcing ‘Vulnerable Template Guard’ via Group Policy to block critical EKUs. (3) Using Extended Validation (EV) certificates with strong key protection. (4) Implementing JIT (Just-in-Time) enrollment approvals using Microsoft’s Privileged Identity Management (PIM). (5) Regularly reviewing ACLs on AD CS objects and CA server file systems. (6) Enabling advanced auditing for certificate services (Event ID 4886-4888). (7) Using hardware security modules for CA private keys. Proactive hardening prevents the initial compromise that leads to full domain takeover.

Conclusion
AD CS escalation represents a sophisticated attack vector that can bypass traditional security controls if misconfigurations are present. By understanding the ten critical areas outlined above—from template vulnerabilities to shadow credentials and detection techniques—security teams can better defend their Active Directory environments. Continuous monitoring, regular audits, and applying least privilege principles are your strongest allies. Remember: the goal isn't merely to react to attacks but to eliminate the conditions that make them possible.