This repository serves as a collection of public UAC bypass techniques that have been weaponized as BOFs. A single module which integrates all techniques has been provided to use the BOFs via the Havoc C2 Framework.
A extension.json
file has also been provided for each bypass technique for use in Sliver. See the section of the readme titled Greetz/Credit for all references/code that was used in this project.
UAC Bypass | Description |
---|---|
CmstpElevatedCOM | Creates an elevated ICMLuaUtil COM object and calls its ShellExec function to execute the provided file on disk. |
ColorDataProxy | Creates an elevated ICMLuaUtil COM object and calls its SetRegistryStringValue function to write the location of the provided file to the DisplayCalibrator registry value residing in HKLM. It will then create an elevated IColorDataProxy COM object and call its LaunchDccw function, resulting in the execution of the provided file. |
EditionUpgradeManager | Modifies the “Environment\windir” registry key, creates a elevated IEditionUpgradeManager COM object, and then calls the AcquireModernLicenseWithPreviousId function from the elevated COM object to execute the provided file. |
SilentCleanupWinDir | Modifies the “Environment\windir” registry key and executes the SilentCleanup scheduled task via schtasksrun by @TrustedSec. |
RegistryShellCommand | Modifies the “ms-settings\Shell\Open\command” registry key and executes an auto-elevated EXE (ComputerDefaults.exe). |
TrustedPathDLLHijack | Creates fake windows directory C:\Windows \ , copies supplied DLL to location, and executes auto-elevated EXE (ComputerDefaults.exe). |
SspiUacBypass | Forges a token from a fake network authentication though SSPI Datagram Contexts. It will then impersonate the forged token and use CreateSvcRpc by @x86matthew to create a new SYSTEM service. Original research and code is from @splinter_code. |
The BOFs can be utilized by running their corresponding subcommands in the Havoc C2 module.
To use, simply run make
and then load the module into Havoc using the script manager. See below for usage information and examples:
15/02/2024 18:07:05 [chippy] Demon » help uac-bypass
- Command : uac-bypass
- Description : Havoc UAC Bypass Module
- Usage : uac-bypass [subcommand] (args)
- Required Args : 2
Command Description
--------- -------------
trustedpath Perform UAC bypass via fake windows directory with ComputerDefaults.exe and Secur32.dll
silentcleanup Perform UAC bypass via the "Environment\windir" registry key and SilentCleanup scheduled task
sspidatagram Perform UAC bypass via SSPI Datagram Contexts
registrycommand Perform UAC bypass via modifying the "ms-settings\Shell\Open\command" registry key
elevatedcom Perform UAC bypass via the ICMLuaUtil elevated COM interface
colordataproxy Perform UAC bypass via ColorDataProxy and elevated ICMLuaUtil COM interface
editionupgrade Perform UAC bypass via the "Environment\windir" registry key and elevated IEditionUpgradeManager COM interface
Additionally, extension.json
files have been provided for each UAC bypass method if you wish to use them with Sliver C2. See below for sample instructions on how to load and use the extensions:
# Copy folder for desired UAC bypass to the sliver extensions folder
cp -rp ~/dev/UACBypasses/SspiUacBypass /root/.sliver-client/extensions/
# CD into the new extension folder and run make
cd /root/.sliver-client/extensions/SspiUacBypass/; make
# From sliver client cli, load extension by providing new path
extensions load /root/.sliver-client/extensions/SspiUacBypass
Finally, standalone implementations of each UAC bypass have also been provided. These will automatically be built by mingw when running the make
command.
Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…
shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…
Extract and execute a PE embedded within a PNG file using an LNK file. The…
Embark on the journey of becoming a certified Red Team professional with our definitive guide.…
This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…
This took me like 4 days (+2 days for an update), but I got it…