- First, we need to get shellcode. This can be from an embedded resource, a file on disk, hard-coded shellcode, or even from a remote file on a web server
- Then, allocate some space in memory that that the shellcode can fit into. Make sure its RW or RWX (bad practice)
- Write our shellcode into that memory space
- Make our memory space executable if it isn’t already
- Create a thread that begins at that memory space and make our program wait until the thread finishes so it doesn’t exit and kill the thread before we get our shell
Pinvoke Implementation