Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 1 addition & 31 deletions c/meterpreter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,36 +40,6 @@ If you don't have an installation ready, follow these steps:
choco install visualstudio2019community -y --package-parameters "--config C:\YOUR_PATH\metasploit-payloads\c\meterpreter\vs-configs\vs2019.vsconfig"
```

### VS 2017
Building with VS2017 works with any version, including community. If you have an installation already, just make sure you have the following extra bits installed:

* Under `Workloads`:
* `Desktop Development with C++`
* Under `Individual Components`:
* `Windows XP support for C++`

If you don't have an installation ready, follow these steps:

1. Install [Chocolatey](https://chocolatey.org).
2. Install VS with all the required components by running the following command in Powershell:
```
choco install visualstudio2017community -y --package-parameters "--config C:\YOUR_PATH\metasploit-payloads\c\meterpreter\vs-configs\vs2017.vsconfig"
```

Note: A copy of this file is located in this repository under `c/meterpreter/vs-config/vs2017.vsconfig`.

### VS 2013
Download and install the `Visual Studio Express 2013 for Windows Desktop` edition. It is important that you use _this exact version_. To do this with Chocolatey, run the following:

```
choco install visualstudioexpress2013windowsdesktop -y
```

Nothing extra needs to be done.

At this point the dependencies will be ready to use and Meterpreter should be ready to
build.

### Running the Build

Open up a Visual Studio command prompt by selecting `Developer Command Prompt for VS201X`
Expand All @@ -84,7 +54,7 @@ meterpreter source is located. From here you can:
* Build the x64 version by running: `make x64`
* Build both x86 and x64 versions by running: `make`

If you want to build binaries with the `v120_xp` toolset instead of `v141_xp` while using VS2017 or VS2019, you must first install VS2013 as shown above. Then, pass `v120_xp` as a parameter when running `make` (eg. `make v120_xp x64`). The Rapid7 build automation uses v120_xp to build the distributed binaries, so projects must build with that platform toolset.
The Rapid7 build automation uses v141_xp to build the distributed binaries, so projects must build with that platform toolset.

The compiled binaries are written to the `output` folder.

Expand Down
120 changes: 0 additions & 120 deletions c/meterpreter/make-cmake.bat

This file was deleted.

25 changes: 9 additions & 16 deletions c/meterpreter/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@
IF "%1"=="clean" GOTO CLEAN
IF "%1"=="docs" GOTO DOCS
IF "%VCINSTALLDIR%" == "" GOTO NEED_VS
IF NOT EXIST "source\ReflectiveDLLInjection\.git" (
ECHO Meterpreter's submodule dependencies can't be found.
ECHO From your git console, please run:
ECHO $ git submodule init ^&^& git submodule update
GOTO END
)
IF NOT EXIST "source\ReflectiveDLLInjection\.git" GOTO NEED_RDLL

SET PSSDK_VER=19
SET PTS_VER=v141_xp

IF "%1"=="v120_xp" SET PTS_VER=%1
IF "%2"=="v120_xp" SET PTS_VER=%2
IF "%3"=="v120_xp" SET PTS_VER=%3

IF "%VisualStudioVersion%" == "12.0" (
SET PSSDK_VER=12
SET PTS_VER=v120_xp
)

SET PREF=
IF EXIST "..\..\..\pssdk\PSSDK_VC%PSSDK_VER%_LIB\_Libs\pssdk_vc%PSSDK_VER%_mt.lib" SET PREF=r7_

Expand Down Expand Up @@ -95,8 +81,15 @@ GOTO END
tools\doxygen\doxygen.exe doxygen.cnf
GOTO END

:NEED_RDLL
ECHO Meterpreter's submodule dependencies can't be found.
ECHO From your git console, please run:
ECHO $ git submodule init ^&^& git submodule update
GOTO END

:NEED_VS
ECHO "This command must be executed from within a Visual Studio Command prompt."
ECHO "This can be found under Microsoft Visual Studio (2013|2017|2019) -> Visual Studio Tools"
ECHO "This can be found under Microsoft Visual Studio 20XX > Visual Studio Tools"
ECHO "Visual Studio 2017 or later is required (v141_xp toolchain)."

:END
11 changes: 0 additions & 11 deletions c/meterpreter/vs-configs/vs2017.vsconfig

This file was deleted.

6 changes: 1 addition & 5 deletions c/meterpreter/workspace/ext_server_sniffer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ include_directories(../../source/common)
include_directories(../../source/ReflectiveDllInjection/common)
include_directories(${PSSDK_DIR}/_include)

if(${CMAKE_GENERATOR_TOOLSET} MATCHES "v120_xp")
set(PSSDK_VER 12)
else()
set(PSSDK_VER 19)
endif()
set(PSSDK_VER 19)

set(SRC_DIR ../../source/extensions/sniffer)
file(GLOB SRC_FILES
Expand Down
10 changes: 2 additions & 8 deletions c/meterpreter/workspace/meterpreter.props
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<XPDeprecationWarning>false</XPDeprecationWarning>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(VisualStudioVersion)'=='12.0'">
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Globals" Condition="'$(PlatformToolset)'=='v120_xp'">
<PssdkVersion>vc12</PssdkVersion>
</PropertyGroup>
<PropertyGroup Label="Globals" Condition="'$(PlatformToolset)'!='v120_xp'">
<PropertyGroup Label="Globals">
<PssdkVersion>vc19</PssdkVersion>
</PropertyGroup>
<ItemDefinitionGroup />
Expand Down
Loading