> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specterops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Privilege Escalation Techniques Overview

> Overview of ESC1-16 privilege escalation techniques using AD CS misconfigurations and certificate template vulnerabilities.

<Info>
  This comprehensive guide covers all 16 known ESC (Escalation) techniques for privilege escalation using Active Directory Certificate Services misconfigurations.
</Info>

<Card title="Strong Certificate Mapping" icon="shield-check">
  In May 2022, Microsoft introduced **Strong Certificate Mapping**, which implemented a security extension for certificate templates that includes the security identifier (SID) of the requesting user. This was done to combat [Certifried (CVE-2022–26923)](https://research.ifcr.dk/certifried-active-directory-domain-privilege-escalation-cve-2022-26923-9e098fe298f4), and was initially released in a compatibility mode that allowed "Weak Certificate Mapping" until February 2025, after which the mode has switched to full enforcement.

  **Unless explicitly downgraded, every environment should be considered in full enforcement mode.**
</Card>

## ESC Techniques Overview

The following privilege escalation techniques exploit various misconfigurations in Active Directory Certificate Services to elevate privileges from low-privileged accounts to high-privileged accounts, including Domain Admins:

### Template Misconfigurations (ESC1-3)

<CardGroup cols={1}>
  <Card title="ESC1 - Misconfigured Client Authentication Templates" icon="certificate" href="./esc1-misconfigured-client-authentication">
    Exploit certificate templates that allow arbitrary Subject Alternative Names (SANs) for privilege escalation via certificate impersonation.
  </Card>

  <Card title="ESC2 - Misconfigured Any Purpose Templates" icon="key" href="./esc2-misconfigured-any-purpose">
    Exploit certificate templates with overly broad Extended Key Usages (Any Purpose EKU) to bypass certificate restrictions.
  </Card>

  <Card title="ESC3 - Misconfigured Certificate Request Agent Templates" icon="user-check" href="./esc3-misconfigured-certificate-request-agent">
    Abuse Certificate Request Agent templates to enroll certificates on behalf of other users.
  </Card>
</CardGroup>

### Access Control Vulnerabilities (ESC4-5, ESC7)

<CardGroup cols={1}>
  <Card title="ESC4 - Vulnerable Certificate Template Access Control" icon="shield-exclamation" href="./esc4-vulnerable-certificate-template-access-control">
    Exploit overly permissive access controls on certificate templates to modify template settings.
  </Card>

  <Card title="ESC5 - Vulnerable PKI Object Access Control" icon="server" href="./esc5-vulnerable-pki-object-access-control">
    Abuse weak access controls on PKI objects including Certificate Authorities and certificate templates.
  </Card>

  <Card title="ESC7 - Vulnerable Certificate Authority Access Control" icon="shield-keyhole" href="./esc7-vulnerable-certificate-authority-access-control">
    Exploit vulnerable CA access controls to gain ManageCA or ManageCertificates permissions.
  </Card>
</CardGroup>

### CA Configuration Issues (ESC6, ESC8, ESC11)

<CardGroup cols={1}>
  <Card title="ESC6 - Request Attribute SAN (EDITF_ATTRIBUTESUBJECTALTNAME2)" icon="id-card" href="./esc6-request-attribute-san-editf-attributesubjectaltname2">
    Abuse the EDITF\_ATTRIBUTESUBJECTALTNAME2 CA flag to specify arbitrary Subject Alternative Names.
  </Card>

  <Card title="ESC8 - NTLM Relay to AD CS HTTP Endpoints" icon="globe" href="./esc8-ntlm-relay-to-ad-cs-http-endpoints">
    Perform NTLM relay attacks against Certificate Authority web enrollment endpoints.
  </Card>

  <Card title="ESC11 - NTLM Relay to AD CS RPC Interfaces" icon="ethernet" href="./esc11-ntlm-relay-to-ad-cs-rpc-interfaces">
    Exploit NTLM relay vulnerabilities against Certificate Authority RPC interfaces.
  </Card>
</CardGroup>

### Certificate Mapping Issues (ESC9-10, ESC13-16)

<CardGroup cols={1}>
  <Card title="ESC9 - Security Extension Disabled on Certificate Template" icon="shield-slash" href="./esc9-security-extension-disabled-on-certificate-template">
    Exploit disabled security extensions (CT\_FLAG\_NO\_SECURITY\_EXTENSION) on certificate templates.
  </Card>

  <Card title="ESC10 - Schannel Weak Certificate Mapping" icon="link-slash" href="./esc10-schannel-weak-certificate-mapping">
    Abuse weak certificate mapping in Schannel for authentication bypass.
  </Card>

  <Card title="ESC13 - Authentication Mechanism Assurance (AMA)" icon="users" href="./esc13-authentication-mechanism-assurance-ama">
    Exploit vulnerabilities in Authentication Mechanism Assurance implementation.
  </Card>

  <Card title="ESC14 - Explicit Certificate Mapping" icon="address-card" href="./esc14-explicit-certificate-mapping">
    Abuse explicit certificate mapping configurations for privilege escalation.
  </Card>

  <Card title="ESC15 - EKUwu (Application Policy Injection)" icon="code-commit" href="./esc15-ekuwu-application-policy-injection">
    Exploit Application Policy injection vulnerabilities in certificate requests.
  </Card>

  <Card title="ESC16 - Security Extension Disabled on Certificate Authority" icon="shield-xmark" href="./esc16-security-extension-disabled-on-certificate-authority">
    Abuse disabled security extensions at the Certificate Authority level.
  </Card>
</CardGroup>

### Hardware-Based Attacks (ESC12)

<CardGroup cols={1}>
  <Card title="ESC12 - YubiHSM2" icon="key" href="./esc12-yubihsm2">
    Exploit vulnerabilities specific to YubiHSM2 hardware security modules.
  </Card>
</CardGroup>

## General Prerequisites

Most ESC techniques require:

* Access to an Active Directory environment with AD CS deployed
* Low-privileged domain user account
* Network access to Certificate Authority servers
* Understanding of PKI concepts and certificate enrollment

## Common Attack Patterns

<Accordion title="Certificate Template Enumeration">
  Most attacks begin with enumerating certificate templates using Certify to identify vulnerable configurations.
</Accordion>

<Accordion title="Certificate Request">
  Attackers request certificates using vulnerable templates, often specifying alternative identities or elevated privileges.
</Accordion>

<Accordion title="Authentication">
  The issued certificate is used for authentication, typically with Kerberos PKINIT, to obtain elevated access.
</Accordion>

## Detection and Mitigation

<Warning>
  Organizations should implement comprehensive monitoring and hardening for Certificate Services infrastructure.
</Warning>

<Card title="Monitoring Recommendations" icon="eye">
  * Monitor certificate enrollment events (Event ID 4886, 4887)
  * Track certificate template modifications
  * Alert on certificates with unusual Subject Alternative Names
  * Monitor authentication events using certificates
  * Regular auditing of certificate template configurations
</Card>

<Card title="Hardening Guidelines" icon="shield">
  * Remove ENROLLEE\_SUPPLIES\_SUBJECT flag from templates
  * Implement proper template access controls
  * Enable manager approval for sensitive templates
  * Consider Strong Certificate Mapping enforcement
  * Regular review of CA flags and configurations
</Card>

<Card title="Next Steps" icon="arrow-right">
  Select a specific ESC technique from the categories above to learn detailed implementation steps, enumeration methods, and exploitation techniques. Each technique includes specific prerequisites, detection methods, and mitigation strategies.
</Card>
