Detection rules › Elastic

UAC Bypass via Event Viewer

Source
github.com/elastic/protections-artifacts

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

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.

FieldKindExcluded valuesSearch
process.argseqcryptext.dll,CryptExtOpenCRLexcludes:process.args field:"process.args" value:"cryptext.dll,CryptExtOpenCRL"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"
process.executablewildcard?:\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.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.Ext.token.integrity_level_nameeq
  • high corpus 22 (elastic 22)
field:"process.Ext.token.integrity_level_name" kind:eq value:"high"
process.parent.argswildcard
  • ?:\WINDOWS\SysWOW64\eventvwr.msc
  • ?:\WINDOWS\system32\eventvwr.msc
  • eventvwr.msc
field:"process.parent.args" kind:wildcard
process.parent.namewildcard
  • eventvwr.exe corpus 2 (elastic 2)
  • mmc.exe corpus 9 (elastic 7, splunk 1, kusto 1)
field:"parent_process_name" kind:wildcard