Detection rules › Elastic

UAC Bypass Attempt via Windows Directory Masquerading

Source
github.com/elastic/protections-artifacts

Identifies an attempt to bypass User Account Control (UAC) by masquerading as a Microsoft trusted Windows directory. Attackers may bypass UAC to stealthily execute code with elevated permissions.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies an attempt to bypass User Account Control (UAC) by masquerading as a Microsoft trusted Windows directory.
Attackers may bypass UAC to stealthily execute code with elevated permissions.
"""
id = "adaf95d2-28ce-4880-af16-f3041b624440"
license = "Elastic License v2"
name = "UAC Bypass Attempt via Windows Directory Masquerading"
os_list = ["windows"]
reference = ["https://medium.com/tenable-techblog/uac-bypass-by-mocking-trusted-directories-24a96675f6e"]
version = "1.0.31"

query = '''
process where event.action == "start" and
 process.Ext.token.integrity_level_name == "high" and
  process.args :
         ("?:\\Windows \\System32\\*.exe",
          "?:\\Windows \\SysWOW64\\*.exe",
          "?:\\ Windows*\\System32\\*.exe",
          "?:\\ Windows*\\SysWOW64\\*.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/"

[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.args :
         ("?:\\Windows \\System32\\*.exe",
          "?:\\Windows \\SysWOW64\\*.exe",
          "?:\\ Windows*\\System32\\*.exe",
          "?:\\ Windows*\\SysWOW64\\*.exe")

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.argswildcard
  • ?:\ Windows*\SysWOW64\*.exe
  • ?:\ Windows*\System32\*.exe
  • ?:\Windows \SysWOW64\*.exe
  • ?:\Windows \System32\*.exe
field:"process.args" kind:wildcard