Detection rules › Elastic

UAC Bypass via DelegateExecute Registry Modification

Time window
1m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies attempts to bypass User Account Control (UAC) by modifying the DelegateExecute registry value. Attackers bypass UAC to stealthily execute code with elevated permissions.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies attempts to bypass User Account Control (UAC) by modifying the DelegateExecute registry value. Attackers
bypass UAC to stealthily execute code with elevated permissions.
"""
id = "25c41954-5d42-4530-b9cb-bdaf9d028ce7"
license = "Elastic License v2"
name = "UAC Bypass via DelegateExecute Registry Modification"
os_list = ["windows"]
reference = [
    "https://medium.com/cybersecpadawan/utilizing-a-common-windows-binary-to-escalate-to-system-privileges-c16482cced4b",
]
version = "1.0.34"

query = '''
sequence by process.entity_id with maxspan=1m
  [process where event.action == "start" and
   process.Ext.token.integrity_level_name == "medium" and process.executable != null and not

   /* excludes OpenWith which is used to delegate handling a file type to a chosen program */
   process.executable : ("?:\\Windows\\System32\\OpenWith.exe", "?:\\Windows\\SysWOW64\\OpenWith.exe") and

   /* exclude signed third party programs */
   not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and

   not (process.code_signature.subject_name in ("Stanislav Zinukhov", "Google Inc", "IP Zinukhov Stanislav Igorevich", "Vera") and
        process.code_signature.trusted == true) and

   not process.executable : "?:\\Windows\\explorer.exe" and

   not (process.executable : "C:\\Windows\\regedit.exe" and
        process.parent.executable : ("C:\\Program Files\\Omnissa\\DEM\\FlexService.exe", "C:\\Program Files\\Immidio\\Flex Profiles\\FlexService.exe"))
   ]
  [registry where
   registry.value : "DelegateExecute" and registry.hive : "HKEY_USERS" and
   not (process.executable : "?:\\Windows\\regedit.exe" and registry.path : "HKEY_USERS\\S-1-*_Classes\\AppX*\\Shell\\open\\command\\DelegateExecute") and
   not process.executable : "?:\\Windows\\explorer.exe"
   ]
'''

min_endpoint_version = "7.15.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 = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"



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


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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

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

Stage 1: process

[process where event.action == "start" and
   process.Ext.token.integrity_level_name == "medium" and process.executable != null and not
   process.executable : ("?:\\Windows\\System32\\OpenWith.exe", "?:\\Windows\\SysWOW64\\OpenWith.exe") and
   not process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
   not (process.code_signature.subject_name in ("Stanislav Zinukhov", "Google Inc", "IP Zinukhov Stanislav Igorevich", "Vera") and
        process.code_signature.trusted == true) and
   not process.executable : "?:\\Windows\\explorer.exe" and
   not (process.executable : "C:\\Windows\\regedit.exe" and
        process.parent.executable : ("C:\\Program Files\\Omnissa\\DEM\\FlexService.exe", "C:\\Program Files\\Immidio\\Flex Profiles\\FlexService.exe"))
   ]

Stage 2: registry

[registry where
   registry.value : "DelegateExecute" and registry.hive : "HKEY_USERS" and
   not (process.executable : "?:\\Windows\\regedit.exe" and registry.path : "HKEY_USERS\\S-1-*_Classes\\AppX*\\Shell\\open\\command\\DelegateExecute") and
   not process.executable : "?:\\Windows\\explorer.exe"
   ]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameinGoogle Inc, IP Zinukhov Stanislav Igorevich, Stanislav Zinukhov, Veraexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executableeqC:\Windows\regedit.exeexcludes:process.executable field:"process.executable" value:"C:\Windows\regedit.exe"
process.parent.executableeqC:\Program Files\Omnissa\DEM\FlexService.exe, C:\Program Files\Immidio\Flex Profiles\FlexService.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files\Omnissa\DEM\FlexService.exe" field:"process.parent.executable" value:"C:\Program Files\Immidio\Flex Profiles\FlexService.exe"
process.executableeq?:\Windows\System32\OpenWith.exe, ?:\Windows\SysWOW64\OpenWith.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\OpenWith.exe" field:"process.executable" value:"?:\Windows\SysWOW64\OpenWith.exe"
process.executableeq?:\Windows\explorer.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\explorer.exe"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\*.exe" field:"process.executable" value:"?:\Program Files (x86)\*.exe"
process.executableeq?:\Windows\regedit.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\regedit.exe"
registry.pathwildcardHKEY_USERS\S-1-*_Classes\AppX*\Shell\open\command\DelegateExecuteexcludes:registry.path field:"registry.path" value:"HKEY_USERS\S-1-*_Classes\AppX*\Shell\open\command\DelegateExecute"

Indicators

These rows show field, operator, and value matches.