Detection rules › Elastic

Potential Shellcode Injection by a Browser Process

Source
github.com/elastic/protections-artifacts

Identifies suspicious memory allocations by a browser process. This may indicate an attempt to exploit a vulnerability for initial access and execution.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies suspicious memory allocations by a browser process. This may indicate an attempt to exploit a vulnerability
for initial access and execution.
"""
id = "d5fb2972-bf70-42a8-ad42-4db62491f2ad"
license = "Elastic License v2"
name = "Potential Shellcode Injection by a Browser Process"
os_list = ["windows"]
version = "1.0.3"

query = '''
api where process.Ext.api.name == "VirtualProtect" and
 process.Ext.api.name == "VirtualAlloc" and process.Ext.api.parameters.size >= 10000 and
 process.Ext.api.summary like "*COMMIT*" and process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
 process.name in~ ("iexplore.exe", "chrome.exe", "msedge.exe") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.protection_provenance like ("Kernel", "Kernel|*")) and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Kernel|*", "chrome.exe", "chrome.exe|*",  "msedge.exe",  "msedge.exe|*") and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                  ("1a9ca25a7d7f11f6be10dee684505ee4b3340a0d3cbc22d959e69322e7cf0848",
                                   "d09f0ed19b426b1f78de9b736f6c1f667b3e689c1927e6a3466423ddf88fd4a4") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("chrome.exe", "chrome.exe|*", "msedge.exe", "msedge.exe|*") and
 not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true)
'''

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 = "T1189"
name = "Drive-by Compromise"
reference = "https://attack.mitre.org/techniques/T1189/"


[threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"


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

api where process.Ext.api.name == "VirtualProtect" and
 process.Ext.api.name == "VirtualAlloc" and process.Ext.api.parameters.size >= 10000 and
 process.Ext.api.summary like "*COMMIT*" and process.thread.Ext.call_stack_final_user_module.name == "Unbacked" and
 process.name in~ ("iexplore.exe", "chrome.exe", "msedge.exe") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.protection_provenance like ("Kernel", "Kernel|*")) and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("Kernel", "Kernel|*", "chrome.exe", "chrome.exe|*",  "msedge.exe",  "msedge.exe|*") and
 not process.thread.Ext.call_stack_final_user_module.hash.sha256 in
                                  ("1a9ca25a7d7f11f6be10dee684505ee4b3340a0d3cbc22d959e69322e7cf0848",
                                   "d09f0ed19b426b1f78de9b736f6c1f667b3e689c1927e6a3466423ddf88fd4a4") and
 not process.thread.Ext.call_stack_final_user_module.protection_provenance like ("chrome.exe", "chrome.exe|*", "msedge.exe", "msedge.exe|*") 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.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.thread.Ext.call_stack_final_user_module.hash.sha256in1a9ca25a7d7f11f6be10dee684505ee4b3340a0d3cbc22d959e69322e7cf0848, d09f0ed19b426b1f78de9b736f6c1f667b3e689c1927e6a3466423ddf88fd4a4excludes:process.thread.Ext.call_stack_final_user_module.hash.sha256 field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" value:"1a9ca25a7d7f11f6be10dee684505ee4b3340a0d3cbc22d959e69322e7cf0848" field:"process.thread.Ext.call_stack_final_user_module.hash.sha256" value:"d09f0ed19b426b1f78de9b736f6c1f667b3e689c1927e6a3466423ddf88fd4a4"
process.thread.Ext.call_stack_final_user_module.protection_provenancewildcardKernel, Kernel|*, chrome.exe, chrome.exe|*, msedge.exe, msedge.exe|*excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance
process.thread.Ext.call_stack_final_user_module.protection_provenancewildcardchrome.exe, chrome.exe|*, msedge.exe, msedge.exe|*excludes:process.thread.Ext.call_stack_final_user_module.protection_provenance

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
process.Ext.api.nameeq
  • VirtualAlloc corpus 4 (elastic 4)
  • VirtualProtect corpus 19 (elastic 19)
field:"process.Ext.api.name" kind:eq
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
  • *COMMIT*
field:"process.Ext.api.summary" kind:wildcard value:"*COMMIT*"
process.namein
  • chrome.exe corpus 16 (elastic 14, splunk 2)
  • iexplore.exe corpus 6 (elastic 5, splunk 1)
  • msedge.exe corpus 12 (elastic 12)
field:"process_name" kind:in
process.thread.Ext.call_stack_final_user_module.nameeq
  • Unbacked corpus 21 (elastic 21)
field:"process.thread.Ext.call_stack_final_user_module.name" kind:eq value:"Unbacked"