Detection rules › Elastic

Image Hollow from Unusual Stack

Source
github.com/elastic/protections-artifacts

Identifies attempt to modify the content of a loaded module and from a suspicious call stack. This may indicate an attempt to inject code using module stomping or DLL hollowing via overwriting the content of a legit DLL with malicious code.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

[rule]
description = """
Identifies attempt to modify the content of a loaded module and from a suspicious call stack. This may indicate an
attempt to inject code using module stomping or DLL hollowing via overwriting the content of a legit DLL with malicious
code.
"""
id = "446e61bf-8370-45df-88ab-7b213ee653db"
license = "Elastic License v2"
name = "Image Hollow from Unusual Stack"
os_list = ["windows"]
version = "1.0.22"

query = '''
api where process.Ext.api.behaviors == "hollow_image" and
  process.Ext.api.name == "VirtualProtect" and
  process.Ext.api.parameters.size >= 10000 and process.executable != null and
  process.thread.Ext.call_stack_summary in
                     ("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") and
  process.Ext.api.metadata.target_address_path like "c:\\windows\\sys?????\\*.dll" and
  process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
  not _arraysearch(process.thread.Ext.call_stack, $entry, 
                   $entry.protection_provenance like ("Kernel*", "tcaddin.dll", "clr.dll", "appvisvsubsystems64.dll", 
                                                  "appvisvsubsystems.dll", "softmon.exe|*", "appventsubsystems32.dll", 
                                                  "appventsubsystems64.dll", "appventsubsystems.dll")) and
  not (process.Ext.api.summary : ("*qipcap64.dll*", "*redemption64*", "*eowp.22.1.94.0.exe*", "*conemuhk64.dll*", "*xalan-c_1_10.dll*", "* av.dll*",
                                 "*crpe32.dll*", "*_*.dll*", "*-*.dll*", "*sqlite?.dll*", "*appprofiler.x64.dll*", "*appprofiler.x86.dll*", "*qmgr.dll*", "*cxll*.llx*", "*.exe*") and
                                  not process.Ext.api.summary : "*ws2_32*") and
  not (process.parent.executable : "?:\\Program Files (x86)\\think-cell\\tcasr.exe" and 
       process.executable : "?:\\Program Files\\Microsoft Office\\root\\Office*\\EXCEL.EXE") and
  not (process.code_signature.subject_name : ("Code Systems Corporation", "Essential Objects, Inc.", "JAM Software GmbH",
                                              "IMSI Design, LLC", "Nuance Communications, Inc.", "Rocket Software, Inc.", 
                                              "Tracker Software Products (Canada) Ltd", "Sage Software, Inc.", "Azul Systems, Inc.",
                                              "Essential Objects, Inc.") and
       process.code_signature.trusted == true) and
  not (process.parent.executable : ("?:\\Program Files (x86)\\Google\\Update\\GoogleUpdate.exe", "?:\\Program Files\\Google\\Update\\GoogleUpdate.exe") and
       process.executable : ("?:\\Program Files (x86)\\Google\\Update\\*\\GoogleCrashHandler*.exe", "?:\\Program Files\\Google\\Update\\*\\GoogleCrashHandler*.exe")) and
  not process.executable :
               ("?:\\Program Files\\*.exe",
                "?:\\Program Files (x86)\\*.exe",
                "?:\\Windows\\System32\\inetsrv\\w3wp.exe", 
                "?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe", 
                "?:\\Windows\\SystemApps\\*.exe", 
                "?:\\Windows\\System32\\taskhostw.exe") and
  not (process.executable : "?:\\Windows\\Sys*\\msiexec.exe" and process.Ext.api.summary : "*msi*.tmp*") and
  not (process.executable : "?:\\Windows\\Sys*\\rundll32.exe" and process.command_line : ("*--no-sandbox*", "*--eoim*")) and
  not (process.executable : "?:\\Windows\\System32\\backgroundTaskHost.exe" and
       process.parent.executable : "?:\\Windows\\System32\\svchost.exe") and
  not process.parent.executable : ("?:\\Program Files (x86)\\Steam\\steam.exe", "?:\\Program Files\\Steam\\steam.exe") and
  not (process.Ext.api.metadata.target_address_name : "cxll27*.llx" and process.parent.executable : "C:\\Program Files (x86)\\Citrix\\HDX\\bin\\WfShell.exe") and
  not (process.Ext.api.metadata.target_address_name == "libcapki.dll" and process.parent.executable : "C:\\Program Files (x86)\\CA\\DSM\\Bin\\*.exe") and
  not process.thread.Ext.call_stack_final_user_module.hash.sha256 in ("2ef1f7e839e332d97e32ee0213c92d0e74536fb3af04b6df1d335e2f101f968e",
   "a20a14118c2f06a1cc502095a1f18b3cb34ad75f1684f7ec26e24a68d4e3114c", "da502d1a77883ab56d110889237ce7f18527a1d78e85078f40d269966059e267",
   "2a2f9dc5f88e4596ade6a57ec2baa8586dbade44e6df9ecb32035cfd1d8bd85d", "c7d833a8fdfac8a79f9f861af7f6f476bb7b36c71c5fa60e668728008b16a43e") and
  not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true)
'''

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

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

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

