# T1548.002 - Abuse Elevation Control Mechanism: Bypass User Account Control

## Description from ATT&CK

> Adversaries may bypass UAC mechanisms to elevate process privileges on system. Windows User Account Control (UAC) allows a program to elevate its privileges (tracked as integrity levels ranging from low to high) to perform a task under administrator-level permissions, possibly by prompting the user for confirmation. The impact to the user ranges from denying the operation under high enforcement to allowing the user to perform the action if they are in the local administrators group and click through the prompt or allowing them to enter an administrator password to complete the action.(Citation: TechNet How UAC Works)
> 
> If the UAC protection level of a computer is set to anything but the highest level, certain Windows programs can elevate privileges or execute some elevated [Component Object Model](https://attack.mitre.org/techniques/T1559/001) objects without prompting the user through the UAC notification box.(Citation: TechNet Inside UAC)(Citation: MSDN COM Elevation) An example of this is use of [Rundll32](https://attack.mitre.org/techniques/T1218/011) to load a specifically crafted DLL which loads an auto-elevated [Component Object Model](https://attack.mitre.org/techniques/T1559/001) object and performs a file operation in a protected directory which would typically require elevated access. Malicious software may also be injected into a trusted process to gain elevated privileges without prompting a user.(Citation: Davidson Windows)
> 
> Many methods have been discovered to bypass UAC. The Github readme page for UACME contains an extensive list of methods(Citation: Github UACMe) that have been discovered and implemented, but may not be a comprehensive list of bypasses. Additional bypass methods are regularly discovered and some used in the wild, such as:
> 
> * <code>eventvwr.exe</code> can auto-elevate and execute a specified binary or script.(Citation: enigma0x3 Fileless UAC Bypass)(Citation: Fortinet Fareit)
> 
> Another bypass is possible through some lateral movement techniques if credentials for an account with administrator privileges are known, since UAC is a single system security mechanism, and the privilege or integrity of a process running on one system will be unknown on remote systems and default to high integrity.(Citation: SANS UAC Bypass)

[Source](https://attack.mitre.org/techniques/T1548/002)

## Atomic Tests

- [Atomic Test #1: Bypass UAC using Event Viewer (cmd)](#atomic-test-1-bypass-uac-using-event-viewer-cmd)
- [Atomic Test #2: Bypass UAC using Event Viewer (PowerShell)](#atomic-test-2-bypass-uac-using-event-viewer-powershell)
- [Atomic Test #3: Bypass UAC using Fodhelper](#atomic-test-3-bypass-uac-using-fodhelper)
- [Atomic Test #4: Bypass UAC using Fodhelper - PowerShell](#atomic-test-4-bypass-uac-using-fodhelper---powershell)
- [Atomic Test #5: Bypass UAC using ComputerDefaults (PowerShell)](#atomic-test-5-bypass-uac-using-computerdefaults-powershell)
- [Atomic Test #6: Bypass UAC by Mocking Trusted Directories](#atomic-test-6-bypass-uac-by-mocking-trusted-directories)
- [Atomic Test #7: Bypass UAC using sdclt DelegateExecute](#atomic-test-7-bypass-uac-using-sdclt-delegateexecute)
- [Atomic Test #8: Disable UAC using reg.exe](#atomic-test-8-disable-uac-using-regexe)
- [Atomic Test #9: Bypass UAC using SilentCleanup task](#atomic-test-9-bypass-uac-using-silentcleanup-task)
- [Atomic Test #10: UACME Bypass Method 23](#atomic-test-10-uacme-bypass-method-23)
- [Atomic Test #11: UACME Bypass Method 31](#atomic-test-11-uacme-bypass-method-31)
- [Atomic Test #12: UACME Bypass Method 33](#atomic-test-12-uacme-bypass-method-33)
- [Atomic Test #13: UACME Bypass Method 34](#atomic-test-13-uacme-bypass-method-34)
- [Atomic Test #14: UACME Bypass Method 39](#atomic-test-14-uacme-bypass-method-39)
- [Atomic Test #15: UACME Bypass Method 56](#atomic-test-15-uacme-bypass-method-56)
- [Atomic Test #16: UACME Bypass Method 59](#atomic-test-16-uacme-bypass-method-59)
- [Atomic Test #17: UACME Bypass Method 61](#atomic-test-17-uacme-bypass-method-61)
- [Atomic Test #18: WinPwn - UAC Magic](#atomic-test-18-winpwn---uac-magic)
- [Atomic Test #19: WinPwn - UAC Bypass ccmstp technique](#atomic-test-19-winpwn---uac-bypass-ccmstp-technique)
- [Atomic Test #20: WinPwn - UAC Bypass DiskCleanup technique](#atomic-test-20-winpwn---uac-bypass-diskcleanup-technique)
- [Atomic Test #21: WinPwn - UAC Bypass DccwBypassUAC technique](#atomic-test-21-winpwn---uac-bypass-dccwbypassuac-technique)
- [Atomic Test #22: Disable UAC admin consent prompt via ConsentPromptBehaviorAdmin registry key](#atomic-test-22-disable-uac-admin-consent-prompt-via-consentpromptbehavioradmin-registry-key)
- [Atomic Test #23: UAC Bypass with WSReset Registry Modification](#atomic-test-23-uac-bypass-with-wsreset-registry-modification)
- [Atomic Test #24: Disable UAC - Switch to the secure desktop when prompting for elevation via registry key](#atomic-test-24-disable-uac---switch-to-the-secure-desktop-when-prompting-for-elevation-via-registry-key)
- [Atomic Test #25: Disable UAC notification via registry keys](#atomic-test-25-disable-uac-notification-via-registry-keys)
- [Atomic Test #26: Disable ConsentPromptBehaviorAdmin via registry keys](#atomic-test-26-disable-consentpromptbehavioradmin-via-registry-keys)
- [Atomic Test #27: UAC bypassed by Utilizing ProgIDs registry.](#atomic-test-27-uac-bypassed-by-utilizing-progids-registry)

### Atomic Test #1: Bypass UAC using Event Viewer (cmd)

Bypasses User Account Control using Event Viewer and a relevant Windows Registry modification. More information here - https://enigma0x3.net/2016/08/15/fileless-uac-bypass-using-eventvwr-exe-and-registry-hijacking/
Upon execution command prompt should be launched with administrative privileges.

**Supported Platforms:** Windows

**auto_generated_guid:** `5073adf8-9a50-4bd9-b298-a9bd2ead8af9`

#### Inputs

| Name | Description | Type | Default Value |
|------|-------------|------|---------------|
| executable_binary | Binary to execute with UAC Bypass | path | C:&#92;Windows&#92;System32&#92;cmd.exe|

#### Attack Commands: Run with `command_prompt`!

```cmd
reg.exe add hkcu\software\classes\mscfile\shell\open\command /ve /d "#{executable_binary}" /f
cmd.exe /c eventvwr.msc
```

#### Cleanup Commands

```cmd
reg.exe delete hkcu\software\classes\mscfile /f >nul 2>&1
```
### Atomic Test #2: Bypass UAC using Event Viewer (PowerShell)

PowerShell code to bypass User Account Control using Event Viewer and a relevant Windows Registry modification. More information here - https://enigma0x3.net/2016/08/15/fileless-uac-bypass-using-eventvwr-exe-and-registry-hijacking/
Upon execution command prompt should be launched with administrative privalages

**Supported Platforms:** Windows

**auto_generated_guid:** `a6ce9acf-842a-4af6-8f79-539be7608e2b`

#### Inputs

| Name | Description | Type | Default Value |
|------|----