Before tools like Rubeus was out, Kerberoasting was very complicated.
Now we can perform Kerberoasting from Windows in many ways.
Let’s learn about both manual way and automated tooling way.
Manual Way
setspn.exe
setspn is a buit-in binary to enumerate SPNs in the domain.
We can see that SPNs being returned from hosts in the domain.
We will focus on user accounts and ignore the computer accounts.
Obtain TGS from specific user
Now that we have list of SPNs, we can use PowerShell to request TGS tickets for an account and load them into memory.
Once they are loaded, we can extract them using mimikatz.
Let’s request TGS for MSSQLSvc user:
Obtain TGS from all users
We can also decide to retrieve all tickets using the same method as above.
This is also get ticket for computer accounts too, so it is not optimal.
Now that the tickets has been loaded to the memory, let’s extract them using Mimikatz.
We used base64 /out:true
so it is easier for us to transfer the output.
If not specified, tickets will be extracted in a format of .kirbi
file.
Crack it
If we have the base64 encoded ticket, let’s format it to remove empty lines:
Now copy the formatted output and save it to a separate file and convert it back to .kirbi
file:
Now let’s use kirbi2john.py to extract the kerberos ticket:
Above will create crack_file
.
Let’s format it once again to use it with hashcat:
Finally, let’s crack the ticket using hashcat:
Automated Way
Above we learned about older-manual way of kerberoasting on Windows.
Now let’s learn about quicker way to perform Kerberoasting from Windows.
PowerView
SPN Get
Let’s first get the SPNs using PowerView:
Target Specific User
Now that we have list of SPNs, let’s use PowerView to target a specific user and retrieve the TGS ticket in hashcat format:
Get All Tickets
We can also decide to export all tickets and save it to a CSV file:
Rubeus
Let’s first use Rubeus to gather some stats.
We can see that there are nine kerberoastable users, seven of which support RC4 Encryption for ticket requests and two of which support AES 128/256.
Now let’s request tickets for accounts with admincount
attribute set as 1
.
nowrap
will help for easy copy.
We can target specific user as such:
Hashcat
To crack RC4:
To crack AES256:
Encryption Types
Kerberoasting tools typically requests RC4 encryption when TGS-REQ request because it is easier to crack compared to AES128 and AES-256.
$krb5tgs$23$*
- RC4
$krb5tgs$18$*
- AES-256
Specify RC4
If we only want to request tickets for RC4 (type 23), we can use /tgtdeleg
flag:
.\Rubeus.exe kerberoast /tgtdeleg /user:testspn /nowrap
However, starting from Windows server 2019, AES is automatically required for Kerberoasting.
Moving On
Now we have obtained new credentials through Kerberoasting. Where do we use these credentials?
- RDP, WinRM
- PsExec
- FileShare
- MSSQL