Detection rules › Elastic

System Utility Execution from Unbacked Memory

Source
github.com/elastic/protections-artifacts

Identifies execution of common Windows system utilities (reg, schtasks, sc, PowerShell, or cmd) where the parent process is unsigned or untrusted, runs from a user-writable location, and the creating thread call stack ends in unbacked memory. This may indicate process injection or shellcode invoking built-in tools for persistence or defense evasion.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies execution of common Windows system utilities (reg, schtasks, sc, PowerShell, or cmd) where the parent process
is unsigned or untrusted, runs from a user-writable location, and the creating thread call stack ends in unbacked
memory. This may indicate process injection or shellcode invoking built-in tools for persistence or defense evasion.
"""
id = "f4a8c2e1-6b3d-4f9a-8e2c-1d5a7b9e0f43"
license = "Elastic License v2"
name = "System Utility Execution from Unbacked Memory"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
]
version = "1.0.1"

query = '''
process where event.action == "start" and process.name : ("reg.exe", "schtasks.exe", "sc.exe", "powershell.exe", "cmd.exe") and
 (process.parent.code_signature.exists == false or process.parent.code_signature.trusted == false) and
 process.parent.thread.Ext.call_stack_summary in 
                                ("ntdll.dll|Unbacked", 
                                 "ntdll.dll|kernelbase.dll|Unbacked", 
                                 "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked", 
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",  
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked", 
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll") and
 process.parent.executable : ("?:\\Users\\*", "?:\\ProgramData\\*") and 
 not (process.parent.executable : ("?:\\ProgramData\\CentraStage*.exe", "?:\\ProgramData\\NinjaRMMAgent\\*.exe") and 
      process.parent.thread.Ext.call_stack_summary == "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked")
'''

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

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"


[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[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: process

process where event.action == "start" and process.name : ("reg.exe", "schtasks.exe", "sc.exe", "powershell.exe", "cmd.exe") and
 (process.parent.code_signature.exists == false or process.parent.code_signature.trusted == false) and
 process.parent.thread.Ext.call_stack_summary in 
                                ("ntdll.dll|Unbacked", 
                                 "ntdll.dll|kernelbase.dll|Unbacked", 
                                 "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked", 
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked",  
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked", 
                                 "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll") and
 process.parent.executable : ("?:\\Users\\*", "?:\\ProgramData\\*") and 
 not (process.parent.executable : ("?:\\ProgramData\\CentraStage*.exe", "?:\\ProgramData\\NinjaRMMAgent\\*.exe") and 
      process.parent.thread.Ext.call_stack_summary == "ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked")

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.namewildcard
  • cmd.exe corpus 121 (elastic 92, splunk 29)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • reg.exe corpus 27 (elastic 18, splunk 9)
  • sc.exe corpus 32 (elastic 17, splunk 15)
  • schtasks.exe corpus 30 (elastic 19, splunk 11)
field:"process_name" kind:wildcard
process.parent.code_signature.existseq
  • false transforms: boolean corpus 25 (elastic 25)
field:"process.parent.code_signature.exists" kind:eq value:"false"
process.parent.code_signature.trustedeq
  • false transforms: boolean corpus 26 (elastic 26)
field:"process.parent.code_signature.trusted" kind:eq value:"false"
process.parent.executablewildcard
  • ?:\ProgramData\* corpus 2 (elastic 2)
  • ?:\Users\* corpus 2 (elastic 2)
field:"ParentImage" kind:wildcard
process.parent.thread.Ext.call_stack_summaryin
  • ntdll.dll|Unbacked
  • ntdll.dll|kernelbase.dll|Unbacked
  • ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|Unbacked|kernel32.dll|ntdll.dll
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|kernel32.dll|Unbacked
field:"process.parent.thread.Ext.call_stack_summary" kind:in