CRTPCAPEkerberosactive-directorySPN

Kerberoasting

Overview

circle-info

Typically, Kerberoasting happens after compromising a valid domain user. However, according to new researcharrow-up-right, it is possible to perform this attack with an account susceptible to ASREPRoast. For an example of this attack vector check Rebound.

circle-exclamation

Kerberoasting is an attack on the TGS and Service Principal Names (SPNs). SPNs are unique IDs that Kerberos uses to map a service instance, for example MySQL, to a service sign-in account, such as svc_mysql, in whose, often privileged, context the service is running. Any domain user, or SYSTEM access on a domain-joined host, can request a TGS from the DC for any SPN account. The TGS is encrypted with the service's account NTLM hash, so it can potentially be cracked.

                         TGS-REP
  (encrypted with the already known User-KDC session key)
+--------------------------------------------------------+
|	+----------------------------------------------------+ |
|	|  1. User-Service session key                       | |
|	|     (Same session key as in the TGS)               | |
|	+----------------------------------------------------+ |
|                                                        |
|	+----------------------------------------------------+ |
|	|  2. Service Ticket (TGS)                           | |
|	|     +-------------------------------------------+  | |
|	|     | User information                          |  | |
|	|     | +                                         |  | | -------> Kerberoast 
|	|     | User / Service session key                |  | |            
|	|     +-------------------------------------------+  | |
|	|     Encrypted with the service account's secret    | |
+	+----------------------------------------------------+ |

Service vs User Accounts

When a new service is deployed in an environment using Kerberos, it is registered with an SPN, which acts as an alias that uniquely identifies the service. In modern and well-configured environments, services are typically associated with machine or managed service accounts. These accounts, like the krbtgt account, are designed to use strong, automatically generated passwords that can auto-rotate periodically. For example, machine accounts (such as HOSTNAME$) use long, randomly generated passwords which significantly reduces the likelihood of successful offline cracking.

However, not all vendors or legacy applications support managed service accounts. As a result, SPNs may instead be associated with standard user accounts, which introduces a higher risk because password strength and rotation depend on manual management. In some cases, automatic password rotation may also cause operational issues if the service or application is not designed to handle credential updates properly.

circle-check

AES vs RC4 Encryption

From an attack perspective, encryption type is an important factor. Legacy RC4-encrypted TGS ($krb5tgs$23$) are generally easier to crack than those encrypted with stronger AES algorithms ($krbtgs$18). Even in environments that primarily use AES, tools such as Rubeus can sometimes request RC4-encrypted tickets using options like /tgtdeleg, provided RC4 remains enabled for compatibility with older systems.

Tools

Windows

circle-info

Target user accounts with SPNs and Service Accounts with RC4.

circle-exclamation

Linux

circle-info
circle-exclamation

Targeted Kerberoast

If we have GenericAll, GenericWrite, WriteProperty, WriteSPN, or ValidatedSPN over a user object, we can set an SPN on it, request a TGS for this SPN, and then extract and potentially crack the user's hash.

circle-exclamation

Windows

Linux

This attack can be carried out using the targetedKerberoast.pyarrow-up-right tool. The script automates the process by attempting to assign a temporary SPN to user accounts that do not already have one. Once the SPN is set, the tool requests a TGS and extracts the corresponding Kerberos hash, which can later be cracked offline. After completing the process, the tool removes the SPN to restore the original state of the account and reduce the likelihood of detection.

Last updated