Detection rules › Elastic
Evasion via Event Tracing for Windows Patching
Identifies attempts to patch Microsoft Event Tracing for Windows via memory modification. This may indicate an attempt to disrupt detection of malicious activity by the Event Tracing facility for Windows.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule body
[rule]
description = """
Identifies attempts to patch Microsoft Event Tracing for Windows via memory modification. This may indicate an attempt
to disrupt detection of malicious activity by the Event Tracing facility for Windows.
"""
id = "3046168a-91cb-4ecd-a061-b75b1df1c107"
license = "Elastic License v2"
name = "Evasion via Event Tracing for Windows Patching"
os_list = ["windows"]
reference = [
"https://blog.xpnsec.com/hiding-your-dotnet-etw/",
"https://www.elastic.co/security-labs/doubling-down-etw-callstacks",
]
version = "1.0.16"
query = '''
api where process.Ext.api.name : "WriteProcessMemory*" and
process.Ext.api.summary : ("*ntdll.dll!Etw*", "*ntdll.dll!NtTrace*") and
process.executable != null and
not process.executable : ("?:\\Windows\\System32\\lsass.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\lsass.exe",
"?:\\Windows\\System32\\csrss.exe") and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != "7d678faf97ffbd27c01161ec6aaf9854226bef44ef70542e973aae004a85ea16" and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher",
"SentinelOne Inc."))
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Stage 1: api
api where process.Ext.api.name : "WriteProcessMemory*" and
process.Ext.api.summary : ("*ntdll.dll!Etw*", "*ntdll.dll!NtTrace*") and
process.executable != null and
not process.executable : ("?:\\Windows\\System32\\lsass.exe",
"\\Device\\HarddiskVolume*\\Windows\\System32\\lsass.exe",
"?:\\Windows\\System32\\csrss.exe") and
process.thread.Ext.call_stack_final_user_module.hash.sha256 != "7d678faf97ffbd27c01161ec6aaf9854226bef44ef70542e973aae004a85ea16" and
not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true and
$entry.subject_name in ("Microsoft Windows Hardware Compatibility Publisher",
"Microsoft Windows Software Compatibility Publisher",
"SentinelOne Inc."))
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack_final_user_module.code_signature | array_any | excludes:process.thread.Ext.call_stack_final_user_module.code_signature | |
process.executable | wildcard | ?:\Windows\System32\lsass.exe, \Device\HarddiskVolume*\Windows\System32\lsass.exe, ?:\Windows\System32\csrss.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\lsass.exe" field:"process.executable" value:"\Device\HarddiskVolume*\Windows\System32\lsass.exe" field:"process.executable" value:"?:\Windows\System32\csrss.exe" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
process.Ext.api.name | wildcard |
| field:"process.Ext.api.name" kind:wildcard value:"WriteProcessMemory*" |
process.Ext.api.summary | wildcard |
| field:"process.Ext.api.summary" kind:wildcard |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.thread.Ext.call_stack_final_user_module.hash.sha256 | ne |
| field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" kind:ne value:"7d678faf97ffbd27c01161ec6aaf9854226bef44ef70542e973aae004a85ea16" |