Detection rules › Elastic
Library Loaded via a Worker Callback
Identifies the load of a library indirectly via a callback function. This may be the result of an evasion attempt to hide the origin of the API call from the call stack such as unbacked memory region.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies the load of a library indirectly via a callback function. This may be the result of an evasion attempt to
hide the origin of the API call from the call stack such as unbacked memory region.
"""
id = "b2beb283-0a5c-4a7c-bd97-54b920392897"
license = "Elastic License v2"
name = "Library Loaded via a Worker Callback"
os_list = ["windows"]
reference = [
"https://www.elastic.co/security-labs/doubling-down-etw-callstacks",
"https://0xdarkvortex.dev/hiding-in-plainsight/",
]
version = "1.0.4"
query = '''
library where dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and process.name != null and
process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|ntdll.dll|kernel32.dll|ntdll.dll" and
not process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|*|ntdll.dll|kernel32.dll|ntdll.dll" and
not stringcontains~(process.thread.Ext.call_stack_summary, process.name) and
not (user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
process.executable : ("C:\\Windows\\System32\\svchost.exe",
"C:\\Windows\\System32\\lsass.exe",
"C:\\Windows\\System32\\LogonUI.exe")) and
not process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|smartcardcredentialprovider.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|hostshellextension.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|wsmsvc.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|ws2_32.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|das.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|lucanet.dll|ntdll.dll|kernel32.dll|ntdll.dll") and
not (process.code_signature.trusted == true and process.code_signature.subject_name : ("SentinelOne Inc.", "Sentinelone, Inc.", "Sentinel Labs, Inc.", "Bitglass, LLC", "Adobe Inc.")) and
not (process.code_signature.trusted == true and process.code_signature.subject_name == "LucaNet AG" and process.executable : "C:\\Program Files\\LucaNet\\Youniverse\\.bin\\LucaNet.exe") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : ("*ntdll.dll!TppWorkpExecuteCallback*", "*ntdll.dll!TppWorkerThread*", "*ntdll.dll!RtlClearThreadWorkOnBehalfTicket*"))
'''
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 dll.name : ("ws2_32.dll", "winhttp.dll", "wininet.dll") and process.name != null and
process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|ntdll.dll|kernel32.dll|ntdll.dll" and
not process.thread.Ext.call_stack_summary like "ntdll.dll|kernelbase.dll|*|*|ntdll.dll|kernel32.dll|ntdll.dll" and
not stringcontains~(process.thread.Ext.call_stack_summary, process.name) and
not (user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
process.executable : ("C:\\Windows\\System32\\svchost.exe",
"C:\\Windows\\System32\\lsass.exe",
"C:\\Windows\\System32\\LogonUI.exe")) and
not process.thread.Ext.call_stack_summary in ("ntdll.dll|kernelbase.dll|smartcardcredentialprovider.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|hostshellextension.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|wsmsvc.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|ws2_32.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|das.dll|ntdll.dll|kernel32.dll|ntdll.dll",
"ntdll.dll|kernelbase.dll|lucanet.dll|ntdll.dll|kernel32.dll|ntdll.dll") and
not (process.code_signature.trusted == true and process.code_signature.subject_name : ("SentinelOne Inc.", "Sentinelone, Inc.", "Sentinel Labs, Inc.", "Bitglass, LLC", "Adobe Inc.")) and
not (process.code_signature.trusted == true and process.code_signature.subject_name == "LucaNet AG" and process.executable : "C:\\Program Files\\LucaNet\\Youniverse\\.bin\\LucaNet.exe") and
_arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : ("*ntdll.dll!TppWorkpExecuteCallback*", "*ntdll.dll!TppWorkerThread*", "*ntdll.dll!RtlClearThreadWorkOnBehalfTicket*"))
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | eq | LucaNet AG | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"LucaNet AG" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | eq | C:\Program Files\LucaNet\Youniverse\.bin\LucaNet.exe | excludes:process.executable field:"process.executable" value:"C:\Program Files\LucaNet\Youniverse\.bin\LucaNet.exe" |
process.code_signature.subject_name | eq | SentinelOne Inc., Sentinelone, Inc., Sentinel Labs, Inc., Bitglass, LLC, Adobe Inc. | excludes:process.code_signature.subject_name |
process.executable | eq | C:\Windows\System32\svchost.exe, C:\Windows\System32\lsass.exe, C:\Windows\System32\LogonUI.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\System32\svchost.exe" field:"process.executable" value:"C:\Windows\System32\lsass.exe" field:"process.executable" value:"C:\Windows\System32\LogonUI.exe" |
user.id | in | S-1-5-18, S-1-5-19, S-1-5-20 | excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20" |
process.thread.Ext.call_stack_summary | contains | process.name | excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"process.name" |
process.thread.Ext.call_stack_summary | in | ntdll.dll|kernelbase.dll|das.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|hostshellextension.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|lucanet.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|smartcardcredentialprovider.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|ws2_32.dll|ntdll.dll|kernel32.dll|ntdll.dll, ntdll.dll|kernelbase.dll|wsmsvc.dll|ntdll.dll|kernel32.dll|ntdll.dll | excludes:process.thread.Ext.call_stack_summary |
process.thread.Ext.call_stack_summary | wildcard | ntdll.dll|kernelbase.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|*|*|ntdll.dll|kernel32.dll|ntdll.dll" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dll.name | wildcard |
| field:"dll.name" kind:wildcard |
process.name | is_not_null | field:"process_name" kind:is_not_null | |
process.thread.Ext.call_stack_summary | wildcard |
| field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"ntdll.dll|kernelbase.dll|*|ntdll.dll|kernel32.dll|ntdll.dll" |