Detection rules › Elastic

Suspicious Network Module LoadLibrary

Source
github.com/elastic/protections-artifacts

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

TacticTechniques
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.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stack_summaryinntdll.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.dllexcludes: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_summarywildcardntdll.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.

FieldKindValuesSearch
dll.namewildcard
  • winhttp.dll corpus 16 (elastic 16)
  • wininet.dll corpus 18 (elastic 18)
  • ws2_32.dll corpus 20 (elastic 20)
field:"dll.name" kind:wildcard
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|kernelbase.dll|* corpus 4 (elastic 4)
field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"ntdll.dll|kernelbase.dll|*"