Windows (WinSock2.2) Reverse Shell DLL
A simple Reverse Shell as a Dynamic-link library, it's based in this Gist.
It can be used as an exported symbol, needing the call ReverseShell(ip,port) in the remote process, or by doing the call directly inside DllMain, when injecting the DLL. The reverse shell is a child process (cmd.exe) with the STDIO/ERR vinculated in the WinSock context of the parent process.
GCC:
* Don't forget to link using "-shared -lws2_32" and compile with "-DBUILD_DLL"; use "-DDEBUG" for getting a "debug" output :P