Detection rules › Elastic
UAC Bypass via Unsafe Deserialization in Event Viewer
Identifies attempts to bypass User Account Control (UAC) via Unsafe .Net Deserialization in Windows Event Viewer. 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 Unsafe .Net Deserialization in Windows Event Viewer.
Attackers bypass UAC to stealthily execute code with elevated permissions.
"""
id = "df7e55c9-cd36-4e33-9e82-3a54b9c84495"
license = "Elastic License v2"
name = "UAC Bypass via Unsafe Deserialization in Event Viewer"
os_list = ["windows"]
reference = [
"https://twitter.com/orange_8361/status/1518970259868626944",
"https://github.com/CsEnox/EventViewer-UACBypass",
]
version = "1.0.30"
query = '''
file where event.action != "deletion" and file.name : "RecentViews" and
file.path : "?:\\Users\\*\\AppData\\*\\Microsoft\\Event Viewer\\RecentViews" and
process.executable != null and
not process.executable :
("?:\\Windows\\System32\\mmc.exe",
"?:\\Windows\\SysWOW64\\mmc.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\Explorer.exe",
"?:\\Program Files\\Citrix\\User Profile Manager\\UserProfileManager.exe",
"?:\\ProgramData\\ForensiT\\Transwiz\\Deployment Files\\Transwiz.exe",
"?:\\Windows\\WinSxS\\*\\mmc.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\dllhost.exe",
"?:\\Windows\\System32\\taskhost.exe") and
not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
not (process.code_signature.subject_name : "ForensiT Limited" and process.code_signature.trusted == true)
'''
min_endpoint_version = "8.1.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 = "8.1.0"
Stages and Predicates
Stage 1: file
file where event.action != "deletion" and file.name : "RecentViews" and
file.path : "?:\\Users\\*\\AppData\\*\\Microsoft\\Event Viewer\\RecentViews" and
process.executable != null and
not process.executable :
("?:\\Windows\\System32\\mmc.exe",
"?:\\Windows\\SysWOW64\\mmc.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\Explorer.exe",
"?:\\Program Files\\Citrix\\User Profile Manager\\UserProfileManager.exe",
"?:\\ProgramData\\ForensiT\\Transwiz\\Deployment Files\\Transwiz.exe",
"?:\\Windows\\WinSxS\\*\\mmc.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\dllhost.exe",
"?:\\Windows\\System32\\taskhost.exe") and
not user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
not (process.code_signature.subject_name : "ForensiT Limited" and process.code_signature.trusted == true)
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | eq | ForensiT Limited | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"ForensiT Limited" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | wildcard | ?:\Windows\System32\mmc.exe, ?:\Windows\SysWOW64\mmc.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\Explorer.exe, ?:\Program Files\Citrix\User Profile Manager\UserProfileManager.exe, ?:\ProgramData\ForensiT\Transwiz\Deployment Files\Transwiz.exe, ?:\Windows\WinSxS\*\mmc.exe, ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\dllhost.exe, ?:\Windows\System32\taskhost.exe | excludes:process.executable |
user.id | eq | S-1-5-18, S-1-5-19, S-1-5-20 | excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | ne |
| field:"EventType" kind:ne value:"deletion" |
file.name | wildcard |
| field:"file.name" kind:wildcard value:"RecentViews" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard value:"?:\Users\*\AppData\*\Microsoft\Event Viewer\RecentViews" |
process.executable | is_not_null | field:"Image" kind:is_not_null |