PowerShell Kerberos Ticket Dump

Detects PowerShell scripts that have the capability of dumping Kerberos tickets from LSA, which potentially indicates an attacker's attempt to acquire credentials for lateral movement.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/07/26"
 3integration = ["windows"]
 4maturity = "production"
 5updated_date = "2024/10/28"
 6min_stack_version = "8.14.0"
 7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Detects PowerShell scripts that have the capability of dumping Kerberos tickets from LSA, which potentially indicates an
13attacker's attempt to acquire credentials for lateral movement.
14"""
15from = "now-9m"
16index = ["winlogbeat-*", "logs-windows.powershell*"]
17language = "kuery"
18license = "Elastic License v2"
19name = "PowerShell Kerberos Ticket Dump"
20note = """## Triage and analysis
21
22### Investigating PowerShell Kerberos Ticket Dump
23
24Kerberos is an authentication protocol that relies on tickets to grant access to network resources. Adversaries may abuse this protocol to acquire credentials for lateral movement within a network.
25
26This rule indicates the use of scripts that contain code capable of dumping Kerberos tickets, which can indicate potential PowerShell abuse for credential theft.
27
28### Possible investigation steps
29
30- Examine the script content that triggered the detection; look for suspicious DLL imports, collection or exfiltration capabilities, suspicious functions, encoded or compressed data, and other potentially malicious characteristics.
31- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
32- Investigate if the script was executed, and if so, which account was targeted.
33- Identify the account involved and contact the owner to confirm whether they are aware of this activity.
34- Check if the script has any other functionality that can be potentially malicious.
35- Investigate other alerts associated with the user/host during the past 48 hours.
36- Investigate other potentially compromised accounts and hosts. Review login events (like 4624) for suspicious events involving the subject and target accounts.
37
38### False positive analysis
39
40- If this activity is expected and noisy in your environment, consider adding exceptions — preferably with a combination of file path and user ID conditions.
41
42### Related Rules
43
44- PowerShell Kerberos Ticket Request - eb610e70-f9e6-4949-82b9-f1c5bcd37c39
45
46### Response and Remediation
47
48- Initiate the incident response process based on the outcome of the triage.
49  - If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
50- Isolate the involved hosts to prevent further post-compromise behavior.
51- Disable or limit involved accounts during the investigation and response.
52- If the triage identified malware, search the environment for additional compromised hosts.
53  - Implement temporary network rules, procedures, and segmentation to contain the malware.
54  - Stop suspicious processes.
55  - Immediately block the identified indicators of compromise (IoCs).
56  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
57- Remove and block malicious artifacts identified during triage.
58- Reimage the host operating system or restore the compromised files to clean versions.
59- Restrict PowerShell usage outside of IT and engineering business units using GPOs, AppLocker, Intune, or similar software.
60- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
61- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
62- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
63- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
64"""
65references = ["https://github.com/MzHmO/PowershellKerberos/blob/main/dumper.ps1"]
66risk_score = 73
67rule_id = "fddff193-48a3-484d-8d35-90bb3d323a56"
68setup = """## Setup
69
70The 'PowerShell Script Block Logging' logging policy must be enabled.
71Steps to implement the logging policy with Advanced Audit Configuration:

Computer Configuration > Administrative Templates > Windows PowerShell > Turn on PowerShell Script Block Logging (Enable)

1
2Steps to implement the logging policy via registry:

reg add "hklm\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" /v EnableScriptBlockLogging /t REG_DWORD /d 1

 1"""
 2severity = "high"
 3tags = [
 4    "Domain: Endpoint",
 5    "OS: Windows",
 6    "Use Case: Threat Detection",
 7    "Tactic: Credential Access",
 8    "Data Source: PowerShell Logs",
 9]
10timestamp_override = "event.ingested"
11type = "query"
12
13query = '''
14event.category:process and host.os.type:windows and
15  powershell.file.script_block_text : (
16    "LsaCallAuthenticationPackage" and
17    (
18      "KerbRetrieveEncodedTicketMessage" or
19      "KerbQueryTicketCacheMessage" or
20      "KerbQueryTicketCacheExMessage" or
21      "KerbQueryTicketCacheEx2Message" or
22      "KerbRetrieveTicketMessage" or
23      "KerbDecryptDataMessage"
24    )
25  )
26'''
27
28
29[[rule.threat]]
30framework = "MITRE ATT&CK"
31[[rule.threat.technique]]
32id = "T1003"
33name = "OS Credential Dumping"
34reference = "https://attack.mitre.org/techniques/T1003/"
35
36[[rule.threat.technique]]
37id = "T1558"
38name = "Steal or Forge Kerberos Tickets"
39reference = "https://attack.mitre.org/techniques/T1558/"
40
41
42[rule.threat.tactic]
43id = "TA0006"
44name = "Credential Access"
45reference = "https://attack.mitre.org/tactics/TA0006/"
46[[rule.threat]]
47framework = "MITRE ATT&CK"
48[[rule.threat.technique]]
49id = "T1059"
50name = "Command and Scripting Interpreter"
51reference = "https://attack.mitre.org/techniques/T1059/"
52[[rule.threat.technique.subtechnique]]
53id = "T1059.001"
54name = "PowerShell"
55reference = "https://attack.mitre.org/techniques/T1059/001/"
56
57
58
59[rule.threat.tactic]
60id = "TA0002"
61name = "Execution"
62reference = "https://attack.mitre.org/tactics/TA0002/"

Triage and analysis

Investigating PowerShell Kerberos Ticket Dump

Kerberos is an authentication protocol that relies on tickets to grant access to network resources. Adversaries may abuse this protocol to acquire credentials for lateral movement within a network.

This rule indicates the use of scripts that contain code capable of dumping Kerberos tickets, which can indicate potential PowerShell abuse for credential theft.

Possible investigation steps

  • Examine the script content that triggered the detection; look for suspicious DLL imports, collection or exfiltration capabilities, suspicious functions, encoded or compressed data, and other potentially malicious characteristics.
  • Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Investigate if the script was executed, and if so, which account was targeted.
  • Identify the account involved and contact the owner to confirm whether they are aware of this activity.
  • Check if the script has any other functionality that can be potentially malicious.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Investigate other potentially compromised accounts and hosts. Review login events (like 4624) for suspicious events involving the subject and target accounts.

False positive analysis

  • If this activity is expected and noisy in your environment, consider adding exceptions — preferably with a combination of file path and user ID conditions.
  • PowerShell Kerberos Ticket Request - eb610e70-f9e6-4949-82b9-f1c5bcd37c39

Response and Remediation

  • Initiate the incident response process based on the outcome of the triage.
    • If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
  • Isolate the involved hosts to prevent further post-compromise behavior.
  • Disable or limit involved accounts during the investigation and response.
  • If the triage identified malware, search the environment for additional compromised hosts.
    • Implement temporary network rules, procedures, and segmentation to contain the malware.
    • Stop suspicious processes.
    • Immediately block the identified indicators of compromise (IoCs).
    • Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
  • Remove and block malicious artifacts identified during triage.
  • Reimage the host operating system or restore the compromised files to clean versions.
  • Restrict PowerShell usage outside of IT and engineering business units using GPOs, AppLocker, Intune, or similar software.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

References

Related rules

to-top