external/source/rdll_template/README.md
This is a project template for Microsoft Visual Studio to aid in the creation of Reflective DLLs based tools and exploits for the Metasploit Framework.
To install the template, copy the template zip file to the Visual Studio ProjectTemplates directory. The template zip file does not need to be decompressed or extracted. For a default Visual Studio 2019 installation the installation command would be:
copy "Reflective DLL.zip" "%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates"
Note that you may need to create the ProjectTemplates directory if it does not
already exist, which may be the case on a default install.
After the template has been copied, restart Visual Studio then:
Ensure that the ReflectiveDLLInjection submodule has been cloned and is up
to date with: git submodule init; git submodule update. This step only needs
to be done once to populate the necessary files for the build process.
$ git submodule init
Submodule 'external/source/ReflectiveDLLInjection' (https://github.com/rapid7/ReflectiveDLLInjection.git) registered for path 'external/source/ReflectiveDLLInjection'
$ git submodule update
Cloning into '/metasploit-framework/external/source/ReflectiveDLLInjection'...
Submodule path 'external/source/ReflectiveDLLInjection': checked out '88e8e5f109793f09b35cb17a621f33647d644103'
It's important that the built binaries be placed in the data directory for use
by the framework. To copy the built binaries automatically:
Configuration Properties > Build Events > Post-Build Event.data.Exploits are stored in subdirectories of external/source/exploits meaning they
need to traverse up four directories and copy their binaries to data/exploits.
IF EXIST "..\..\..\..\data\exploits\$(ProjectName)\" GOTO COPY
mkdir "..\..\..\..\data\exploits\$(ProjectName)\"
:COPY
copy /y "$(TargetDir)$(TargetFileName)" "..\..\..\..\data\exploits\$(ProjectName)\"
To update the template itself:
rdll_template.sln file in Visual StudioProject > Export Template... and follow the wizard steps