From a6a8ae9783cad28791dc9b3918d81057ef95938a Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 19 Nov 2019 10:59:04 +0200 Subject: [PATCH] run_cc.bat bugfix and more readme style improvements --- monkey/infection_monkey/readme.md | 44 +++++++++++++------------ monkey/monkey_island/readme.md | 23 +++++++------ monkey/monkey_island/windows/run_cc.bat | 4 +-- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/monkey/infection_monkey/readme.md b/monkey/infection_monkey/readme.md index cadf1e5d8..6db622eeb 100644 --- a/monkey/infection_monkey/readme.md +++ b/monkey/infection_monkey/readme.md @@ -12,25 +12,27 @@ The monkey is composed of three separate parts. ## Windows -1. Install python 3.7.4 +1. Install python 3.7.4 and choose **ADD to PATH** option when installing. + Download and install from: -2. Add python directories to PATH environment variable - 1. Run the following command on a cmd console (Replace C:\Python37 with your python directory if it's different) + + In case you still need to add python directories to path: + - Run the following command on a cmd console (Replace C:\Python37 with your python directory if it's different) `setx /M PATH "%PATH%;C:\Python37;C:\Python37\Scripts` - 2. Close the console, make sure you execute all commands in a new cmd console from now on. -3. Install further dependencies - 1. if not installed, install Microsoft Visual C++ 2017 SP1 Redistributable Package - 32bit: - 64bit: -4. Download the dependent python packages using - pip install -r requirements_windows.txt -5. Download and extract UPX binary to [source-path]\monkey\infection_monkey\bin\upx.exe: + - Close the console, make sure you execute all commands in a new cmd console from now on. +2. Install further dependencies + - if not installed, install Microsoft Visual C++ 2017 SP1 Redistributable Package + - 32bit: + - 64bit: +3. Download the dependent python packages using + `pip install -r requirements_windows.txt` +4. Download and extract UPX binary to monkey\infection_monkey\bin\upx.exe: -6. Build/Download Sambacry and Mimikatz binaries +5. Build/Download Sambacry and Mimikatz binaries - Build/Download according to sections at the end of this readme. - - Place the binaries under [code location]\infection_monkey\bin -7. To build the final exe: - - `cd [code location]/infection_monkey` + - Place the binaries under monkey\infection_monkey\bin +6. To build the final exe: + - `cd monkey\infection_monkey` - `build_windows.bat` - `output is placed under dist\monkey.exe` @@ -45,8 +47,7 @@ Tested on Ubuntu 16.04. 1. Install dependencies by running: - `sudo apt install python3-pip` - `python3.7 -m pip install pip` - - `sudo apt-get install python3.7-dev` - - `sudo apt-get install libffi-dev upx libssl-dev libc++1` + - `sudo apt-get install python3.7-dev libffi-dev upx libssl-dev libc++1` 2. Install the python packages listed in requirements.txt using pip - `cd [code location]/infection_monkey` @@ -61,10 +62,11 @@ Tested on Ubuntu 16.04. - Place the binaries under [code location]\infection_monkey\bin, under the names 'traceroute32', 'traceroute64' 5. To build, run in terminal: - `cd [code location]/infection_monkey` - `chmod +x build_linux.sh` - `./build_linux.sh` - `output is placed under dist/monkey` + - `cd [code location]/infection_monkey` + - `chmod +x build_linux.sh` + - `./build_linux.sh` + + output is placed under dist/monkey ### Sambacry diff --git a/monkey/monkey_island/readme.md b/monkey/monkey_island/readme.md index 7bbc53166..b333dab94 100644 --- a/monkey/monkey_island/readme.md +++ b/monkey/monkey_island/readme.md @@ -11,16 +11,12 @@ 2. Create folder "bin" under monkey_island 3. Place portable version of Python 3.7.4 - Download and install from: - - Install virtualenv using "python -m pip install virtualenv" - - Create a virtualenv using "python -m virtualenv --always-copy \Python37" Where is the path to the bin folder created on step 1. - - Run "python -m virtualenv --relocatable \Python37" - - Install the required python libraries using "\Python37\Scripts\python -m pip install -r monkey_island\requirements.txt" - - Copy DLLs from installation path (Usually C:\Python27\DLLs) to \Python37\DLLs - - (Optional) You may uninstall Python3.7 if you like. +4. Install Island's requirements + - `python -m pip install -r monkey_island\requirements.txt` 4. Setup mongodb (Use one of the following two options): - Place portable version of mongodb 1. Download from: - 2. Extract contents from bin folder to monkey_island\bin\mongodb. + 2. Extract contents of bin folder to monkey_island\bin\mongodb. 3. Create monkey_island\db folder. OR @@ -29,12 +25,12 @@ 5. Place portable version of OpenSSL - Download from: - - Extract content from bin folder to monkey_island\bin\openssl + - Extract contents to monkey_island\bin\openssl 6. Download and install Microsoft Visual C++ redistributable for Visual Studio 2017 - Download and install from: 7. Generate SSL Certificate - - run create_certificate.bat when your current working directory is monkey_island -8. Create the monkey_island\cc\binaries folder and put Infection Monkey binaries inside (binaries can be found in releases on github) + - run `./windows/create_certificate.bat` when your current working directory is monkey_island +8. Put Infection Monkey binaries inside monkey_island/cc/binaries (binaries can be found in releases on github or build from source) monkey-linux-64 - monkey binary for linux 64bit monkey-linux-32 - monkey binary for linux 32bit monkey-windows-32.exe - monkey binary for windows 32bit @@ -48,7 +44,7 @@ #### How to run -1. When your current working directory is monkey_island, run monkey_island\windows\run_server.bat +1. When your current working directory is monkey_island, run monkey_island\windows\run_server_py.bat ### On Linux @@ -73,7 +69,10 @@ monkey-linux-64 - monkey binary for linux 64bit monkey-linux-32 - monkey binary for linux 32bit monkey-windows-32.exe - monkey binary for windows 32bit - monkey-windows-64.exe - monkey binary for windows 64bi + monkey-windows-64.exe - monkey binary for windows 64bit + Also, if you're going to run monkeys on local machine execute: + - `chmod 755 ./monkey_island/cc/binaries/monkey-linux-64` + - `chmod 755 ./monkey_island/cc/binaries/monkey-linux-32` 6. Setup MongoDB (Use one of the two following options): - Download MongoDB and extract it to /var/monkey_island/bin/mongodb: diff --git a/monkey/monkey_island/windows/run_cc.bat b/monkey/monkey_island/windows/run_cc.bat index c1a2fd88e..c87f04cec 100644 --- a/monkey/monkey_island/windows/run_cc.bat +++ b/monkey/monkey_island/windows/run_cc.bat @@ -1,5 +1,5 @@ REM - Runs Monkey Island Server using python - @title C^&C Server @pushd .. -@monkey_island\bin\Python27\Scripts\python monkey_island.py -@popd \ No newline at end of file +@python monkey_island.py +@popd