Add payload DLL

Executes a MessageBox on DLL_PROCESS_ATTACH to confirm code execution inside the target process.
This commit is contained in:
Ron Epstein
2026-06-22 18:08:31 +03:00
parent e004ac7cef
commit 5914df4bd2
+24
View File
@@ -0,0 +1,24 @@
// MyDll.c
// Payload DLL for the process injection PoC.
//
// DllMain is the entry point called automatically by Windows when the DLL
// is loaded into a process. On DLL_PROCESS_ATTACH we show a message box
// as visible proof that code execution was achieved inside the target process.
#include <windows.h>
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
// MB_TOPMOST | MB_SETFOREGROUND forces the popup to the front,
// otherwise it may appear hidden behind other windows.
MessageBoxA(
GetForegroundWindow(),
"DLL injected successfully!\nRunning inside the target process.",
"Process Injection PoC",
MB_OK | MB_TOPMOST | MB_SETFOREGROUND
);
}
return TRUE;
}