Working
- Find a process with necessary rights (such as
PROCESS_ALL_ACCESS) usingCreateToolhelp32Snapshot. - Use
OpenProcessfunction to get a handle to it. - Allocate memory to its address space using
VirtualAllocEx. - Use
WriteProcessMemoryto write the shellcode into the allocated memory. - Create a remote thread to execute the shellcode using
CreateRemoteThread.