adcs-template-abuse
Active Directory Certificate Services certificate-template abuse — ESC1-ESC4, ESC9, ESC10, ESC13 and related misconfigurations that let a low-privileged user enroll a certificate authenticating as a privileged user. Discovery and exploitation with Certipy. Use when AD CS is present and enumeration flags vulnerable templates.
AnandJogawade · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill adcs-template-abuse技能说明
name: adcs-template-abuse description: Active Directory Certificate Services certificate-template abuse — ESC1-ESC4, ESC9, ESC10, ESC13 and related misconfigurations that let a low-privileged user enroll a certificate authenticating as a privileged user. Discovery and exploitation with Certipy. Use when AD CS is present and enumeration flags vulnerable templates.
AD CS Template Abuse (ESC1-ESC4, ESC9/10/13)
AD CS turns "enroll a certificate" into "become a Domain Admin" when templates are misconfigured. Certificates are also durable auth (long validity) — great persistence too.
Trigger phrases
adcs, esc1, esc2, esc3, esc4, certificate template, certipy, enrollment, pkinit, certificate privesc
Discover
certipy find -u <user>@<domain> -p <pass> -dc-ip <dc> -vulnerable -stdout
Flags vulnerable templates and the ESC class.
Exploitation by ESC
- ESC1 (template allows requester-supplied SAN + client-auth EKU + low-priv enroll): request a cert as a DA.
certipy req -u <user>@<domain> -p <pass> -ca <CA> -template <tpl> -upn administrator@<domain>
certipy auth -pfx administrator.pfx -dc-ip <dc> # -> NT hash / TGT
- ESC2 (Any Purpose / no EKU): use the cert for any auth.
- ESC3 (Enrollment Agent): request an agent cert, then enroll on behalf of a DA.
- ESC4 (write access to a template): rewrite the template to be ESC1-vulnerable, exploit, revert.
- ESC9/ESC10 (no security extension / weak cert mapping): combine with a controlled account's UPN change to impersonate.
- ESC13 (issuance policy linked to a group): enroll to gain the group's rights.
Escalation
certipy auth turns the PFX into an NT hash or Kerberos TGT → DCSync / full compromise. Certificates remain valid even after a password reset — note for remediation.
Evidence
certipy find output showing the misconfig, the issued cert, and the authenticated privileged access.