Golden Ticket
Introduction
The Golden Ticket is a highly advanced and dangerous attack technique leveraged by threat actors to gain persistent and virtually unlimited access to an organisation's network. It targets Active Directory (AD), which is the cornerstone of identity and access management in most enterprise environments. The attack exploits the core functionality of Kerberos, a network authentication protocol, allowing attackers to impersonate any user or service in the domain.
Named after the concept of a "golden ticket" that provides unlimited access, this technique represents a worst-case scenario for security professionals, as it bypasses standard authentication mechanisms and is exceedingly difficult to detect.
Attack Description
In a Golden Ticket attack, the adversary generates a forged Kerberos ticket-granting ticket (TGT) using the Kerberos protocol. This allows them to authenticate as any user, including privileged accounts like Domain Admins, for an indefinite period. The attack hinges on compromising the KRBTGT account, a highly sensitive account used to encrypt and sign all TGTs in the domain.
The key elements of the attack are:
Prerequisites:
The attacker must have administrative access to a domain controller or access to the domain's KRBTGT account hash.
This is typically achieved through techniques like credential theft, Pass-the-Hash, or exploitation of Active Directory vulnerabilities.
Execution:
Once the KRBTGT hash is obtained, the attacker uses tools like Mimikatz to forge a valid TGT.
The forged ticket is then injected into the current session, allowing the attacker to impersonate any user or service on the domain.
Capabilities:
Persistent access: The forged TGT can be configured to remain valid indefinitely, even after password resets.
Privilege escalation: The attacker can impersonate high-privilege accounts, such as Domain Admins, to perform sensitive operations.
Stealth: The attack often bypasses traditional detection methods, as the TGT appears legitimate to the domain.
Detection and Mitigation Challenges:
Since the Golden Ticket relies on the compromised KRBTGT hash, typical password changes do not mitigate the risk.
Detecting Golden Tickets is challenging because they leverage the same cryptographic mechanisms used by legitimate tickets.
Indicators of Compromise (IoCs):
Unusual account activity, such as privilege escalation without prior authorisation.
Authentication events where the TGT does not match normal ticket issuance patterns.
Abnormal logins from service accounts or sensitive administrative accounts.
Significance for Security Operations Centers (SOCs)
The Golden Ticket attack is particularly devastating in the context of enterprise security because of its capability to completely compromise Active Directory environments. SOC analysts and security teams must prioritise proactive threat hunting and defence strategies to mitigate its impact, including:
Regular KRBTGT password resets (twice, in a staggered manner, to invalidate all existing tickets).
Monitoring for suspicious activities in the Windows Security Event Logs, such as Event ID 4769 (Kerberos Service Ticket Request).
Implementing tools and techniques for Active Directory auditing and Kerberos traffic inspection.
Deploying Endpoint Detection and Response (EDR) and threat-hunting solutions like Velociraptor or Defender XDR to identify anomalous patterns.
By understanding the mechanics and implications of the Golden Ticket attack, SOC teams can better defend against this high-impact threat.
KQL Detection Queries
To detect a Golden Ticket attack using KQL (Kusto Query Language) in tools like Microsoft Sentinel or Defender for Endpoint, you can analyse Windows Security Event Logs, mainly focusing on Kerberos ticketing events.
KQL Query: Detecting Golden Ticket Attack
Explanation of Query Logic
Filter Events:
Focus on Kerberos-related event IDs:
4768
: TGT request.4769
: Service ticket request.4770
: TGT renewal.
Unusual Flags in TGT:
A Golden Ticket often includes uncommon ticket options (
0x40810010
) that indicate high privilege and a manually crafted ticket.
Abnormally Long Ticket Lifetimes:
Legitimate Kerberos tickets have limited lifetimes (typically 10 hours). Golden Tickets often have unusually long or unlimited lifetimes (
TimeToLive == 0
).
Status Code Anomalies:
Certain status codes like
0xC00000BB
(invalid ticket) or0xC000019B
(service request anomaly) may indicate suspicious activity.
Anomalous Attributes:
Events are labeled with attributes that point to their anomalous nature for easier SOC investigation.
Summarisation:
Events are grouped and counted by key dimensions, such as
Computer
,AccountName
, andEventID
, allowing SOC analysts to spot trends or outliers.
Next Steps for Investigation
Validate with Additional Context:
Cross-reference detected anomalies with other logs, such as process creation or lateral movement events.
Examine KRBTGT Activity:
Look for unauthorized access to the KRBTGT account and verify its password change history.
Forensic Actions:
Isolate affected systems and reset KRBTGT passwords (twice) to invalidate forged tickets.
Splunk Detection Query
The following are Splunk queries to detect potential Golden Ticket attacks by analysing Windows Security Event Logs, focusing on suspicious Kerberos activity:
Splunk Query: Detecting Golden Ticket Activity
Explanation of Query Components
Events of Interest:
Event ID 4768: TGT request (Ticket Granting Ticket).
Event ID 4769: Service ticket request.
Event ID 4770: TGT renewal.
Anomalous Conditions:
Suspicious TGT Options: Detects rare Kerberos flags (e.g.,
0x40810010
) used in manually crafted TGTs.Long Ticket Lifetimes: Golden Tickets often have lifetimes exceeding normal thresholds (e.g., 10 days) or are set to never expire (
Lifetime = 0
).Renewal Failures: Certain Kerberos renewal errors (
0xC00000BB
,0xC000019B
) may indicate tampered tickets.Unusual Encryption: Looks for encryption types associated with manual ticket crafting (
AES256_CTS_HMAC_SHA1_96
).Service Account Activity: Service accounts (
$
) making unexpected TGT requests.
Behaviour Labeling:
Assigns a descriptive label (
AnomalousBehavior
) to suspicious activities for easier investigation.
Summarization:
Groups anomalies by key attributes such as
host
,Account_Name
, andService_Name
.Calculates timestamps (
FirstSeen
,LastSeen
) to establish a timeframe for the activity.Adds a
TimeWindow
field to show the duration between the first and last detected anomalies.
Result Presentation:
Displays key fields (
Computer
,AccountName
,ServiceName
,AnomalousBehavior
) for SOC investigation.Orders results by the number of anomalies (
count
) to prioritise investigation.
Recommendations for Optimisation
Log Field Extraction:
Ensure fields like
Ticket_Options
,Service_Name
,Encryption_Type
, andTicket_Lifetime
are extracted from your Windows Event Logs.
Baseline Normal Behavior:
Identify normal patterns for Kerberos activity in your environment and adjust thresholds (e.g., ticket lifetimes) accordingly.
Correlate with Additional Logs:
Combine results with process execution (EventCode 4688) or privilege escalation logs (EventCode 4672) for broader context.
Alerting:
Set up alerts in Splunk for high-priority anomalies like
Suspicious TGT Options
orAbnormally Long Ticket Lifetimes
.
Reference
Last updated