Detection rules › Elastic
UAC Bypass via Event Viewer
Identifies attempts to bypass User Account Control (UAC) via eventvwr.exe. Attackers bypass UAC to stealthily execute code with elevated permissions.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule body
[rule]
description = """
Identifies attempts to bypass User Account Control (UAC) via eventvwr.exe. Attackers bypass UAC to stealthily execute
code with elevated permissions.
"""
id = "ab29a79a-b3c2-4ae4-9670-70dd0ea68a4a"
license = "Elastic License v2"
name = "UAC Bypass via Event Viewer"
os_list = ["windows"]
reference = ["https://github.com/hfiref0x/UACME", "https://twitter.com/orange_8361/status/1518970259868626944"]
version = "1.0.32"
query = '''
process where event.action == "start" and
process.Ext.token.integrity_level_name == "high" and
(
/* mscfile hijacking */
process.parent.name : "eventvwr.exe" or
/* Unsafe .Net Deserialization in Windows Event Viewer */
(process.parent.name : "mmc.exe" and
process.parent.args : ("?:\\WINDOWS\\system32\\eventvwr.msc", "?:\\WINDOWS\\SysWOW64\\eventvwr.msc", "eventvwr.msc"))
) and
/* FPs */
not process.executable :
("?:\\Windows\\SysWOW64\\mmc.exe",
"?:\\Windows\\System32\\mmc.exe",
"?:\\Windows\\System32\\WerFault.exe",
"?:\\Windows\\SysWOW64\\WerFault.exe",
"?:\\Windows\\System32\\wermgr.exe",
"?:\\Windows\\SysWOW64\\wermgr.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Program Files\\*.exe",
"?:\\Windows\\System32\\DWWIN.EXE",
"?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
"?:\\Program Files\\Mozilla Firefox\\firefox.exe",
"?:\\Program Files\\Internet Explorer\\iexplore.exe",
"?:\\Program Files (x86)\\Tencent\\QQPinyin\\*\\QQPYUserCenter.exe") and
not (process.name : "rundll32.exe" and process.args : "cryptext.dll,CryptExtOpenCRL")
'''
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/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.Ext.token.integrity_level_name == "high" and
(
process.parent.name : "eventvwr.exe" or
(process.parent.name : "mmc.exe" and
process.parent.args : ("?:\\WINDOWS\\system32\\eventvwr.msc", "?:\\WINDOWS\\SysWOW64\\eventvwr.msc", "eventvwr.msc"))
) and
not process.executable :
("?:\\Windows\\SysWOW64\\mmc.exe",
"?:\\Windows\\System32\\mmc.exe",
"?:\\Windows\\System32\\WerFault.exe",
"?:\\Windows\\SysWOW64\\WerFault.exe",
"?:\\Windows\\System32\\wermgr.exe",
"?:\\Windows\\SysWOW64\\wermgr.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Program Files\\*.exe",
"?:\\Windows\\System32\\DWWIN.EXE",
"?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
"?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
"?:\\Program Files\\Mozilla Firefox\\firefox.exe",
"?:\\Program Files\\Internet Explorer\\iexplore.exe",
"?:\\Program Files (x86)\\Tencent\\QQPinyin\\*\\QQPYUserCenter.exe") and
not (process.name : "rundll32.exe" and process.args : "cryptext.dll,CryptExtOpenCRL")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | cryptext.dll,CryptExtOpenCRL | excludes:process.args field:"process.args" value:"cryptext.dll,CryptExtOpenCRL" |
process.name | eq | rundll32.exe | excludes:process.name field:"process.name" value:"rundll32.exe" |
process.executable | wildcard | ?:\Windows\SysWOW64\mmc.exe, ?:\Windows\System32\mmc.exe, ?:\Windows\System32\WerFault.exe, ?:\Windows\SysWOW64\WerFault.exe, ?:\Windows\System32\wermgr.exe, ?:\Windows\SysWOW64\wermgr.exe, ?:\Program Files (x86)\*.exe, ?:\Program Files\*.exe, ?:\Windows\System32\DWWIN.EXE, ?:\Program Files\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe, ?:\Program Files\Mozilla Firefox\firefox.exe, ?:\Program Files\Internet Explorer\iexplore.exe, ?:\Program Files (x86)\Tencent\QQPinyin\*\QQPYUserCenter.exe | excludes:process.executable |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.Ext.token.integrity_level_name | eq |
| field:"process.Ext.token.integrity_level_name" kind:eq value:"high" |
process.parent.args | wildcard |
| field:"process.parent.args" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_name" kind:wildcard |