该仓库展示了一个利用Windows AD CS两个缺陷的工具,绕过KB5014754强证书绑定补丁,为低权限用户伪造证书,通过PKINIT获取域管理员权限。

Stars

9

7 天增长

暂无数据

Fork 数

1

开放 Issue

0

开源协议

暂无数据

最近更新

2026-07-27

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它提供了一个具体、可操作的绕过已记录安全补丁(KB5014754)的方法,利用certsrv.exe和certpdef.dll中的连锁漏洞,可攻破完全修补的Active Directory环境。

适合谁使用

  • Active Directory安全研究人员
  • 红队成员和渗透测试人员
  • 企业安全管理员
  • 微软补丁验证工程师

典型使用场景

  • 演示AD CS中残留ESC1证书模板的影响
  • 测试KB5014754及相关缓解措施的有效性
  • 模拟从低权限用户到域控的完整攻击链
  • 验证AD CS部署的安全态势

项目优势

  • 利用经过逆向工程验证的Windows二进制文件(certsrv.exe、certpdef.dll)中的真实漏洞
  • 包含独立验证脚本,确保输出未被篡改
  • 全自动(自动签名者、SID注入),使用示例清晰
  • 附带详细逆向工程笔记和完整攻击链记录

使用前须知

  • 需要目标环境中存在ESC1形状的模板(默认模板不具备该形状)
  • 需要能访问CA的MS-ICPR(端口135)
  • 仅限授权测试使用,滥用属非法和不道德行为

README 快速开始

cmc-addext

I use the CMC id-cmc-addExtensions control to inject arbitrary X.509 extensions into an AD CS certificate request. On an ESC1-shaped template, that lets a low-privileged domain user forge a certificate whose Subject Alternative Name and whose szOID_NTDS_CA_SECURITY_EXT SID both point at Administrator - and PKINIT to Domain Admin on a fully patched CA and DC with StrongCertificateBindingEnforcement = 2.

Full writeup, with the disassembly and the reasoning: https://0xmaz.me/posts/certsrv-id-cmc-addExtensions-KB5014754-bypass/

Reverse-engineering notes (functions, offsets, both binaries): REVERSING.md.

How it works

Two defects, chained.

certsrv.exe routes request extensions through a dispatcher that masks the caller flag with & 0xf0000 and recognises only two allowlists (0x50000 and 0x90000). The id-cmc-addExtensions handler calls it with 0x80002, and 0x80002 & 0xf0000 = 0x80000 - neither value - so no allowlist runs. Every extension I put in the CMC control reaches SetCertificateExtension, including the SAN and szOID_NTDS_CA_SECURITY_EXT. The signer only needs a certificate the CA itself issued (CryptMsgGetAndVerifySigner with CMSG_SIGNER_ONLY_FLAG checks the signature, not the chain), so --auto-signer enrolls a throwaway to sign with.

certpdef.dll is supposed to stamp the requester's real SID into that extension - the KB5014754 defence. On the enrollee-supplies-subject path it doesn't generate anything; it copies the SID out of the request. Since the first defect lets me put any SID in the request, I supply the Administrator's SID next to the Administrator UPN, and the KDC's strong binding check passes.

Requirements on the target

  • An ESC1-shaped template: ENROLLEE_SUPPLIES_SUBJECT, a clientAuth EKU, enroll rights for the low-privileged user, and no SUBJECT_ALT_REQUIRE_UPN. No default-published template has this shape - the built-ins carry REQUIRE_UPN/REQUIRE_DNS, which rebind the SAN and SID to the caller. The point is that KB5014754 was documented as making a leftover ESC1 template survivable; on this path it doesn't.
  • MS-ICPR (RPC, port 135) to the CA. CES is optional.
  • Any low-privileged domain account (to auto-enroll the throwaway signer).

Install

python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
# certipy-ad and impack

项目描述

A low-priv domain user forges an Administrator certificate through the CMC `id-cmc-addExtensions` control and PKINITs to Domain Admin

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
littledivy
精选
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI 与机器学习
1,482