Windows Terminating Lsass Process

 Original Source: [splunk source]
Name:Windows Terminating Lsass Process
id:7ab3c319-a4e7-4211-9e8c-40a049d0dba6
version:16
date:None
author:Teoderick Contreras, Splunk
status:production
type:Anomaly
Description:The following analytic detects a process requesting PROCESS_TERMINATE access to Lsass.exe. It leverages Sysmon EventCode 10 and checks for access masks that combine PROCESS_TERMINATE (0x1).
Data_source:
  • -Sysmon EventID 10
search:`sysmon`
EventCode=10
TargetImage="*\\lsass.exe"

```
PROCESS_TERMINATE is 0x1.
```
| eval g_access_decimal = tonumber(replace(GrantedAccess,"0x",""),16)
| eval PROCESS_TERMINATE = 1
| eval terminate_set = bit_and(g_access_decimal, PROCESS_TERMINATE)
| where terminate_set == PROCESS_TERMINATE

| stats count min(_time) as firstTime
max(_time) as lastTime
BY user_id dest
signature_id signature granted_access Opcode
SourceImage SourceProcessGUID SourceProcessId
TargetImage TargetProcessGUID TargetProcessId
CallTrace vendor_product

| eval CallTrace=split(CallTrace, "|")

| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `windows_terminating_lsass_process_filter`


how_to_implement:This search requires Sysmon Logs and a Sysmon configuration, which includes EventCode 10 for lsass.exe. This search uses an input macro named `sysmon`. We strongly recommend that you specify your environment-specific configurations (index, source, sourcetype, etc.) for Windows Sysmon logs. Replace the macro definition with configurations for your Splunk environment. The search also uses a post-filter macro designed to filter out known false positives.
known_false_positives:No false positives have been identified at this time.
References:
  -https://blog.talosintelligence.com/2022/03/threat-advisory-doublezero.html
drilldown_searches:
 name:'View the detection results for - "$dest$"'
 search:'%original_detection_search% | search dest = "$dest$"'
 earliest_offset:'$info_min_time$'
 latest_offset:'$info_max_time$'
 name:'View risk events for the last 7 days for - "$dest$"'
 search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
 earliest_offset:'7d'
 latest_offset:'0'
analytic_story:['Data Destruction', 'Double Zero Destructor', 'Scattered Lapsus$ Hunters']

asset_type:Endpoint

mitre_attack_id:['T1685']

product:['Splunk Enterprise', 'Splunk Enterprise Security', 'Splunk Cloud']

category:endpoint

security_domain:endpoint

tags:

tests:
 name:'True Positive Test'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/doublezero_wiper/sysmon.log
  source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
  sourcetype: XmlWinEventLog
 test_type:'unit'
manual_test:None