githubEdit

Kerberoasting

Kerberoasting

Find users with SPN

PowerView

Get-NetUser -SPN

ActiveDirectory module

Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName

Request ST

Add-Type -AssemblyName System.IdentityModel
New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "SPN/<target>.domain.local"

OR Request-SPNTicket with PowerView

Export the ticket

Invoke-Mimikatz -Command '"kerberos::list /export"'

Crack the ticket

hashcat -m 13100 -a 0 ticket.kirbi /usr/share/wordlist/rockyou.txt

Alternative Method: Rubeus

Rubeus can be used to perform all the attack, with more or less opsec

Kerberoast all the kerberoastable accounts

Kerberoast a specified account

Kerberoast with RC4 downgrade even if the targets are AES enabled. Tickets are easier to crack

Kerberoast with opsec tgtdeleg trick filtering AES accounts

Kerberoast with DES

DES can be enabled in the following GPO

on the Domain Controller, on in the following registry key :

DES can be use to takeover any account except krbtgt and trust accounts.

1) Check if DES is enabled

To check in the UAC of an account

2) Request a ST fot the target SPN

3) Perform a U2U request. The goal is to obtain a ticket for the user than can be decrypted to read the first block of plain text. This block will be used after to form a crackable hash. Retrieve the value of "Block One Plain Text" in the output

4) Then, reuse this value in the /desplaintext parameter with the describe command

5) The Kerberoast Hash value in the output can be used with hashcat:

The obtained DES key can now be used to ask for a TGT for the target account.

To exploit this against a Domain Controller, the DC account UAC must be changed from SERVER_TRUST_ACCOUNT (8192) needs to be changed to WORKSTATION_TRUST_ACCOUNT (4096) (Owner or Write access against the DC account are needed). This attack can be destructive. It is not recommanded to perform it in production. Additionally, DES must be activated in the UAC.

Then, the attack can be performed as presented above. To rollback to SERVER_TRUST_ACCOUNT an admin account is needed. First escalate to DA, then:

Kerberoast without credentials

Without pre-authentication

If a principal can authent without pre-authentication (like AS-REP Roasting), it is possible to use it to launch an AS-REQ request (for a TGT) and trick the request to ask for a ST instead for a kerberoastable principal, by modifying the sname attribut in the req-body part of the request.

With MitM

If no principal without pre-authentication are present, it is still possible to intercept the AS-REQ requests on the wire (with ARP spoofing for example), and replay them to kerberoast.

WARNING: RoastInTheMiddle.exe is only a PoC for the moment, be carefull with it in prod environment !

Combined with DES

Steps

  1. Request a valid TGT for User1.

  2. Send U2U with User1’s TGT as both authentication and additional tickets to extract known plain text of first block.

  3. Man-in-the-Middle (MitM) is performed.

  4. AS-REQ for Computer1 is captured.

  5. AS-REQ modified to only include the DES-CBC-MD5 etype.

  6. Forward AS-REQ to a DC that supports DES.

  7. Extract TGT for Computer1 from AS-REP.

  8. Send U2U with User1’s TGT as the authentication ticket and Computer1’s TGT as the additional ticket to get an ST encrypted with Computer1’s TGT’s session key.

  9. Create a DES hash from U2U ST encrypted with Computer1’s TGT’s session key.

  10. Create KERB_CRED from Computer1’s TGT and known information, missing the session key.

  11. Crack the DES hash back to the TGT session key.

  12. Insert the TGT session key into the KERB_CRED.

  13. Use the TGT to authenticate as Computer1.

Last updated