api where process.Ext.api.behaviors == "hollow_image" and
  process.Ext.api.name == "VirtualProtect" and
  process.Ext.api.parameters.size >= 10000 and process.executable != null and
  process.thread.Ext.call_stack_summary in
                     ("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") and
  process.Ext.api.metadata.target_address_path like "c:\\windows\\sys?????\\*.dll" and
  process.thread.Ext.call_stack_final_user_module.hash.sha256 != null and
  not _arraysearch(process.thread.Ext.call_stack, $entry, 
                   $entry.protection_provenance like ("Kernel*", "tcaddin.dll", "clr.dll", "appvisvsubsystems64.dll", 
                                                  "appvisvsubsystems.dll", "softmon.exe|*", "appventsubsystems32.dll", 
                                                  "appventsubsystems64.dll", "appventsubsystems.dll")) and
  not (process.Ext.api.summary : ("*qipcap64.dll*", "*redemption64*", "*eowp.22.1.94.0.exe*", "*conemuhk64.dll*", "*xalan-c_1_10.dll*", "* av.dll*",
                                 "*crpe32.dll*", "*_*.dll*", "*-*.dll*", "*sqlite?.dll*", "*appprofiler.x64.dll*", "*appprofiler.x86.dll*", "*qmgr.dll*", "*cxll*.llx*", "*.exe*") and
                                  not process.Ext.api.summary : "*ws2_32*") and
  not (process.parent.executable : "?:\\Program Files (x86)\\think-cell\\tcasr.exe" and 
       process.executable : "?:\\Program Files\\Microsoft Office\\root\\Office*\\EXCEL.EXE") and
  not (process.code_signature.subject_name : ("Code Systems Corporation", "Essential Objects, Inc.", "JAM Software GmbH",
                                              "IMSI Design, LLC", "Nuance Communications, Inc.", "Rocket Software, Inc.", 
                                              "Tracker Software Products (Canada) Ltd", "Sage Software, Inc.", "Azul Systems, Inc.",
                                              "Essential Objects, Inc.") and
       process.code_signature.trusted == true) and
  not (process.parent.executable : ("?:\\Program Files (x86)\\Google\\Update\\GoogleUpdate.exe", "?:\\Program Files\\Google\\Update\\GoogleUpdate.exe") and
       process.executable : ("?:\\Program Files (x86)\\Google\\Update\\*\\GoogleCrashHandler*.exe", "?:\\Program Files\\Google\\Update\\*\\GoogleCrashHandler*.exe")) and
  not process.executable :
               ("?:\\Program Files\\*.exe",
                "?:\\Program Files (x86)\\*.exe",
                "?:\\Windows\\System32\\inetsrv\\w3wp.exe", 
                "?:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe", 
                "?:\\Windows\\SystemApps\\*.exe", 
                "?:\\Windows\\System32\\taskhostw.exe") and
  not (process.executable : "?:\\Windows\\Sys*\\msiexec.exe" and process.Ext.api.summary : "*msi*.tmp*") and
  not (process.executable : "?:\\Windows\\Sys*\\rundll32.exe" and process.command_line : ("*--no-sandbox*", "*--eoim*")) and
  not (process.executable : "?:\\Windows\\System32\\backgroundTaskHost.exe" and
       process.parent.executable : "?:\\Windows\\System32\\svchost.exe") and
  not process.parent.executable : ("?:\\Program Files (x86)\\Steam\\steam.exe", "?:\\Program Files\\Steam\\steam.exe") and
  not (process.Ext.api.metadata.target_address_name : "cxll27*.llx" and process.parent.executable : "C:\\Program Files (x86)\\Citrix\\HDX\\bin\\WfShell.exe") and
  not (process.Ext.api.metadata.target_address_name == "libcapki.dll" and process.parent.executable : "C:\\Program Files (x86)\\CA\\DSM\\Bin\\*.exe") and
  not process.thread.Ext.call_stack_final_user_module.hash.sha256 in ("2ef1f7e839e332d97e32ee0213c92d0e74536fb3af04b6df1d335e2f101f968e",
   "a20a14118c2f06a1cc502095a1f18b3cb34ad75f1684f7ec26e24a68d4e3114c", "da502d1a77883ab56d110889237ce7f18527a1d78e85078f40d269966059e267",
   "2a2f9dc5f88e4596ade6a57ec2baa8586dbade44e6df9ecb32035cfd1d8bd85d", "c7d833a8fdfac8a79f9f861af7f6f476bb7b36c71c5fa60e668728008b16a43e") and
  not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true)

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.api.summarymatchws2_32excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"ws2_32"
process.Ext.api.summarywildcard*qipcap64.dll*, *redemption64*, *eowp.22.1.94.0.exe*, *conemuhk64.dll*, *xalan-c_1_10.dll*, * av.dll*, *crpe32.dll*, *_*.dll*, *-*.dll*, *sqlite?.dll*, *appprofiler.x64.dll*, *appprofiler.x86.dll*, *qmgr.dll*, *cxll*.llx*, *.exe*excludes:process.Ext.api.summary
process.Ext.api.metadata.target_address_nameeqlibcapki.dllexcludes:process.Ext.api.metadata.target_address_name field:"process.Ext.api.metadata.target_address_name" value:"libcapki.dll"
process.parent.executablewildcardC:\Program Files (x86)\CA\DSM\Bin\*.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\CA\DSM\Bin\*.exe"
process.Ext.api.metadata.target_address_namewildcardcxll27*.llxexcludes:process.Ext.api.metadata.target_address_name field:"process.Ext.api.metadata.target_address_name" value:"cxll27*.llx"
process.parent.executableeqC:\Program Files (x86)\Citrix\HDX\bin\WfShell.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\Citrix\HDX\bin\WfShell.exe"
process.Ext.api.summarywildcard*msi*.tmp*excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"*msi*.tmp*"
process.executablewildcard?:\Windows\Sys*\msiexec.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\Sys*\msiexec.exe"
process.code_signature.subject_nameeqCode Systems Corporation, Essential Objects, Inc., JAM Software GmbH, IMSI Design, LLC, Nuance Communications, Inc., Rocket Software, Inc., Tracker Software Products (Canada) Ltd, Sage Software, Inc., Azul Systems, Inc., Essential Objects, Inc.excludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.command_linematch--no-sandbox, --eoimexcludes:process.command_line field:"process.command_line" value:"--no-sandbox" field:"process.command_line" value:"--eoim"
process.executablewildcard?:\Windows\Sys*\rundll32.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\Sys*\rundll32.exe"
process.executableeq?:\Windows\System32\backgroundTaskHost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\backgroundTaskHost.exe"
process.parent.executableeq?:\Windows\System32\svchost.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\svchost.exe"
process.executablewildcard?:\Program Files (x86)\Google\Update\*\GoogleCrashHandler*.exe, ?:\Program Files\Google\Update\*\GoogleCrashHandler*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files (x86)\Google\Update\*\GoogleCrashHandler*.exe" field:"process.executable" value:"?:\Program Files\Google\Update\*\GoogleCrashHandler*.exe"
process.parent.executableeq?:\Program Files (x86)\Google\Update\GoogleUpdate.exe, ?:\Program Files\Google\Update\GoogleUpdate.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Google\Update\GoogleUpdate.exe" field:"process.parent.executable" value:"?:\Program Files\Google\Update\GoogleUpdate.exe"
process.executablewildcard?:\Program Files\Microsoft Office\root\Office*\EXCEL.EXEexcludes:process.executable field:"process.executable" value:"?:\Program Files\Microsoft Office\root\Office*\EXCEL.EXE"
process.parent.executableeq?:\Program Files (x86)\think-cell\tcasr.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\think-cell\tcasr.exe"
process.thread.Ext.call_stackarray_any(no value, null check)excludes:process.thread.Ext.call_stack
process.thread.Ext.call_stack_final_user_module.code_signaturearray_any(no value, null check)excludes:process.thread.Ext.call_stack_final_user_module.code_signature
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\inetsrv\w3wp.exe, ?:\Windows\SysWOW64\inetsrv\w3wp.exe, ?:\Windows\SystemApps\*.exe, ?:\Windows\System32\taskhostw.exeexcludes:process.executable
process.parent.executableeq?:\Program Files (x86)\Steam\steam.exe, ?:\Program Files\Steam\steam.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Steam\steam.exe" field:"process.parent.executable" value:"?:\Program Files\Steam\steam.exe"
process.thread.Ext.call_stack_final_user_module.hash.sha256in2a2f9dc5f88e4596ade6a57ec2baa8586dbade44e6df9ecb32035cfd1d8bd85d, 2ef1f7e839e332d97e32ee0213c92d0e74536fb3af04b6df1d335e2f101f968e, a20a14118c2f06a1cc502095a1f18b3cb34ad75f1684f7ec26e24a68d4e3114c, c7d833a8fdfac8a79f9f861af7f6f476bb7b36c71c5fa60e668728008b16a43e, da502d1a77883ab56d110889237ce7f18527a1d78e85078f40d269966059e267excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.behaviorseq
  • hollow_image corpus 3 (elastic 3)
field:"process.Ext.api.behaviors" kind:eq value:"hollow_image"
process.Ext.api.metadata.target_address_pathwildcard
  • c:\windows\sys?????\*.dll
field:"process.Ext.api.metadata.target_address_path" kind:wildcard value:"c:\windows\sys?????\*.dll"
process.Ext.api.nameeq
  • VirtualProtect corpus 19 (elastic 19)
field:"process.Ext.api.name" kind:eq value:"VirtualProtect"
process.Ext.api.parameters.sizege
  • 10000 transforms: number corpus 11 (elastic 11)
field:"process.Ext.api.parameters.size" kind:ge value:"10000"
process.Ext.api.summarywildcard
  • *ws2_32*
field:"process.Ext.api.summary" kind:wildcard value:"*ws2_32*"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
process.thread.Ext.call_stack_final_user_module.hash.sha256is_not_null
  • (no value, null check)
field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" kind:is_not_null
process.thread.Ext.call_stack_summaryin
  • ntdll.dll|kernelbase.dll|Unbacked corpus 3 (elastic 3)
  • 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
field:"process.thread.Ext.call_stack_summary" kind:in