Detection: Windows UAC Bypass Suspicious Escalation Behavior

Description

The following analytic detects when a process spawns an executable known for User Account Control (UAC) bypass exploitation and subsequently monitors for any child processes with a higher integrity level than the original process. This detection leverages Sysmon EventID 1 data, focusing on process integrity levels and known UAC bypass executables. This activity is significant as it may indicate an attacker has successfully used a UAC bypass exploit to escalate privileges. If confirmed malicious, the attacker could gain elevated privileges, potentially leading to further system compromise and persistent access.

  1
  2| tstats `security_content_summariesonly`
  3  count max(_time) as lastTime
  4
  5FROM datamodel=Endpoint.Processes WHERE
  6
  7Processes.process_integrity_level IN (
  8    "low",
  9    "medium"
 10)
 11
 12BY Processes.action Processes.dest Processes.original_file_name
 13   Processes.parent_process Processes.parent_process_exec
 14   Processes.parent_process_guid Processes.parent_process_id
 15   Processes.parent_process_name Processes.parent_process_path
 16   Processes.process Processes.process_exec Processes.process_guid
 17   Processes.process_hash Processes.process_id
 18   Processes.process_integrity_level Processes.process_name
 19   Processes.process_path Processes.user
 20   Processes.user_id Processes.vendor_product
 21
 22
 23| `drop_dm_object_name(Processes)`
 24
 25
 26| eval original_integrity_level = CASE(
 27            match(process_integrity_level,"low"),1,
 28            match(process_integrity_level,"medium"),2,
 29            match(process_integrity_level,"high"),3,
 30            match(process_integrity_level,"system"),4,
 31            true(),0
 32        )
 33
 34| rename process_guid as join_guid_1,
 35         process* as parent_process*
 36
 37
 38| join max=0 dest join_guid_1 [
 39    
 40| tstats `security_content_summariesonly`
 41      count min(_time) as firstTime
 42    FROM datamodel=Endpoint.Processes WHERE
 43
 44    Processes.process_integrity_level IN (
 45        "high",
 46        "system"
 47    )
 48    Processes.process_name IN (`uacbypass_process_name`)
 49
 50    BY Processes.dest Processes.parent_process_guid
 51       Processes.process_name Processes.process_guid
 52
 53    
 54| `drop_dm_object_name(Processes)`
 55    
 56| rename parent_process_guid as join_guid_1,
 57             process_guid as join_guid_2,
 58             process_name as uac_process_name
 59]
 60
 61
 62| join max=0 dest join_guid_2 [
 63    
 64| tstats `security_content_summariesonly`
 65      count min(_time) as firstTime
 66    FROM datamodel=Endpoint.Processes WHERE
 67
 68    Processes.parent_process_name IN (`uacbypass_process_name`)
 69    Processes.process_integrity_level IN (
 70        "high",
 71        "system"
 72    )
 73    BY Processes.dest Processes.parent_process_guid
 74       Processes.process_name Processes.process
 75       Processes.process_guid Processes.process_path
 76       Processes.process_integrity_level Processes.process_current_directory
 77
 78    
 79| `drop_dm_object_name(Processes)`
 80
 81    
 82| rename parent_process_guid as join_guid_2
 83
 84    
 85| eval elevated_integrity_level = CASE(
 86        match(process_integrity_level,"low"),1,
 87        match(process_integrity_level,"medium"),2,
 88        match(process_integrity_level,"high"),3,
 89        match(process_integrity_level,"system"),4,
 90        true(),0
 91    )
 92]
 93
 94| where elevated_integrity_level > original_integrity_level
 95
 96| `security_content_ctime(firstTime)`
 97
 98| `security_content_ctime(lastTime)`
 99
100| `windows_uac_bypass_suspicious_escalation_behavior_filter`

Data Source

Name Platform Sourcetype Source
Sysmon EventID 1 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
windows_uac_bypass_suspicious_escalation_behavior_filter search *
windows_uac_bypass_suspicious_escalation_behavior_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1548.002 Bypass User Account Control Defense Evasion
Exploitation
DE.CM
CIS 10

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Notable Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Risk Event True
This configuration file applies to all detections of type TTP. These detections will use Risk Based Alerting and generate Notable Events.

Implementation

Target environment must ingest sysmon data, specifically Event ID 1 with process integrity level data.

Known False Positives

Including Werfault.exe may cause some unintended false positives related to normal application faulting, but is used in a number of UAC bypass techniques.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message:

A UAC bypass behavior was detected by process $parent_process_name$ on host $dest$ by $user$.

Risk Object Risk Object Type Risk Score Threat Objects
dest system 50 process_name, parent_process_name
user user 50 process_name, parent_process_name

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 12