Detection rules › Elastic
Suspicious Network Module LoadLibrary
Detects attempts to load a Microsoft networking related module from a potentially altered call stack in order to conceal the true source of the call.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Detects attempts to load a Microsoft networking related module from a potentially altered call stack in order to conceal
the true source of the call.
"""
id = "7bfc7234-49c6-4f52-93d6-f9d8ba13903b"
license = "Elastic License v2"
name = "Suspicious Network Module LoadLibrary"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.3"
query = '''
library where dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "C:\\Windows\\System32\\KernelBase.dll!LoadLibrary*") and
process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*" and
not process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|kernelbase.dll*" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info regex~ """C:\\Windows\\System32\\KernelBase.dll!([A-K]|[M-Z]).+""") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "C:\\Windows\\System32\\ntdll.dll!LdrLoadDll*") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "C:\\Windows\\System32\\kernel32.dll!BaseThreadInitThunk*") and
not process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|doclient.dll|rpcrt4.dll|combase.dll|rpcrt4.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|doclient.dll|dosvc.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll")
'''
min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[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: library
library where dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info like "C:\\Windows\\System32\\KernelBase.dll!LoadLibrary*") and
process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*" and
not process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|kernelbase.dll*" and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info regex~ """C:\\Windows\\System32\\KernelBase.dll!([A-K]|[M-Z]).+""") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "C:\\Windows\\System32\\ntdll.dll!LdrLoadDll*") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "C:\\Windows\\System32\\kernel32.dll!BaseThreadInitThunk*") and
not process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|doclient.dll|rpcrt4.dll|combase.dll|rpcrt4.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|doclient.dll|dosvc.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.thread.Ext.call_stack_summary | in | ntdll.dll|kernelbase.dll|doclient.dll|dosvc.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|doclient.dll|rpcrt4.dll|combase.dll|rpcrt4.dll|ntdll.dll|kernel32.dll|ntdll.dll | excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|doclient.dll|dosvc.dll|svchost.exe|sechost.dll|kernel32.dll|ntdll.dll" field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|doclient.dll|rpcrt4.dll|combase.dll|rpcrt4.dll|ntdll.dll|kernel32.dll|ntdll.dll" |
process.thread.Ext.call_stack_summary | wildcard | ntdll.dll|kernelbase.dll|*|kernelbase.dll* | excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"ntdll.dll|kernelbase.dll|*|kernelbase.dll*" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.name | wildcard |
| field:"dll.name" kind:wildcard |
process.thread.Ext.call_stack_summary | wildcard |
| field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"ntdll.dll|kernelbase.dll|*" |