Detection rules › Elastic

UAC Bypass Attempt via MMC DLL Search Order Hijacking

Time window
1m
Source
github.com/elastic/protections-artifacts

Identifies attempts to bypass User Account Control (UAC) via DLL search order hijacking by setting the .NET Core profiler environment variable to force MMC loading a malicious DLL. Attackers may attempt to 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 DLL search order hijacking by setting the .NET Core
profiler environment variable to force MMC loading a malicious DLL. Attackers may attempt to bypass UAC to stealthily
execute code with elevated permissions.
"""
id = "28996098-b9be-4aa8-a1f3-4923c84b2649"
license = "Elastic License v2"
name = "UAC Bypass Attempt via MMC DLL Search Order Hijacking"
os_list = ["windows"]
reference = ["https://github.com/hfiref0x/UACME"]
version = "1.0.32"

query = '''
sequence with maxspan=60s
 [registry where
   registry.path :
         ("HKEY_USERS\\S-1-5-21*\\Environment\\COR_PROFILER_PATH",
          "HKEY_USERS\\S-1-12-1-*\\Environment\\COR_PROFILER_PATH") and
   registry.data.strings : "*.dll"]
 [process where event.action == "start" and process.name : "mmc.exe"]
 [process where event.action == "start" and
  process.parent.name : "mmc.exe" and process.Ext.token.integrity_level_name == "high" and
  not process.executable :
           ("?:\\Windows\\System32\\WerFault.exe",
            "?:\\Windows\\SysWOW64\\WerFault.exe")]
'''

min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 2

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 2

[[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 = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[threat.technique.subtechnique]]
id = "T1574.001"
name = "DLL"
reference = "https://attack.mitre.org/techniques/T1574/001/"



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

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: registry

[registry where
   registry.path :
         ("HKEY_USERS\\S-1-5-21*\\Environment\\COR_PROFILER_PATH",
          "HKEY_USERS\\S-1-12-1-*\\Environment\\COR_PROFILER_PATH") and
   registry.data.strings : "*.dll"]

Stage 2: process

[process where event.action == "start" and process.name : "mmc.exe"]

Stage 3: process

[process where event.action == "start" and
  process.parent.name : "mmc.exe" and process.Ext.token.integrity_level_name == "high" and
  not process.executable :
           ("?:\\Windows\\System32\\WerFault.exe",
            "?:\\Windows\\SysWOW64\\WerFault.exe")]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq?:\Windows\System32\WerFault.exe, ?:\Windows\SysWOW64\WerFault.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\WerFault.exe" field:"process.executable" value:"?:\Windows\SysWOW64\WerFault.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.namewildcard
  • mmc.exe corpus 12 (elastic 7, splunk 5)
field:"process_name" kind:wildcard value:"mmc.exe"
process.parent.namewildcard
  • mmc.exe corpus 9 (elastic 7, splunk 1, kusto 1)
field:"parent_process_name" kind:wildcard value:"mmc.exe"
registry.data.stringswildcard
  • *.dll corpus 9 (sigma 4, elastic 4, splunk 1)
field:"Details" kind:wildcard value:"*.dll"
registry.pathwildcard
  • HKEY_USERS\S-1-12-1-*\Environment\COR_PROFILER_PATH
  • HKEY_USERS\S-1-5-21*\Environment\COR_PROFILER_PATH
field:"TargetObject" kind:wildcard