mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-12 12:14:29 +01:00

The boiler extension wasn't used and was old so it was removed. I've added a new "bare" extension which is, as it says, just bare and doesn't do anything. This can be used to create new extension projets just by copying and pasting, then editing a couple of small things. This will be added to the documentation.
54 lines
1.4 KiB
C
54 lines
1.4 KiB
C
/*!
|
|
* @file bare.c
|
|
* @brief Entry point and intialisation functionality for the bare extention.
|
|
*/
|
|
#include "../../common/common.h"
|
|
|
|
#include "../../ReflectiveDLLInjection/DelayLoadMetSrv.h"
|
|
// include the Reflectiveloader() function, we end up linking back to the metsrv.dll's Init function
|
|
// but this doesnt matter as we wont ever call DLL_METASPLOIT_ATTACH as that is only used by the
|
|
// second stage reflective dll inject payload and not the metsrv itself when it loads extensions.
|
|
#include "../../ReflectiveDLLInjection/ReflectiveLoader.c"
|
|
|
|
// this sets the delay load hook function, see DelayLoadMetSrv.h
|
|
EnableDelayLoadMetSrv();
|
|
|
|
Command customCommands[] =
|
|
{
|
|
// custom commands go here
|
|
// Terminator
|
|
{ NULL,
|
|
{ EMPTY_DISPATCH_HANDLER },
|
|
{ EMPTY_DISPATCH_HANDLER },
|
|
},
|
|
};
|
|
|
|
/*!
|
|
* @brief Initialize the server extension
|
|
*/
|
|
DWORD __declspec(dllexport) InitServerExtension(Remote *remote)
|
|
{
|
|
DWORD index;
|
|
|
|
hMetSrv = remote->hMetSrv;
|
|
|
|
for (index = 0; customCommands[index].method; index++)
|
|
command_register(&customCommands[index]);
|
|
|
|
return ERROR_SUCCESS;
|
|
}
|
|
|
|
/*!
|
|
* @brief Deinitialize the server extension
|
|
*/
|
|
DWORD __declspec(dllexport) DeinitServerExtension(Remote *remote)
|
|
{
|
|
DWORD index;
|
|
|
|
for (index = 0; customCommands[index].method; index++)
|
|
command_deregister(&customCommands[index]);
|
|
|
|
return ERROR_SUCCESS;
|
|
}
|
|
|