Detection rules › Elastic

DLL Loaded via a CallBack Function

Source
github.com/elastic/protections-artifacts

Identifies attempts to load a DLL indirectly using thread pool callback functions. This may be the result of an evasion attempt to obscure the call origin.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

[rule]
description = """
Identifies attempts to load a DLL indirectly using thread pool callback functions. This may be the result of an evasion
attempt to obscure the call origin.
"""
id = "716a3414-52cc-4165-97af-ec713dfac674"
license = "Elastic License v2"
name = "DLL Loaded via a CallBack Function"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.1"

query = '''
library where
   process.thread.Ext.call_stack_summary == "ntdll.dll|kernel32.dll|ntdll.dll" and
   _arraysearch(process.thread.Ext.call_stack, $entry,
                $entry.symbol_info : ("?:\\Windows\\Sys*\\ntdll.dll!TpReleaseCleanupGroupMembers*",
                                      "?:\\Windows\\Sys*\\ntdll.dll!RtlDeregisterWaitEx*",
                                      "?:\\Windows\\Sys*\\ntdll.dll!TppWorkpExecuteCallback*",
                                      "?:\\Windows\\Sys*\\ntdll.dll!TppWorkerThread*")) and
   _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "?:\\Windows\\Sys*\\ntdll.dll!LdrLoadDll*")
'''

min_endpoint_version = "8.10.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[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: library

library where
   process.thread.Ext.call_stack_summary == "ntdll.dll|kernel32.dll|ntdll.dll" and
   _arraysearch(process.thread.Ext.call_stack, $entry,
                $entry.symbol_info : ("?:\\Windows\\Sys*\\ntdll.dll!TpReleaseCleanupGroupMembers*",
                                      "?:\\Windows\\Sys*\\ntdll.dll!RtlDeregisterWaitEx*",
                                      "?:\\Windows\\Sys*\\ntdll.dll!TppWorkpExecuteCallback*",
                                      "?:\\Windows\\Sys*\\ntdll.dll!TppWorkerThread*")) and
   _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "?:\\Windows\\Sys*\\ntdll.dll!LdrLoadDll*")

Indicators

These rows show field, operator, and value matches.