πŸ”₯Keberoasting with Windows

Kerberoasting Manual Method

Before tools like Rubeus we had to use a more manual process to steal or forge Kerberos tickets.

Enumerating SPNs with setspen.exe

We should focus on user account and ignore computer accounts returned.

setspn.exe -Q */*
Checking domain DC=INLANEFREIGHT,DC=LOCAL
CN=DC01,OU=Domain Controllers,DC=INLANEFREIGHT,DC=LOCAL
	Dfsr-12F9A27C-BF97-4787-9364-D31B6C55EB04/DC01.INLANEFREIGHT.LOCAL
	ldap/DC01.INLANEFREIGHT.LOCAL/ForestDnsZones.INLANEFREIGHT.LOCAL
	ldap/DC01.INLANEFREIGHT.LOCAL/DomainDnsZones.INLANEFREIGHT.LOCAL
	DNS/DC01.INLANEFREIGHT.LOCAL
	GC/DC01.INLANEFREIGHT.LOCAL/INLANEFREIGHT.LOCAL
	RestrictedKrbHost/DC01.INLANEFREIGHT.LOCAL
	RestrictedKrbHost/DC01
	RPC/03d2eace-bb3d-467e-a00a-eab0dbfaa065._msdcs.INLANEFREIGHT.LOCAL
	HOST/DC01/INLANEFREIGHT
	HOST/DC01.INLANEFREIGHT.LOCAL/INLANEFREIGHT"
	HOST/DC01
	HOST/DC01.INLANEFREIGHT.LOCAL
	HOST/DC01.INLANEFREIGHT.LOCAL/INLANEFREIGHT.LOCAL
	E3514235-4B06-11D1-AB04-00C04FC2DCD2/03d2eace-bb3d-467e-a00a-eab0dbfaa065/INLANEFREIGHT.LOCAL
	ldap/DC01/INLANEFREIGHT
	ldap/03d2eace-bb3d-467e-a00a-eab0dbfaa065._msdcs.INLANEFREIGHT.LOCAL
	ldap/DC01.INLANEFREIGHT.LOCAL/INLANEFREIGHT
	ldap/DC01
	ldap/DC01.INLANEFREIGHT.LOCAL
	ldap/DC01.INLANEFREIGHT.LOCAL/INLANEFREIGHT.LOCAL
CN=krbtgt,CN=Users,DC=INLANEFREIGHT,DC=LOCAL
	kadmin/changepw
CN=svc_sql,CN=Users,DC=INLANEFREIGHT,DC=LOCAL
	MSSQLSvc/SQL01.inlanefreight.local:1433
CN=sqlprod,CN=Users,DC=INLANEFREIGHT,DC=LOCAL
	MSSQLSvc/SQL02.inlanefreight.local:1433
CN=sqldev,CN=Users,DC=INLANEFREIGHT,DC=LOCAL
	MSSQLSvc/SQL-DEV01.inlanefreight.local:1433
CN=sqltest,CN=Users,DC=INLANEFREIGHT,DC=LOCAL
	MSSQLSvc/DEVTEST.inlanefreight.local:1433
CN=sqlqa,CN=Users,DC=INLANEFREIGHT,DC=LOCAL
	MSSQLSvc/QA001.inlanefreight.local:1433
CN=azureconnect,CN=Users,DC=INLANEFREIGHT,DC=LOCAL
	adfsconnect/azure01.inlanefreight.local
CN=backupjob,CN=Users,DC=INLANEFREIGHT,DC=LOCAL
	backupjob/veam001.inlanefreight.local
CN=WEB-WIN01,CN=Computers,DC=INLANEFREIGHT,DC=LOCAL
	RestrictedKrbHost/WEB-WIN01
	HOST/WEB-WIN01
	RestrictedKrbHost/WEB-WIN01.INLANEFREIGHT.LOCAL
	HOST/WEB-WIN01.INLANEFREIGHT.LOCAL
CN=MS01,CN=Computers,DC=INLANEFREIGHT,DC=LOCAL
	tapinego/MS01
	tapinego/MS01.INLANEFREIGHT.LOCAL
	TERMSRV/MS01
	TERMSRV/MS01.INLANEFREIGHT.LOCAL
	WSMAN/MS01
	WSMAN/MS01.INLANEFREIGHT.LOCAL
	RestrictedKrbHost/MS01
	HOST/MS01
	RestrictedKrbHost/MS01.INLANEFREIGHT.LOCAL
	HOST/MS01.INLANEFREIGHT.LOCAL

Existing SPN found!

Target a User

We can request TGS tickets for an account and load them into memory with PowerShell

Getting All Tickets Using setspn.exe

Extracting Ticket using Mimikatz

If we don't specify base64 /out:true Mimikatz will extract tickets and write them to .kirbi file.

We have a base64 blob we can now prepare for cracking

Preparing Base64 Blob

We remove new lines and white spaces from our base64 blob

Placing the Output into a .kirbi File

We place the output into a file and convert it to a .kirbi file

Extract The Ticket from the TGS File

We can then create file called crack_file

Modify for Hashcat and Cracking

We must modify the file so we can use it in Hashcat

Now we can attempt to crack it

Automated Kerberoasting

While it's good to understand how to manually perform Keberoasting it's much more efficient to use automated tools to do the job faster.

Using PowerView to Extract TGS Tickets

Using PowerView To Target a User

Exporting Tickets to a CSV File

Using Rubeus

Rubeus is a powerful tool for attacking Kerberos is an adaption of the Kekeo tool. It has many attacks like overpass the hash, ticket request, harvesting, pass the ticket, AS-REP Roasting and of course Kerberoasting.

Using the /stats Flag

We can see potential users that can kerberoastable, when the users passwords have been set and plenty more.

Using the /nowrap Flag

Encryption Types

Kerberoating tools usaully request RC4 Encrption when performing the attack, RC4 is weaker and easier to crack offline than other encryption algorithms like AES-128 and AES-256.

Basic Rubeus Example for RC4

We attack a specific user; testspn in this case

We check to see with PowerView what encryption type is used

msDS-SupportedEncryptionTypes=0 means the type is not defined and the default RC4_HMAC_MD5 will be used

We attempt to crack the hash with Hashcat

Rubeus with Other Encryption Types

We can check like before for what encryption type is being used

msDS-SupportedEncryptionTypes=24 means that the AES 128/256 are the only ones supported

We can now request a new ticket with Rubeus,

As before we can pass it into Hashcat with the correct hashmode, 19700 in this case

Using the /tgtdeleg Flag

We can use the /tgtdeleg flag to specify we want only RC4 encryption when requesting a new service ticket.

Harvesting Tickets using Rubeus

To begin harvesting tickets from the KDC we make sure Rubues is Installed on the target machine

Rubeus.exe harvest /interval:<NUM_OF_SECONDS>

Testing Access against DC

Once cracked we can confirm our access with a tool like crackmapexec

Last updated

Was this helpful?