This project is a tool designed to bypass Windows UAC (User Account Control) using COM (Component Object Model) interfaces, combined with the Reflective DLL Injection technique.
This project is a reflective DLL built to bypass UAC protection on Windows systems. It consists of two main components:
- Reflective DLL Loader – The mechanism that loads and executes the DLL in memory
- UAC Bypass – Uses COM interfaces to launch programs with elevated privileges
- Reflective DLL Injection: Loads a DLL entirely from memory without touching disk
- UAC Bypass: Uses the COM interface
ICMLuaUtilto bypass UAC - Multi-Architecture Support: x86 (32-bit), x64 (64-bit), and ARM
- Stealth: Leaves no artifacts on disk
- Minimal Dependencies: Uses only Windows API functions
Reflective DLL Injection is a technique for loading a DLL directly into memory without using the standard Windows APIs (LoadLibrary, GetProcAddress).
The loader in this project works through the following steps:
-
PE Header Search: Locates the PE (Portable Executable) header by scanning backwards in memory
-
Find Kernel32.dll: Obtains a reference through the PEB (Process Environment Block)
-
Resolve API Functions: Finds required APIs using hash-based lookup:
LoadLibraryAGetProcAddressVirtualAllocNtFlushInstructionCache
-
Memory Allocation: Allocates memory for the DLL
-
PE Loading: Copies PE headers and sections into the new memory region
-
Import Table Processing: Loads required DLLs and resolves imports
-
Relocation Processing: Fixes base address differences
-
DllMain Call: Calls the DLL's entry point
The UAC bypass is performed by using the Windows internal ICMLuaUtil COM interface:
- Create COM Moniker: Generates a moniker in the format
Elevation:Administrator!new:{CLSID} - Create COM Object: Calls
CoGetObjectto create an elevated COM instance - ShellExec Call: Uses
ICMLuaUtil::ShellExecto run the target program with elevated privileges
[DLL Injection] → [ReflectiveLoader] → [DllMain] → [CMLuaUtilBypassUAC] → [Elevated Program]
- Visual Studio 2022
- Windows SDK
- C/C++ Compiler
- Windows Vista or later (systems that support UAC)
- A non-administrator user account (recommended for testing UAC bypass)
-
Clone or download the project
-
Open
reflective_dll.slnin Visual Studio -
Build the project:
Build→Build Solution(Ctrl+Shift+B)
This DLL must be injected into a target process using reflective injection. When injected:
ReflectiveLoaderis invoked- The DLL loads itself into memory
DllMainis called withDLL_PROCESS_ATTACH- The target program path is read from the
lpReservedparameter CMLuaUtilBypassUACperforms the UAC bypass
// Example: Loader injecting the DLL
// 1. Load DLL into memory
LPVOID pDllBuffer = LoadDllFromFile("comBypassUac.dll");
// 2. Find the ReflectiveLoader function
REFLECTIVELOADER pReflectiveLoader = GetReflectiveLoader(pDllBuffer);
// 3. Prepare the target program path
char* targetProgram = "C:\\Windows\\System32\\cmd.exe";
// 4. Call ReflectiveLoader (passing the program path via lpReserved)
pReflectiveLoader(targetProgram);The DLL receives the target program path via the lpReserved parameter.
This is the program that will be executed with elevated privileges after the UAC bypass.
- Main DLL entry point (
DllMain) CMLuaUtilBypassUAC: The UAC bypass functionCoCreateInstanceAsAdmin: Creates elevated COM instancesICMLuaUtilinterface definitions
ReflectiveLoader: Main function that loads the DLL from memory- PE header parsing
- Import table resolution
- Relocation handling
- Hash-based API resolution
- COM interface definitions for
ICMLuaUtil - CLSID and IID declarations
- Function prototypes
This project relies on the Windows internal ICMLuaUtil interface:
- CLSID:
{3E5FC7F9-9A51-4367-9063-A120244FBEC7}(CMSTPLUA) - IID:
{6EDD6D74-C007-4E75-B76A-E5740995E24C}(ICMLuaUtil)
The reflective loader resolves API functions using precomputed hash values instead of string names, hiding sensitive strings in the binary:
#define KERNEL32DLL_HASH 0x6A4ABC5B
#define LOADLIBRARYA_HASH 0xEC0E4E8E
#define GETPROCADDRESS_HASH 0x7C0DFCAA
#define VIRTUALALLOC_HASH 0x91AFCA54When the DLL is loaded at a different base address, all relative addresses must be corrected. The loader processes the PE relocation table to apply these adjustments.
This project is licensed under the MIT License. For more information, see the LICENSE file.