Detection rules › Elastic
Potential Module Stomping with Network Activity
Identifies modification to the WinInet registry key by a process where the creating thread's stack contains frames pointing to an unusual module.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies modification to the WinInet registry key by a process where the creating thread's stack contains frames
pointing to an unusual module.
"""
id = "c059ead9-d15e-4d13-86ee-ac5d8b9d6c34"
license = "Elastic License v2"
name = "Potential Module Stomping with Network Activity"
os_list = ["windows"]
version = "1.0.5"
query = '''
registry where event.action == "modification" and process.executable != null and registry.value == "CachePrefix" and
registry.path : "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\*" and
/* unusual stacks start module */
process.thread.Ext.call_stack_summary regex """ntdll.dll\|kernelbase.dll\|wininet.dll\|ntdll.dll\|kernelbase.dll\|wininet.dll\|[a-z0-9\_\.\-]+\.dll""" and
_arraysearch(process.thread.Ext.call_stack, $entry, ($entry.callsite_trailing_bytes : "?*" or $entry.protection == "RWX")) and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "?:\\Program Files (x86)\\Steam\\steamapps\\common\\*") and
not (process.executable == "C:\\Program Files\\KeyShot Studio\\bin\\keyshot.exe" and process.code_signature.subject_name == "KeyShot Inc." and process.code_signature.trusted == true)
'''
min_endpoint_version = "8.10.0"
[[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.10.0"
Stages and Predicates
Stage 1: registry
registry where event.action == "modification" and process.executable != null and registry.value == "CachePrefix" and
registry.path : "HKEY_USERS\\*\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\*" and
process.thread.Ext.call_stack_summary regex """ntdll.dll\|kernelbase.dll\|wininet.dll\|ntdll.dll\|kernelbase.dll\|wininet.dll\|[a-z0-9\_\.\-]+\.dll""" and
_arraysearch(process.thread.Ext.call_stack, $entry, ($entry.callsite_trailing_bytes : "?*" or $entry.protection == "RWX")) and
not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "?:\\Program Files (x86)\\Steam\\steamapps\\common\\*") and
not (process.executable == "C:\\Program Files\\KeyShot Studio\\bin\\keyshot.exe" and process.code_signature.subject_name == "KeyShot Inc." and process.code_signature.trusted == true)
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | eq | KeyShot Inc. | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"KeyShot Inc." |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | eq | C:\Program Files\KeyShot Studio\bin\keyshot.exe | excludes:process.executable field:"process.executable" value:"C:\Program Files\KeyShot Studio\bin\keyshot.exe" |
process.thread.Ext.call_stack | array_any | excludes:process.thread.Ext.call_stack |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"modification" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.thread.Ext.call_stack_summary | regex_match |
| field:"process.thread.Ext.call_stack_summary" kind:regex_match value:"ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|[a-z0-9\_.\-]+.dll" |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"HKEY_USERS\*\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\*" |
registry.value | eq |
| field:"registry_value_name" kind:eq value:"CachePrefix" |