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.
Prompt injection is a type of security vulnerability that can be exploited to control the…
Firefly is an advanced black-box fuzzer and not just a standard asset discovery tool. Firefly…
Winit is a robust, cross-platform library designed for creating and managing windows in Rust applications.…
In today’s digital age, convenience often comes at the cost of security. One such overlooked…
Terminal GPT (tgpt) offers a seamless way to bring the power of ChatGPT 3.5 directly…
garak checks if an LLM can be made to fail in a way we don't…