LSASS Memory Dump Handle Access

Identifies handle requests for the Local Security Authority Subsystem Service (LSASS) object access with specific access masks that many tools with a capability to dump memory to disk use (0x1fffff, 0x1010, 0x120089). This rule is tool agnostic as it has been validated against a host of various LSASS dump tools such as SharpDump, Procdump, Mimikatz, Comsvcs etc. It detects this behavior at a low level and does not depend on a specific tool or dump file name.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/02/16"
  3integration = ["system", "windows"]
  4maturity = "production"
  5updated_date = "2026/09/18"
  6[transform]
  7[[transform.osquery]]
  8label = "Osquery - Retrieve DNS Cache"
  9query = "SELECT * FROM dns_cache"
 10
 11[[transform.osquery]]
 12label = "Osquery - Retrieve All Services"
 13query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
 14
 15[[transform.osquery]]
 16label = "Osquery - Retrieve Services Running on User Accounts"
 17query = """
 18SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
 19NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
 20user_account == null)
 21"""
 22
 23[[transform.osquery]]
 24label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
 25query = """
 26SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
 27services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
 28authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
 29"""
 30
 31
 32[rule]
 33author = ["Elastic"]
 34description = """
 35Identifies handle requests for the Local Security Authority Subsystem Service (LSASS) object access with specific access
 36masks that many tools with a capability to dump memory to disk use (0x1fffff, 0x1010, 0x120089). This rule is tool
 37agnostic as it has been validated against a host of various LSASS dump tools such as SharpDump, Procdump, Mimikatz,
 38Comsvcs etc. It detects this behavior at a low level and does not depend on a specific tool or dump file name.
 39"""
 40from = "now-9m"
 41index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
 42language = "kuery"
 43license = "Elastic License v2"
 44name = "LSASS Memory Dump Handle Access"
 45note = """## Triage and analysis
 46
 47### Investigating LSASS Memory Dump Handle Access
 48
 49Local Security Authority Server Service (LSASS) is a process in Microsoft Windows operating systems that is responsible for enforcing security policy on the system. It verifies users logging on to a Windows computer or server, handles password changes, and creates access tokens.
 50
 51Adversaries may attempt to access credential material stored in LSASS process memory. After a user logs on, the system generates and stores a variety of credential materials in LSASS process memory. This is meant to facilitate single sign-on (SSO) ensuring a user isn’t prompted each time resource access is requested. These credential materials can be harvested by an adversary using administrative user or SYSTEM privileges to conduct lateral movement using [alternate authentication material](https://attack.mitre.org/techniques/T1550/).
 52
 53> **Note**:
 54> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
 55
 56#### Possible investigation steps
 57
 58- Investigate the process 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.
 59- Investigate other alerts associated with the user/host during the past 48 hours.
 60- Examine the host for derived artifacts that indicate suspicious activities:
 61  - Analyze the process executable using a private sandboxed analysis system.
 62  - Observe and collect information about the following activities in both the sandbox and the alert subject host:
 63    - Attempts to contact external domains and addresses.
 64      - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
 65      - Examine the DNS cache for suspicious or anomalous entries.
 66        - $osquery_0
 67    - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
 68    - Examine the host services for suspicious or anomalous entries.
 69      - $osquery_1
 70      - $osquery_2
 71      - $osquery_3
 72  - Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
 73- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification.
 74
 75
 76### False positive analysis
 77
 78- There should be very few or no false positives for this rule. If this activity is expected or noisy in your environment, consider adding exceptions — preferably with a combination of user and command line conditions.
 79- If the process is related to antivirus or endpoint detection and response solutions, validate that it is installed on the correct path and signed with the company's valid digital signature.
 80
 81### Response and remediation
 82
 83- Initiate the incident response process based on the outcome of the triage.
 84- Isolate the involved host to prevent further post-compromise behavior.
 85- Scope compromised credentials and disable the accounts.
 86- If the triage identified malware, search the environment for additional compromised hosts.
 87  - Implement temporary network rules, procedures, and segmentation to contain the malware.
 88  - Stop suspicious processes.
 89  - Immediately block the identified indicators of compromise (IoCs).
 90  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
 91- Remove and block malicious artifacts identified during triage.
 92- 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.
 93- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 94- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 95- 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).
 96"""
 97references = [
 98    "https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4656",
 99    "https://twitter.com/jsecurity101/status/1227987828534956033?s=20",
100    "https://attack.mitre.org/techniques/T1003/001/",
101    "https://threathunterplaybook.com/notebooks/windows/06_credential_access/WIN-170105221010.html",
102    "http://findingbad.blogspot.com/2017/",
103    "https://www.elastic.co/security-labs/detect-credential-access",
104]
105risk_score = 47
106rule_id = "208dbe77-01ed-4954-8d44-1e5751cb20de"
107setup = """## Setup
108
109Audit Handle Manipulation must be enabled to generate the events used by this rule.
110Setup instructions: https://ela.st/audit-handle-manipulation
111"""
112severity = "medium"
113tags = [
114    "Domain: Endpoint",
115    "OS: Windows",
116    "Use Case: Threat Detection",
117    "Tactic: Credential Access",
118    "Resources: Investigation Guide",
119    "Data Source: Windows Security Event Logs",
120    "Noise: Medium",
121    "Performance: Normal",
122    "Rule Type: New Terms",
123    "Platform: Windows",
124    "Resources: Osquery",
125]
126timestamp_override = "event.ingested"
127type = "new_terms"
128
129query = '''
130host.os.type:"windows" and event.code:"4656" and
131  (
132    winlog.event_data.AccessMask : ("0x1fffff" or "0x1010" or "0x120089" or "0x1F3FFF") or
133    winlog.event_data.AccessMaskDescription : ("READ_CONTROL" or "Read from process memory")
134  ) and
135  winlog.event_data.ObjectType : "Process" and 
136  winlog.event_data.ObjectName : *\\Windows\\System32\\lsass.exe and
137  not winlog.event_data.ProcessName : (
138      "C:\Windows\System32\wbem\WmiPrvSE.exe" or
139      "C:\Windows\SysWOW64\wbem\WmiPrvSE.exe" or
140      "C:\Windows\System32\dllhost.exe" or
141      "C:\Windows\System32\svchost.exe" or
142      "C:\Windows\System32\msiexec.exe" or
143      "C:\Windows\explorer.exe" or 
144      "C:\\Windows\\Sysmon64.exe" or 
145      "C:\\Windows\\BTPass\\x64\\BTPassSvc.exe" or 
146      "C:\\Windows\\Sysmon.exe" or 
147      "C:\\Windows\\System32\\RtkAudUService64.exe" or 
148      "C:\\Windows\\System32\\RtkAudUService64.exe" or 
149       C\:\\Windows\\System32\\DriverStore\\FileRepository\\fn.inf_amd64_*\\driver\\tphkload.exe
150  )
151'''
152
153[[rule.filters]]
154[rule.filters.meta]
155negate = true
156[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
157case_insensitive = true
158value = "C:\\\\Program Files (x86)\\\\*.exe"
159
160[[rule.filters]]
161[rule.filters.meta]
162negate = true
163[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
164case_insensitive = true
165value = "C:\\\\Program Files\\\\*.exe"
166
167[[rule.filters]]
168[rule.filters.meta]
169negate = true
170[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
171case_insensitive = true
172value = "?:\\\\ProgramData\\\\Microsoft\\\\Windows Defender\\\\*.exe"
173
174[[rule.threat]]
175framework = "MITRE ATT&CK"
176[[rule.threat.technique]]
177id = "T1003"
178name = "OS Credential Dumping"
179reference = "https://attack.mitre.org/techniques/T1003/"
180[[rule.threat.technique.subtechnique]]
181id = "T1003.001"
182name = "LSASS Memory"
183reference = "https://attack.mitre.org/techniques/T1003/001/"
184
185
186
187[rule.threat.tactic]
188id = "TA0006"
189name = "Credential Access"
190reference = "https://attack.mitre.org/tactics/TA0006/"
191
192
193[rule.new_terms]
194field = "new_terms_fields"
195value = ["winlog.event_data.ProcessName", "winlog.event_data.SubjectUserName"]
196[[rule.new_terms.history_window_start]]
197field = "history_window_start"
198value = "now-1d"

Triage and analysis

Investigating LSASS Memory Dump Handle Access

Local Security Authority Server Service (LSASS) is a process in Microsoft Windows operating systems that is responsible for enforcing security policy on the system. It verifies users logging on to a Windows computer or server, handles password changes, and creates access tokens.

Adversaries may attempt to access credential material stored in LSASS process memory. After a user logs on, the system generates and stores a variety of credential materials in LSASS process memory. This is meant to facilitate single sign-on (SSO) ensuring a user isn’t prompted each time resource access is requested. These credential materials can be harvested by an adversary using administrative user or SYSTEM privileges to conduct lateral movement using alternate authentication material.

Note: This investigation guide uses the Osquery Markdown Plugin introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.

Possible investigation steps

  • Investigate the process 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 other alerts associated with the user/host during the past 48 hours.
  • Examine the host for derived artifacts that indicate suspicious activities:
    • Analyze the process executable using a private sandboxed analysis system.
    • Observe and collect information about the following activities in both the sandbox and the alert subject host:
      • Attempts to contact external domains and addresses.
        • Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' process.entity_id.
        • Examine the DNS cache for suspicious or anomalous entries.
          • $osquery_0
      • Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
      • Examine the host services for suspicious or anomalous entries.
        • $osquery_1
        • $osquery_2
        • $osquery_3
    • Retrieve the files' SHA-256 hash values using the PowerShell Get-FileHash cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
  • Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification.

False positive analysis

  • There should be very few or no false positives for this rule. If this activity is expected or noisy in your environment, consider adding exceptions — preferably with a combination of user and command line conditions.
  • If the process is related to antivirus or endpoint detection and response solutions, validate that it is installed on the correct path and signed with the company's valid digital signature.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved host to prevent further post-compromise behavior.
  • Scope compromised credentials and disable the accounts.
  • 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.
  • 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