← Back to SOC feed Coverage →

detect-uac-elevation

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-20T23:00:01Z · Confidence: medium

Hunt Hypothesis

Adversaries may use UAC elevation through consent.exe to gain elevated privileges without triggering standard detection mechanisms. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential privilege escalation attempts that bypass traditional security controls.

KQL Query

let TimeTolerance = 30m;
DeviceProcessEvents
| where FileName =~ 'consent.exe'
| extend parsedCommandLine = split(ProcessCommandLine,' ')
| project ElevationTime = Timestamp, DeviceId, ElevatedProcessId = tolong(parsedCommandLine[1])
| join kind=inner ( 
    DeviceProcessEvents
    | where ProcessTokenElevation == 'TokenElevationTypeFull'
) on DeviceId, $left.ElevatedProcessId == $right.ProcessId
| where ElevationTime - Timestamp <= TimeTolerance
| project-away DeviceId1

Analytic Rule Definition

name: detect-uac-elevation
description: |
  This query identifies UAC elevated processes by analyzing launches of consent.exe (the process that performs UAC elevation).
  The first parameter of consent.exe is the process ID being elevated, therefore we extract this value and use a combination of
  that ID and the DeviceId to join it with processes that ran UAC elevated on the device. Given that process IDs can be reused, 
  a time filter is performed to ensure that the elevation request and the process launch occur within a specified period of time
  (as written 30 minutes).
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
tactics:
- Execution
query: |
  let TimeTolerance = 30m;
  DeviceProcessEvents
  | where FileName =~ 'consent.exe'
  | extend parsedCommandLine = split(ProcessCommandLine,' ')
  | project ElevationTime = Timestamp, DeviceId, ElevatedProcessId = tolong(parsedCommandLine[1])
  | join kind=inner ( 
      DeviceProcessEvents
      | where ProcessTokenElevation == 'TokenElevationTypeFull'
  ) on DeviceId, $left.ElevatedProcessId == $right.ProcessId
  | where ElevationTime - Timestamp <= TimeTolerance
  | project-away DeviceId1

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Execution/detect-uac-elevation.yml