Detection rules › Elastic

Potential Browser Exploit via Fake RPC Messages

Source
github.com/elastic/protections-artifacts

Identifies attempt to call memory manipulation APIs or load a library where call stack is pointing to the RPC function NdrServerCall, this may indicate an attempt to exploit a vulnerability using fake RPC messages to bypass CFG mitigation. A known example of vulnerability using this primitive is CVE-2021-26411.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies attempt to call memory manipulation APIs or load a library where call stack is pointing to the RPC function
NdrServerCall, this may indicate an attempt to exploit a vulnerability using fake RPC messages to bypass CFG mitigation.
A known example of vulnerability using this primitive is CVE-2021-26411.
"""
id = "e0114670-7598-4f1a-90ce-157ade6932b9"
license = "Elastic License v2"
name = "Potential Browser Exploit via Fake RPC Messages"
os_list = ["windows"]
reference = [
    "https://iamelli0t.github.io/2021/04/10/RPC-Bypass-CFG.html",
    "https://googleprojectzero.github.io/0days-in-the-wild//0day-RCAs/2021/CVE-2021-26411.html",
]
version = "1.0.15"

query = '''
any where event.category in ("api", "library") and
 process.name in~ ("chrome.exe", "msedge.exe", "iexplore.exe", "brave.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe",
                 "opera.exe", "seamonkey.exe", "safari.exe", "waterfox.exe") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "*NdrServerCall2*") and 
 not process.Ext.api.summary :  ("VirtualProtect( koaxoj_?.dll,*)", "WriteProcessMemory( onedrive*") and 
 not dll.code_signature.trusted == true and 
 not dll.path : ("?:\\Windows\\System32\\jscript9.dll",
                 "?:\\Windows\\System32\\vaultcli.dll",
                 "?:\\Windows\\SysWOW64\\jscript9.dll",
                 "?:\\Windows\\SysWOW64\\vaultcli.dll",
                 "?:\\Windows\\System32\\wbem\\fastprox.dll") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: ("?:\\windows\\system32\\rpcrt4.dll!RpcBindingFromStringBindingW*", "c:\\windows\\system32\\rpcrt4.dll!I_RpcExceptionFilter+*"))
'''

min_endpoint_version = "8.8.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 = "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/"

[internal]
min_endpoint_version = "8.8.0"

Stages and Predicates

Stage 1: any

any where event.category in ("api", "library") and
 process.name in~ ("chrome.exe", "msedge.exe", "iexplore.exe", "brave.exe", "whale.exe", "browser.exe", "dragon.exe", "vivaldi.exe",
                 "opera.exe", "seamonkey.exe", "safari.exe", "waterfox.exe") and
 _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: "*NdrServerCall2*") and 
 not process.Ext.api.summary :  ("VirtualProtect( koaxoj_?.dll,*)", "WriteProcessMemory( onedrive*") and 
 not dll.code_signature.trusted == true and 
 not dll.path : ("?:\\Windows\\System32\\jscript9.dll",
                 "?:\\Windows\\System32\\vaultcli.dll",
                 "?:\\Windows\\SysWOW64\\jscript9.dll",
                 "?:\\Windows\\SysWOW64\\vaultcli.dll",
                 "?:\\Windows\\System32\\wbem\\fastprox.dll") and
 not _arraysearch(process.thread.Ext.call_stack, $entry, $entry.symbol_info: ("?:\\windows\\system32\\rpcrt4.dll!RpcBindingFromStringBindingW*", "c:\\windows\\system32\\rpcrt4.dll!I_RpcExceptionFilter+*"))

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
dll.code_signature.trustedeqtrueexcludes:dll.code_signature.trusted field:"dll.code_signature.trusted" value:"true"
dll.patheq?:\Windows\System32\jscript9.dll, ?:\Windows\System32\vaultcli.dll, ?:\Windows\SysWOW64\jscript9.dll, ?:\Windows\SysWOW64\vaultcli.dll, ?:\Windows\System32\wbem\fastprox.dllexcludes:dll.path
process.Ext.api.summarywildcardVirtualProtect( koaxoj_?.dll,*), WriteProcessMemory( onedrive*excludes:process.Ext.api.summary field:"process.Ext.api.summary" value:"VirtualProtect( koaxoj_?.dll,*)" field:"process.Ext.api.summary" value:"WriteProcessMemory( onedrive*"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.categoryin
  • api corpus 5 (elastic 5)
  • library corpus 22 (elastic 22)
field:"event.category" kind:in
process.namein
  • brave.exe corpus 7 (elastic 7)
  • browser.exe corpus 7 (elastic 7)
  • chrome.exe corpus 16 (elastic 14, splunk 2)
  • dragon.exe corpus 7 (elastic 7)
  • iexplore.exe corpus 6 (elastic 5, splunk 1)
  • msedge.exe corpus 12 (elastic 12)
  • opera.exe corpus 3 (elastic 3)
  • safari.exe
  • seamonkey.exe
  • vivaldi.exe corpus 6 (elastic 6)
  • waterfox.exe
  • whale.exe corpus 4 (elastic 4)
field:"process_name" kind:in