Kerberoasting, Explained Down to the Packet

Kerberoasting is one of the first things I try on an internal Active Directory test, because it needs nothing more than one ordinary domain account. This post walks through what actually happens on the wire, why the result can be cracked offline, and what defenders can do about it. MITRE ATT&CK tracks it as T1558.003.

The short version

Any authenticated domain user can ask the domain controller for a service ticket (TGS) to any service that has a Service Principal Name (SPN). Part of that ticket is encrypted with a key derived from the service account's password. If that account is a normal user with a human-chosen password, you can take the ticket home and brute-force it offline. No failed logons, no lockouts.

What happens on the wire

  1. AS-REQ / AS-REP: you log on and get a TGT from the KDC, like every user does.
  2. TGS-REQ: you present the TGT and ask for a ticket to an SPN, for example MSSQLSvc/sql01.corp.local:1433.
  3. TGS-REP: the KDC returns a service ticket. The ticket's enc-part is encrypted with the long-term key of the account that owns the SPN.

The KDC does not check whether you are allowed to use the service. Authorization is the service's job, so the KDC hands the ticket to anyone who asks.

Why the encryption type matters

  • etype 23 (RC4-HMAC): the key is the account's NT hash. Fast to crack. Hashcat mode 13100.
  • etype 17 / 18 (AES128 / AES256): the key is derived with PBKDF2 and 4096 iterations, so cracking is much slower. Hashcat modes 19600 and 19700.

Tools often request RC4 on purpose, and many environments still allow it for service accounts.

Doing it

From Linux with Impacket:

GetUserSPNs.py corp.local/lowpriv:'Password1' -dc-ip 10.0.0.10 -request -outputfile roast.txt
hashcat -m 13100 roast.txt rockyou.txt

From a domain-joined Windows host with Rubeus:

Rubeus.exe kerberoast /outfile:roast.txt

Detection

  • Event ID 4769 (a Kerberos service ticket was requested) on domain controllers.
  • Look for Ticket Encryption Type 0x17 (RC4) in an environment that should use AES.
  • Look for one account requesting tickets for many different SPNs in a short window.
  • Honeypot SPNs: a fake service account that nobody should ever request a ticket for.

Mitigation

  • Use Group Managed Service Accounts (gMSA). Their passwords are long, random and rotated automatically.
  • For accounts that must stay normal users, use passwords of 25+ random characters.
  • Disable RC4 for service accounts via msDS-SupportedEncryptionTypes and move to AES only.
  • Remove SPNs that are no longer used, and keep service accounts out of privileged groups.

Everything here was done in a lab. Only test systems you own or have written permission to test.

Black Friday · 20% off everything, auto-applied

Gear for this post

Shop all gifts for hackers →

Get new AD attack write-ups

Kerberos, ADCS and HTB write-ups by email, with the detection side included. No spam. Unsubscribe in one click.