Detection rules › Elastic
Potential Image Load via Transactional NTFS
Identifies attempts to load a library from a potentially transacted file. This is a technique that exploits Transactional NTFS to execute arbitrary code in the address space of a separate running process, without committing the code to disk.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies attempts to load a library from a potentially transacted file. This is a technique that exploits
Transactional NTFS to execute arbitrary code in the address space of a separate running process, without committing the
code to disk.
"""
id = "edc23204-fd97-4c0f-8a2a-bb769370a7e3"
license = "Elastic License v2"
name = "Potential Image Load via Transactional NTFS"
os_list = ["windows"]
reference = ["https://www.elastic.co/blog/process-ghosting-a-new-executable-image-tampering-attack"]
version = "1.0.5"
query = '''
sequence with maxspan=1m
[library where event.action == "load" and process.pid != 4 and
dll.Ext.defense_evasions : "Process Tampering: Image is writable" and
dll.Ext.defense_evasions : "Process Tampering: Image has been accessed before mapping"] by process.entity_id as event0
[api where
process.Ext.api.name in ("SetThreadContext", "Wow64SetThreadContext") and
process.executable != null and process.Ext.api.behaviors == "cross-process" and
stringcontains~(process.Ext.api.summary, event0.dll.name) and
process.thread.Ext.call_stack_final_user_module.name != null and
process.thread.Ext.call_stack_final_user_module.name != "Kernel"] by Target.process.entity_id
'''
min_endpoint_version = "8.12.0"
[[actions]]
action = "kill_process"
field = "Target.process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.12.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by Target.process.entity_id, process.entity_id.
Stage 1: library
[library where event.action == "load" and process.pid != 4 and
dll.Ext.defense_evasions : "Process Tampering: Image is writable" and
dll.Ext.defense_evasions : "Process Tampering: Image has been accessed before mapping"] by process.entity_id as event0
Stage 2: api
[api where
process.Ext.api.name in ("SetThreadContext", "Wow64SetThreadContext") and
process.executable != null and process.Ext.api.behaviors == "cross-process" and
stringcontains~(process.Ext.api.summary, event0.dll.name) and
process.thread.Ext.call_stack_final_user_module.name != null and
process.thread.Ext.call_stack_final_user_module.name != "Kernel"] by Target.process.entity_id
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.Ext.defense_evasions | wildcard |
| field:"dll.Ext.defense_evasions" kind:wildcard |
event.action | eq |
| field:"EventType" kind:eq value:"load" |
process.Ext.api.behaviors | eq |
| field:"process.Ext.api.behaviors" kind:eq value:"cross-process" |
process.Ext.api.name | in |
| field:"process.Ext.api.name" kind:in |
process.Ext.api.summary | contains |
| field:"process.Ext.api.summary" kind:contains value:"event0.dll.name" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |
process.thread.Ext.call_stack_final_user_module.name | is_not_null | field:"process.thread.Ext.call_stack_final_user_module.name" kind:is_not_null | |
process.thread.Ext.call_stack_final_user_module.name | ne |
| field:"process.thread.Ext.call_stack_final_user_module.name" kind:ne value:"Kernel" |