Detection rules › Elastic

Registry Modification from a Potentially Altered Call Stack

Source
github.com/elastic/protections-artifacts

Detects registry modification 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 registry modification from a potentially altered call stack in order to conceal the true source of the call."
id = "2296595e-26d5-4834-8aa1-2602d11de45e"
license = "Elastic License v2"
name = "Registry Modification from a Potentially Altered Call Stack"
os_list = ["windows"]
reference = ["https://www.elastic.co/security-labs/doubling-down-etw-callstacks"]
version = "1.0.2"

query = '''
registry where event.action == "modification" and process.executable != null and registry.value == "CachePrefix" and
 process.thread.Ext.call_stack_summary :
                   ("ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernel32.dll*",
                    "ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernelbase.dll*") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\Windows\\System32\\wininet.dll!HttpSendRequest*") and 
 not (process.code_signature.trusted == true and 
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\System32\\ntdll.dll!LdrGetDllPath*") and 
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\System32\\KernelBase.dll!GetProcessTimes*"))
'''

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

[[optional_actions]]
action = "rollback"
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: registry

registry where event.action == "modification" and process.executable != null and registry.value == "CachePrefix" and
 process.thread.Ext.call_stack_summary :
                   ("ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernel32.dll*",
                    "ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernelbase.dll*") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "?:\\Windows\\System32\\wininet.dll!HttpSendRequest*") and 
 not (process.code_signature.trusted == true and 
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\System32\\ntdll.dll!LdrGetDllPath*") and 
      _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "C:\\Windows\\System32\\KernelBase.dll!GetProcessTimes*"))

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernel32.dll*
  • ntdll.dll|kernelbase.dll|wininet.dll|ntdll.dll|kernelbase.dll|wininet.dll|kernelbase.dll*
field:"process.thread.Ext.call_stack_summary" kind:wildcard
registry.valueeq
  • CachePrefix corpus 3 (elastic 3)
field:"registry_value_name" kind:eq value:"CachePrefix"