2013-09-03 14:31:38 +02:00
|
|
|
@ECHO OFF
|
2013-09-16 23:24:27 +02:00
|
|
|
IF "%1"=="clean" GOTO CLEAN
|
2013-09-26 00:05:05 +02:00
|
|
|
IF "%1"=="docs" GOTO DOCS
|
2013-10-29 04:46:46 +01:00
|
|
|
IF "%VCINSTALLDIR%" == "" GOTO NEED_VS
|
2014-01-07 22:56:15 +01:00
|
|
|
IF NOT EXIST "source\ReflectiveDLLInjection\.git" (
|
2014-01-07 22:37:01 +01:00
|
|
|
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
|
|
|
|
)
|
2013-09-26 00:05:05 +02:00
|
|
|
|
2020-04-14 06:24:30 +02:00
|
|
|
SET PSSDK_VER=19
|
2020-04-21 00:10:42 +02:00
|
|
|
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
|
|
|
|
)
|
2013-11-07 22:18:41 +01:00
|
|
|
|
2013-09-14 14:16:58 +02:00
|
|
|
SET PREF=
|
2015-06-01 15:28:12 +02:00
|
|
|
IF EXIST "..\..\..\pssdk\PSSDK_VC%PSSDK_VER%_LIB\_Libs\pssdk_vc%PSSDK_VER%_mt.lib" SET PREF=r7_
|
2013-09-14 14:16:58 +02:00
|
|
|
|
2013-09-03 14:31:38 +02:00
|
|
|
IF "%1"=="x86" GOTO BUILD_X86
|
2013-11-21 03:06:50 +01:00
|
|
|
IF "%1"=="X86" GOTO BUILD_X86
|
|
|
|
IF "%1"=="x64" GOTO BUILD_X64
|
2013-09-03 16:00:34 +02:00
|
|
|
IF "%1"=="X64" GOTO BUILD_X64
|
2020-12-20 16:47:39 +01:00
|
|
|
IF "%1"=="debug_x86" GOTO DEBUG_BUILD_X86
|
|
|
|
IF "%1"=="debug_x64" GOTO DEBUG_BUILD_X64
|
|
|
|
IF "%1"=="debug_X86" GOTO DEBUG_BUILD_X86
|
|
|
|
IF "%1"=="debug_X64" GOTO DEBUG_BUILD_X64
|
2013-09-03 16:00:34 +02:00
|
|
|
|
|
|
|
ECHO "Building Meterpreter x64 and x86 (Release)"
|
|
|
|
SET PLAT=all
|
|
|
|
GOTO RUN
|
2013-09-03 14:31:38 +02:00
|
|
|
|
|
|
|
:BUILD_X86
|
|
|
|
ECHO "Building Meterpreter x86 (Release)"
|
|
|
|
SET PLAT=x86
|
|
|
|
GOTO RUN
|
|
|
|
|
2020-12-20 16:47:39 +01:00
|
|
|
:DEBUG_BUILD_X86
|
|
|
|
ECHO "Building Meterpreter x86 (Debug)"
|
|
|
|
SET PREF=debug_
|
|
|
|
SET PLAT=x86
|
|
|
|
GOTO RUN
|
|
|
|
|
2013-09-03 14:31:38 +02:00
|
|
|
:BUILD_X64
|
|
|
|
ECHO "Building Meterpreter x64 (Release)"
|
|
|
|
SET PLAT=x64
|
|
|
|
GOTO RUN
|
|
|
|
|
2020-12-20 16:47:39 +01:00
|
|
|
:DEBUG_BUILD_X64
|
|
|
|
ECHO "Building Meterpreter x64 (Debug)"
|
|
|
|
SET PREF=debug_
|
|
|
|
SET PLAT=x64
|
|
|
|
GOTO RUN
|
|
|
|
|
2013-09-03 14:31:38 +02:00
|
|
|
:RUN
|
|
|
|
PUSHD workspace
|
2020-04-21 00:10:42 +02:00
|
|
|
msbuild.exe make.msbuild /target:%PREF%%PLAT% /p:PlatformToolset=%PTS_VER%
|
2013-09-03 14:31:38 +02:00
|
|
|
POPD
|
2013-11-07 22:18:41 +01:00
|
|
|
|
|
|
|
IF "%ERRORLEVEL%" == "0" (
|
2015-06-01 15:28:12 +02:00
|
|
|
IF NOT EXIST "..\..\..\pssdk\" (
|
2013-11-14 19:23:07 +01:00
|
|
|
ECHO Unable to build ext_server_sniffer:
|
|
|
|
ECHO PSSDK directory not found.
|
|
|
|
ECHO This is normal if you do not expect to have access to Rapid7 proprietary
|
|
|
|
ECHO sniffer source. Meterpreter will still function normally without this.
|
2013-11-07 22:18:41 +01:00
|
|
|
) else (
|
2015-06-01 15:28:12 +02:00
|
|
|
IF NOT EXIST "..\..\..\pssdk\PSSDK_VC%PSSDK_VER%_LIB\_Libs\pssdk_vc%PSSDK_VER%_mt.lib" (
|
2013-11-14 19:23:07 +01:00
|
|
|
ECHO Unable to build ext_server_sniffer:
|
|
|
|
ECHO PSSDK lib version 'vc%PSSDK_VER%' not found.
|
|
|
|
ECHO This is normal if you do not expect to have access to Rapid7 proprietary
|
|
|
|
ECHO sniffer source. Meterpreter will still function normally without this.
|
2013-11-07 22:18:41 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2013-11-22 03:12:48 +01:00
|
|
|
FOR /F "usebackq tokens=1,2 delims==" %%i IN (`wmic os get LocalDateTime /VALUE 2^>NUL`) DO IF '.%%i.'=='.LocalDateTime.' SET LDT=%%j
|
|
|
|
SET LDT=%LDT:~0,4%-%LDT:~4,2%-%LDT:~6,2% %LDT:~8,2%:%LDT:~10,2%:%LDT:~12,6%
|
|
|
|
echo Finished %ldt%
|
|
|
|
|
2014-01-07 22:37:01 +01:00
|
|
|
GOTO END
|
2013-09-03 14:31:38 +02:00
|
|
|
|
2013-09-16 23:24:27 +02:00
|
|
|
:CLEAN
|
2020-04-21 02:21:51 +02:00
|
|
|
IF EXIST "output\" (
|
|
|
|
del output\ /S /Q
|
2013-09-16 23:24:27 +02:00
|
|
|
)
|
2014-01-07 22:37:01 +01:00
|
|
|
GOTO END
|
2013-09-16 23:24:27 +02:00
|
|
|
|
2013-09-26 00:05:05 +02:00
|
|
|
:DOCS
|
|
|
|
tools\doxygen\doxygen.exe doxygen.cnf
|
2014-01-07 22:37:01 +01:00
|
|
|
GOTO END
|
2013-09-26 00:05:05 +02:00
|
|
|
|
2013-09-03 14:31:38 +02:00
|
|
|
:NEED_VS
|
|
|
|
ECHO "This command must be executed from within a Visual Studio Command prompt."
|
2020-04-21 01:37:11 +02:00
|
|
|
ECHO "This can be found under Microsoft Visual Studio (2013|2017|2019) -> Visual Studio Tools"
|
2013-09-03 14:31:38 +02:00
|
|
|
|
|
|
|
:END
|