Detection rules › Elastic

Process Explorer Device Access by Unusual Process

Source
github.com/elastic/protections-artifacts

Identifies unsigned code calling a 3rd party kernel driver function. Adversaries may bring a vulnerable or abusable driver onto a compromised machine to execute code with the highest privileges.

MITRE ATT&CK coverage

TacticTechniques
Privilege Escalation
Defense Impairment

Rule body

[rule]
description = """
Identifies unsigned code calling a 3rd party kernel driver function. Adversaries may bring a vulnerable or abusable
driver onto a compromised machine to execute code with the highest privileges.
"""
id = "9c4bd6d6-9e2f-4ce2-8266-923e1799726c"
license = "Elastic License v2"
name = "Process Explorer Device Access by Unusual Process"
os_list = ["windows"]
version = "1.0.9"

query = '''
api where
  process.Ext.api.name == "DeviceIoControl" and process.executable != null and
  process.Ext.api.parameters.device : "\\Device\\PROCEXP*" and

  not (process.thread.Ext.call_stack_final_user_module.name : ("procexp64.exe", "procexp.exe", "handle64.exe", "handle.exe", "procexp64a.exe") and
       _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $caller, $caller.trusted == true and
                     $caller.subject_name : "Microsoft Corporation")) and
  not (process.name : ("procexp64.exe", "procexp.exe", "Handle64.exe", "Handle.exe", "procexp64a.exe") and process.code_signature.subject_name : "Microsoft Corporation" and
       process.thread.Ext.call_stack_final_user_module.name in ("Unknown", "Undetermined") and process.code_signature.trusted == true) and
  not (process.thread.Ext.call_stack_final_user_module.name : ("procexp64.exe", "procexp.exe", "handle64.exe") and
       process.code_signature.subject_name : "Microsoft Corporation" and process.code_signature.trusted == true) and
  not (process.name : ("handle64.exe", "handle.exe") and process.command_line : "* -accepteula *" and process.thread.Ext.call_stack_final_user_module.name == "Unknown") and
  not process.thread.Ext.call_stack_final_user_module.path : "c:\\windows\\system32\\apphelp.dll" and
  not (process.executable : "C:\\Windows\\Temp\\Handle64.exe" and process.parent.executable : "C:\\Windows\\_ScriptingFramework\\Tools\\handle.exe") and
  not (process.Ext.api.parameters.device == "\\Device\\PROCEXP152" and process.thread.Ext.call_stack_final_user_module.name == "handle64.exe") and
  not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\iphlpsvc.dll")
'''

min_endpoint_version = "8.14.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 = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"


[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.14.0"

Stages and Predicates

Stage 1: api

api where
  process.Ext.api.name == "DeviceIoControl" and process.executable != null and
  process.Ext.api.parameters.device : "\\Device\\PROCEXP*" and

  not (process.thread.Ext.call_stack_final_user_module.name : ("procexp64.exe", "procexp.exe", "handle64.exe", "handle.exe", "procexp64a.exe") and
       _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $caller, $caller.trusted == true and
                     $caller.subject_name : "Microsoft Corporation")) and
  not (process.name : ("procexp64.exe", "procexp.exe", "Handle64.exe", "Handle.exe", "procexp64a.exe") and process.code_signature.subject_name : "Microsoft Corporation" and
       process.thread.Ext.call_stack_final_user_module.name in ("Unknown", "Undetermined") and process.code_signature.trusted == true) and
  not (process.thread.Ext.call_stack_final_user_module.name : ("procexp64.exe", "procexp.exe", "handle64.exe") and
       process.code_signature.subject_name : "Microsoft Corporation" and process.code_signature.trusted == true) and
  not (process.name : ("handle64.exe", "handle.exe") and process.command_line : "* -accepteula *" and process.thread.Ext.call_stack_final_user_module.name == "Unknown") and
  not process.thread.Ext.call_stack_final_user_module.path : "c:\\windows\\system32\\apphelp.dll" and
  not (process.executable : "C:\\Windows\\Temp\\Handle64.exe" and process.parent.executable : "C:\\Windows\\_ScriptingFramework\\Tools\\handle.exe") and
  not (process.Ext.api.parameters.device == "\\Device\\PROCEXP152" and process.thread.Ext.call_stack_final_user_module.name == "handle64.exe") and
  not (process.executable : "C:\\Windows\\System32\\svchost.exe" and process.thread.Ext.call_stack_final_user_module.path == "c:\\windows\\system32\\iphlpsvc.dll")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
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.nameeqprocexp64.exe, procexp.exe, handle64.exe, handle.exe, procexp64a.exeexcludes:process.thread.Ext.call_stack_final_user_module.name
process.Ext.api.parameters.deviceeq\Device\PROCEXP152excludes:process.Ext.api.parameters.device field:"process.Ext.api.parameters.device" value:"\Device\PROCEXP152"
process.thread.Ext.call_stack_final_user_module.nameeqhandle64.exeexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"handle64.exe"
process.code_signature.subject_nameeqMicrosoft Corporationexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft Corporation"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.nameeqprocexp64.exe, procexp.exe, Handle64.exe, Handle.exe, procexp64a.exeexcludes:process.name
process.thread.Ext.call_stack_final_user_module.nameinUndetermined, Unknownexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown"
process.thread.Ext.call_stack_final_user_module.nameeqprocexp64.exe, procexp.exe, handle64.exeexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"procexp64.exe" field:"process.thread.Ext.call_stack_final_user_module.name" value:"procexp.exe" field:"process.thread.Ext.call_stack_final_user_module.name" value:"handle64.exe"
process.command_linematch -accepteula excludes:process.command_line field:"process.command_line" value:" -accepteula "
process.nameeqhandle64.exe, handle.exeexcludes:process.name field:"process.name" value:"handle64.exe" field:"process.name" value:"handle.exe"
process.thread.Ext.call_stack_final_user_module.nameeqUnknownexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown"
process.executableeqC:\Windows\System32\svchost.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\System32\svchost.exe"
process.thread.Ext.call_stack_final_user_module.patheqc:\windows\system32\iphlpsvc.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\system32\iphlpsvc.dll"
process.executableeqC:\Windows\Temp\Handle64.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\Temp\Handle64.exe"
process.parent.executableeqC:\Windows\_ScriptingFramework\Tools\handle.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Windows\_ScriptingFramework\Tools\handle.exe"
process.thread.Ext.call_stack_final_user_module.patheqc:\windows\system32\apphelp.dllexcludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\system32\apphelp.dll"

Indicators

These rows show field, operator, and value matches.