Kerberoasting - Identifying Vulnerable Accounts and Tools for the Task
Kerberoasting is a post-exploitation technique that attackers use to harvest Kerberos service account credentials in Windows Active Directory environments. By exploiting how Kerberos authentication works, adversaries can extract service tickets and attempt to crack the associated hashed credentials offline, potentially gaining access to high-privilege accounts. This article will explore how Kerberoasting works, methods to identify vulnerable accounts, and tools commonly used for this task.
How Kerberoasting Works:
- SPN Enumeration: Attackers enumerate SPNs to find accounts linked to services within the domain.
- Ticket Request: Once an SPN is identified, the attacker requests a Kerberos Ticket Granting Service (TGS) ticket for the associated service.
- Ticket Extraction: The obtained TGS ticket is encrypted with the service account’s NTLM hash. Attackers extract the ticket to an offline environment.
- Password Cracking: Using brute-force or dictionary attacks, the NTLM hash is cracked to recover the service account's plaintext password.
This technique is effective because Kerberos does not limit who can request tickets for SPNs, and cracking the password offline allows attackers to bypass account lockout thresholds.
Identifying Vulnerable Accounts
The success of Kerberoasting depends on poorly managed service accounts. Identifying such accounts is key to both attackers and defenders. Characteristics of Vulnerable Accounts:
- Weak Passwords: Accounts with simple, easily guessable passwords are prime targets.
- High Privilege Levels: Service accounts with elevated privileges pose a greater risk if compromised.
- Kerberos Preauthentication Disabled: Accounts without Kerberos Preauthentication are more susceptible to certain attacks.
- No Password Rotation: Accounts whose passwords haven’t been changed for years increase the risk of compromise.
- Unused or Dormant Accounts: Stale service accounts often remain unnoticed but accessible.
- Steps to Identify Vulnerable Accounts
- SPN Analysis: Use tools or scripts to identify accounts with SPNs.
- Password Policies Review: Check if these accounts adhere to organizational password complexity and rotation policies.
- Audit Logs: Look for suspicious activity involving TGS requests from unusual users or machines.
Common Tools for Kerberoasting
Several tools make it easier to perform Kerberoasting attacks or analyze the environment for vulnerabilities. Here's an overview:
For Attackers
- Impacket’s GetUserSPNs.py Part of the Impacket suite, this tool extracts SPNs and requests TGS tickets. Command: python GetUserSPNs.py domain/username: password
- Rubeus A C# tool that performs various Kerberos attacks, including Kerberoasting. Command: Rubeus.exe kerberoast /format:hashcat
- PowerView A PowerShell module for enumerating domain objects and SPNs. Command: Get-DomainUser -SPN
- Kerbrute Focuses on brute-forcing Kerberos logins and enumerating SPNs.
For Defenders
- BloodHound Maps Active Directory relationships, highlighting accounts with SPNs and identifying misconfigurations. Useful for spotting potential attack paths.
- Microsoft ATA/Defender for Identity Monitors Kerberos traffic for anomalous TGS requests.
- Log Analysis Tools (SIEM) Search for patterns in logs that indicate Kerberoasting attempts: Event ID 4769: A Kerberos service ticket was requested. Look for a high number of TGS requests from a single user.
- Purple Knight / Ping Castle Assesses Active Directory security and flags potential Kerberoasting vulnerabilities. Mitigation Strategies
To defend against Kerberoasting, implement the following measures:
- Enforce Strong Password Policies:
- Use SIEM solutions to flag unusual patterns in TGS ticket requests.
- Restrict Privileges
- Enable Kerberos Pre-authentication:
- Prevent brute-force attacks on service accounts.
- Regular Auditing:
Conclusion
Kerberoasting is a potent attack vector, but with proactive measures and a solid understanding of the Active Directory environment, organizations can minimize their exposure. By identifying vulnerable accounts, monitoring for unusual activity, and employing strong security practices, defenders can stay a step ahead of attackers. Moreover, tools like BloodHound and Microsoft Defender for Identity can provide valuable insights into the state of Active Directory security, enabling faster response and remediation.