Detection rules › Elastic

Potential Evasion via Inline Execute Assembly

Time window
5s
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies attempts to load the Microsoft Common Language Runtime from a suspicious memory followed by an egress network connection.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

[rule]
description = """
Identifies attempts to load the Microsoft Common Language Runtime from a suspicious memory followed by an egress network
connection.
"""
id = "ad65d579-b904-48e0-9408-f4c4e8e685a0"
license = "Elastic License v2"
name = "Potential Evasion via Inline Execute Assembly"
os_list = ["windows"]
reference = ["https://github.com/anthemtotheego/InlineExecute-Assembly"]
version = "1.0.22"

query = '''
sequence by process.entity_id with maxspan=5s 
 [library where dll.name : "mscorwks.dll" and 
  process.thread.Ext.call_stack_summary : 
                   ("ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked",
                    "ntdll.dll|kernelbase.dll|mscoreei.dll|mscoree.dll|Unbacked",
                    "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked") and
  _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*mscoreei.dll!CreateInterface*") and 
  _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "Unbacked*" and $entry.callsite_trailing_bytes : "?*") and 
  not (process.executable : "?:\\Program Files\\Dell\\DTP\\DiagnosticsSubAgent\\Dell.TechHub.Diagnostics.SubAgent.exe" and
       process.code_signature.trusted == true and process.code_signature.subject_name : "Dell Inc") and
  not (process.code_signature.trusted == true and 
       process.code_signature.subject_name : ("Azul Systems, Inc.", "JetBrains s.r.o.", "Milsoft Utility Solutions, Inc.")) and 
  not (process.executable : "C:\\ManageEngine\\ADManager Plus\\jre\\bin\\java.exe" and 
      process.code_signature.subject_name : "Oracle America, Inc." and process.code_signature.trusted == true) and 
  not (process.executable : "?:\\Program Files*\\Amazon Corretto\\jdk*\\bin\\java.exe" and 
       process.code_signature.subject_name : "Amazon.com Services LLC" and process.code_signature.trusted == true) and
  not process.executable : ("?:\\Program Files\\Hexagon\\Cipher *\\Cipher.exe",
                            "?:\\Windows\\Microsoft.NET\\Framework64\\*\\dfsvc.exe",
                            "?:\\Program Files (x86)\\XMPie\\Circle Agent\\Service\\XMCircleAgent.exe")
  ]
 [network where network.direction == "egress" and network.transport == "tcp"]
'''

min_endpoint_version = "8.8.0"
optional_actions = []
[[actions]]
action = "kill_process"
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.8.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5s, correlated by process.entity_id.

Stage 1: library

[library where dll.name : "mscorwks.dll" and 
  process.thread.Ext.call_stack_summary : 
                   ("ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked",
                    "ntdll.dll|kernelbase.dll|mscoreei.dll|mscoree.dll|Unbacked",
                    "ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked") and
  _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "*mscoreei.dll!CreateInterface*") and 
  _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info : "Unbacked*" and $entry.callsite_trailing_bytes : "?*") and 
  not (process.executable : "?:\\Program Files\\Dell\\DTP\\DiagnosticsSubAgent\\Dell.TechHub.Diagnostics.SubAgent.exe" and
       process.code_signature.trusted == true and process.code_signature.subject_name : "Dell Inc") and
  not (process.code_signature.trusted == true and 
       process.code_signature.subject_name : ("Azul Systems, Inc.", "JetBrains s.r.o.", "Milsoft Utility Solutions, Inc.")) and 
  not (process.executable : "C:\\ManageEngine\\ADManager Plus\\jre\\bin\\java.exe" and 
      process.code_signature.subject_name : "Oracle America, Inc." and process.code_signature.trusted == true) and 
  not (process.executable : "?:\\Program Files*\\Amazon Corretto\\jdk*\\bin\\java.exe" and 
       process.code_signature.subject_name : "Amazon.com Services LLC" and process.code_signature.trusted == true) and
  not process.executable : ("?:\\Program Files\\Hexagon\\Cipher *\\Cipher.exe",
                            "?:\\Windows\\Microsoft.NET\\Framework64\\*\\dfsvc.exe",
                            "?:\\Program Files (x86)\\XMPie\\Circle Agent\\Service\\XMCircleAgent.exe")
  ]

Stage 2: network

[network where network.direction == "egress" and network.transport == "tcp"]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqAmazon.com Services LLCexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Amazon.com Services LLC"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Program Files*\Amazon Corretto\jdk*\bin\java.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files*\Amazon Corretto\jdk*\bin\java.exe"
process.code_signature.subject_nameeqAzul Systems, Inc., JetBrains s.r.o., Milsoft Utility Solutions, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Azul Systems, Inc." field:"process.code_signature.subject_name" value:"JetBrains s.r.o." field:"process.code_signature.subject_name" value:"Milsoft Utility Solutions, Inc."
process.code_signature.subject_nameeqDell Incexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Dell Inc"
process.executableeq?:\Program Files\Dell\DTP\DiagnosticsSubAgent\Dell.TechHub.Diagnostics.SubAgent.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\Dell\DTP\DiagnosticsSubAgent\Dell.TechHub.Diagnostics.SubAgent.exe"
process.code_signature.subject_nameeqOracle America, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Oracle America, Inc."
process.executableeqC:\ManageEngine\ADManager Plus\jre\bin\java.exeexcludes:process.executable field:"process.executable" value:"C:\ManageEngine\ADManager Plus\jre\bin\java.exe"
process.executablewildcard?:\Program Files\Hexagon\Cipher *\Cipher.exe, ?:\Windows\Microsoft.NET\Framework64\*\dfsvc.exe, ?:\Program Files (x86)\XMPie\Circle Agent\Service\XMCircleAgent.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\Hexagon\Cipher *\Cipher.exe" field:"process.executable" value:"?:\Windows\Microsoft.NET\Framework64\*\dfsvc.exe" field:"process.executable" value:"?:\Program Files (x86)\XMPie\Circle Agent\Service\XMCircleAgent.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.namewildcard
  • mscorwks.dll corpus 2 (elastic 2)
field:"dll.name" kind:wildcard value:"mscorwks.dll"
network.directioneq
  • egress corpus 17 (elastic 17)
field:"Initiated" kind:eq value:"egress"
network.transporteq
  • tcp corpus 26 (elastic 25, sigma 1)
field:"Protocol" kind:eq value:"tcp"
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked corpus 2 (elastic 2)
  • ntdll.dll|kernelbase.dll|mscoreei.dll|mscoree.dll|Unbacked
  • ntdll.dll|wow64.dll|wow64cpu.dll|wow64.dll|ntdll.dll|kernelbase.dll|mscoreei.dll|Unbacked corpus 2 (elastic 2)
field:"process.thread.Ext.call_stack_summary" kind:wildcard