Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/rdll_template/README.md
Views: 11766
Reflective DLL Project Template
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.
Installation
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:
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:
Select "Create a new project"
Select "Reflective DLL" from the list of project templates
Name the project and set the location within the Metasploit Framework git working tree
For an exploit, this would likely be "CVE-20##-####" for the Project name and "external/source/exploits" for the Location.
For a general tool, this would likely be "external/source" for the Location.
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.
Example Output
Build File Placement
It's important that the built binaries be placed in the data
directory for use by the framework. To copy the built binaries automatically:
Right click the project (usually the only child node of the tree) in the Solution Explorer and select "Properties".
Navigate to
Configuration Properties > Build Events > Post-Build Event
.Set the "Command Line" value to a command that will copy the built binaries to a suitable subdirectory of
data
.
Command Line Example (Exploit)
Exploits are stored in subdirectories of external/source/exploits
meaning they need to traverse up four directories and copy their binaries to data/exploits
.
Template Updates
To update the template itself:
Open the
rdll_template.sln
file in Visual StudioMake the desired changes
Go to
Project > Export Template...
and follow the wizard stepsReplace the zip file in this directory with the newly exported template