Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Certighost_CVE-2026-54121 — One-click exploit for CVE-2026-54121 (Certighost) targeting AD CS certificate identity spoofing. Automates machine account creation, traffic redirect, rogue CA, PKINIT, and NT hash extraction for domain compromise. | Kitploit
Tools/GitHubGitHub/trya9ain/certighost_cve-2026-54121
Vulnerability AnalysisExploitationPost-ExploitationPenetration TestingRed Teaming
GitHubtrya9ain/certighost_cve-2026-54121

Certighost_CVE-2026-54121

One-click exploit for CVE-2026-54121 (Certighost) targeting AD CS certificate identity spoofing. Automates machine account creation, traffic redirect, rogue CA, PKINIT, and NT hash extraction for domain compromise.

View Repository
11h 32m agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

certighost-oneclick

CVE-2026-54121(Certighost)一键化利用工具 —— 仅用于本地靶场/授权测试。

基于上游 PoC(@h0j3n 分析 / @aniqfakhrul 实现)改造的 Windows 原生版: 内置自研 WinDivert 重定向器(pydivert),一条命令完成"建号 → 重定向 → rogue 监听 → CA chase → 域控身份证书 → PKINIT → 域控机器账户 NT 哈希",全程不停止 Server 服务、 不改动主机任何配置,退出即恢复。

与上游的差异(补丁清单)

补丁说明
--redirect内置 WinDivert 重定向器(445 → --lsa-port,窄域过滤:仅劫持 listener IP 的流量),随进程起停、退出自动恢复 445。替代官方 PortBender(其官方产物为 CS 专用 32 位反射 DLL,无法独立运行)
--lsa-portrogue LSA/SMB 监听端口参数化(默认 445;--redirect 时默认 8445)
os.geteuid 守卫上游 root 检查在 Windows 上崩溃 → hasattr 守卫 + Windows 端口提示
就绪检查参数化上游硬编码 port_ok(127.0.0.1, 445) → args.lsa_port
PEP 723 头uv run certighost.py ... 直接跑,依赖自动解析(含 git-master impacket),零环境污染
--new-computer-name建号自定义名称(避开 GHOST* 检测特征)
--new-computer-pass建号自定义密码(须过域密码策略)
random.randbytes polyfillimpacket git-master 在 smbserver 导入期使用 3.9+ API;3.8 档需要,os.urandom 实现
收尾即退GGWP 后 flush + os._exit()(根治 impacket 非 daemon 线程导致的分钟级挂起)
退出码语义化0 成功 / 1 失败
<dc>.hash.txt 落盘域控机器账户 NT 哈希写入文件(仅一行 name:lm:nt)

用法

① 预检(只读,确认 CA 与利用前提):

root@kitploit:~
uv run check_ca.py -d bingo.com -dc-ip 192.168.16.144 -u zhaolei -p 'pass'

输出 Enterprise CA 列表、Machine 模板签发与注册权限(需要 Domain Computers 有 Enroll)。 CA 机器上另查 chase 标志:certutil -getreg policy\EditFlags(应有 EDITF_ENABLECHASECLIENTDC;Server 2016 默认安装实测开启)。

② 一键利用(Windows,管理员):

root@kitploit:~
uv run certighost.py -d bingo.com -u zhaolei -p '[email protected]' \
  --dc-ip 192.168.16.144 --listener <本机可达IP> --redirect \
  --new-computer-name MACH$ --new-computer-pass 'Your@Pw123!'

产物三件套(自动落盘到运行目录):

文件内容
<dc>.pfx域控身份证书(PKINIT 材料)
<dc>.ccacheKerberos 票据缓存
<dc>.hash.txt域控机器账户 NT 哈希(仅 name:lm:nt 一行)

③ 清理(删除建号):

root@kitploit:~
uv run cleanup_ghost.py -d bingo.com -dc-ip 192.168.16.144 -u administrator -p 'pass' --prefix MACH

参数(impacket 风格)

参数说明
-d / -u / -p / -H域 / 低权用户 / 密码 / NTLM 哈希
--dc-ipDC 地址(必填)
--listener IProgue 监听器 IP(多网卡务必显式指定)
--redirectWindows 核心:内置 WinDivert 445 重定向(需管理员 + pydivert)
--lsa-port Nrogue LSA 端口(--redirect 时默认 8445)
--new-computer-name建号自定义名称(自动补 $)
--new-computer-pass建号自定义密码(与 existing 路径互斥)
--computer-name/--computer-pass/--computer-hash免 MAQ:复用已控制的机器账户
--target-san DC01$指定冒充目标(默认自动发现 DC)
--template证书模板(默认 Machine)
--ca / --ca-ip手工指定 CA
--debug协议阶段全追踪

内部流程

root@kitploit:~
Phase1  低权用户建机器账户(MAQ 路径自动 / --new-computer-* 自定义 / --computer-* 复用已有)
Phase2  [Windows] 内置 WinDivert 重定向器:listener_ip:445 -> :lsa_port
        窄域过滤(仅该 IP),改写后包脱离过滤器 = 无重注入循环;句柄随进程关闭
Phase3  rogue 服务器:LDAP:389 + LSA/SMB:lsa_port(应答 cdc/rmd chase,喂 DC 身份数据)
Phase4  以机器身份提交证书请求(Machine 模板),CA 回连 rogue → 签发 DC 身份证书
Phase5  PKINIT → KDC 在 PAC 中返回 DC 机器账户 NT 哈希 → 提取并写入 .hash.txt
Phase6  (后续)secretsdump DCSync → krbtgt → 全域接管;cleanup_ghost 清理建号

Linux 用法不变(root 直绑 445/389,不带 --redirect)。

哈希提取机制(不是 DCSync)

攻击链的哈希提取走 PKINIT → PAC → NT 哈希,不是 DCSync:

  1. CA 被骗签发"身份 = 域控机器账户"的证书
  2. 脚本用证书做 Kerberos PKINIT(公钥预认证)
  3. KDC 在 AS-REP 的 PAC_CREDENTIAL_INFO 中返回该账户的 NT 哈希 (Kerberos 协议的设计行为:证书认证时把 NT 哈希塞进 PAC,兼容 NTLM 老应用)
  4. 脚本解密 PAC 提取哈希 → 打印 + 落盘

拿到哈希后用 secretsdump 做 DCSync 是第二步操作,不是哈希的来源。

打包(单文件 exe,架构 A 交付形态)

root@kitploit:~
# PowerShell 7
./build_exe.ps1              # 默认档  (Win10 / Server 2016+)
./build_exe.ps1 3.10         # 兼容档  (Win8.1 / Server 2012 R2+)
./build_exe.ps1 legacy       # 遗留档  (Win7 SP1 / Server 2008 R2 x64)

产物 dist\certighost_x64.exe:19-27MB(随档位)、--uac-admin 自提权、零依赖, 脚本自动输出 SHA256 校验和。

遗留档(legacy)构建前提

需要 python.org 官方 CPython 3.8.10 安装在以下路径(最后一个支持 Win7 内核的 官方二进制构建,不依赖新 UCRT API):

root@kitploit:~
D:\网安相关\Tools\Python\cpython-3.8.10-x64\

安装命令(静默、不写 PATH、不装启动器):

root@kitploit:~
python-3.8.10-amd64.exe /quiet InstallAllUsers=0 TargetDir=D:\网安相关\Tools\Python\cpython-3.8.10-x64 PrependPath=0 Include_launcher=0

同时钉 PyInstaller==5.13.2(6.x bootloader 不支持 Win7 内核)和 cryptography==38.0.4(Rust 轮子从 38.x 后开始要求 Win10+),均已在脚本中固化。

实机验证矩阵

档位系统实机全链备注
默认Win11✅
兼容 3.10Win11 / Win10 / Server 2012 R2✅ ×3含 WinDivert 实机
遗留 legacyWin11 / Server 2008 R2 x64✅ ×2官方 3.8.10 + PyInstaller 5.13.2

注意 PyInstaller+impacket 是杀软特征重灾区,落地前自行评估。

实战部署架构(双机模型)

  • 架构 A(本工具默认形态):整套 exe 投递到可出网的立足点(需管理员)直接跑;
  • 架构 B(贵重立足点):工具留本地,立足点只放隧道远程转发(389 直绑 + 445 需 本工具同款重定向)。

检测点(蓝队)

  • CA 数据库出现颁发给 DC 身份的可疑证书(永久残留)——取证第一锚点
  • CA 事件 4886/4887(证书签发)与请求者-目标身份错位(Elastic/Nextron 有现成规则)
  • 新建 GHOST*/自定义机器账户(4741)+ 低权用户对 CA 的注册请求
  • 立足点 WinDivert 驱动加载事件(架构 A/B 共有)

已知边界

  • 需要 Enterprise CA + 低权用户可走注册 + DC 未打 2026-07 补丁 + chase 标志开启
  • 目标只能是计算机账户(Machine 模板的注册权限与 dNSHostName 身份机制所限) 但域控机器账户 = DCSync = 全域,效果等价于拿到所有域管
  • Server 2016 全链实证;2012R2~2025 推断可行(同 chase 机制)
  • 建号路径为降级梯子:LDAPS 失败自动回退 SAMR
  • PKINIT 阶段偶发 ciphertext integrity failure:观察到一次,重试即愈
  • 重定向器为 IPv4 窄域设计,IPv6 场景未覆盖

文件清单

root@kitploit:~
certighost.py            主 exploit(上游 + Windows 原生化补丁 + PEP 723)
certighost_redirect.py   自研 WinDivert 445 重定向器(pydivert;--selftest/--e2e 自测)
check_ca.py              预检:CA/模板/注册权限/chase 标志(只读)
cleanup_ghost.py         收尾:删除建号
build_exe.ps1            PyInstaller 单文件打包(pwsh7,三档矩阵,自动 SHA256)

上游与致谢

  • 原始研究与 PoC:@h0j3n(gist 分析)、@aniqfakhrul/CVE-2026-54121(上游实现)
  • Kudelski Security(漏洞发现方);PortBender(Praetorian,重定向思路来源)
  • pydivert(WinDivert 2.2.2 Python 绑定)
Download Tool