monkey/chaos_monkey
Itay Mizeretz 27be13b48a Rephrase readmes 2017-10-17 17:14:28 +03:00
..
exploit Fix CR 2017-10-16 10:58:11 +03:00
model Py3 + added additional string output. 2017-10-15 19:07:20 +03:00
monkey_utils/sambacry_monkey_runner Fix SambaCry not working for non-root user 2017-10-02 17:11:51 +03:00
network Remove relative range option from config 2017-10-17 11:55:27 +03:00
system_info Fix mimikatz lowercase hostname comparison 2017-10-02 12:14:31 +03:00
test Don't crash when receiving unknown configuration variables 2016-09-27 23:56:26 +03:00
transport Fix inconsistent return value in send_head 2017-10-02 12:40:53 +03:00
build_linux.sh pyinstaller run clean 2015-12-31 09:57:29 +02:00
build_windows.bat remove fully qualified path 2017-10-02 12:40:53 +03:00
config.py Remove relative range option from config 2017-10-17 11:55:27 +03:00
control.py PEP8+python exceptions 2017-10-02 12:40:53 +03:00
dropper.py PEP8 + Python exception 2017-10-02 12:40:53 +03:00
example.conf Remove relative range option from config 2017-10-17 11:55:27 +03:00
main.py Expand config env variables on demand 2017-09-27 11:24:42 +03:00
monkey-linux.spec fix linux paths on spec 2017-08-31 17:56:35 +03:00
monkey.ico first commit 2015-08-30 10:27:35 +03:00
monkey.py Simplified generic attack logic 2017-10-15 19:32:19 +03:00
monkey.spec sambacry: Add support for using both architectures 2017-08-30 10:16:54 +03:00
monkeyfs.py Added grequests to hidden imports. 2016-09-04 13:45:49 +03:00
readme.txt Rephrase readmes 2017-10-17 17:14:28 +03:00
requirements.txt Require lower version of psutil for Windows 2003/XP and under 2017-10-09 14:39:11 +03:00
system_singleton.py PEP8 + Python exceptions 2017-10-02 12:40:53 +03:00
tunnel.py PEP8 + new exception format. 2017-10-02 12:40:53 +03:00

readme.txt

How to build a monkey binary from scratch.

The monkey is composed of three separate parts.
* The Infection Monkey itself - PyInstaller compressed python archives
* Sambacry binaries - Two linux binaries, 32/64 bit.
* Mimikatz binaries - Two windows binaries, 32/64 bit.

--- Windows ---

1. Install python 2.7. Preferably you should use ActiveState Python which includes pywin32 built in. 
    You must use an up to date version, at least version 2.7.10
    https://www.python.org/download/releases/2.7/
    If not using ActiveState, install pywin32, minimum build 219
    http://sourceforge.net/projects/pywin32/files/pywin32
3. a. install VCForPython27.msi
    https://aka.ms/vcpython27
   b. if not installed, install Microsoft Visual C++ 2010 SP1 Redistributable Package
    32bit: http://www.microsoft.com/en-us/download/details.aspx?id=8328
    64bit: http://www.microsoft.com/en-us/download/details.aspx?id=13523
4. Download the dependent python packages using 
    pip install -r requirements.txt
5. Download and extract UPX binary to [source-path]\monkey\chaos_monkey\bin\upx.exe:
    https://github.com/upx/upx/releases/download/v3.94/upx394w.zip
6. To build the final exe:
    cd [code location]/chaos_monkey
    build_windows.bat 
    output is placed under dist\monkey.exe

--- Linux ---

Tested on Ubuntu 16.04 and 17.04.

1. Run:
    sudo apt-get update
    sudo apt-get install python-pip python-dev libffi-dev upx libssl-dev libc++1
    Install the python packages listed in requirements.txt using pip
        pip install -r requirements.txt
2. Place the source code in code/monkey/chaos_monkey
3. To build, run in terminal:
    cd [code location]/chaos_monkey
    chmod +x build_linux.sh
    ./build_linux.sh
   output is placed under dist/monkey

-- Sambacry --

Sambacry requires two standalone binaries to execute remotely.
Compiling them requires gcc.
cd [code location]/chaos_monkey/monkey_utils/sambacry_monkey_runner
./build.sh

-- Mimikatz --

Mimikatz is required for the Monkey to be able to steal credentials on Windows. It's possible to either compile from sources (requires Visual Studio 2013 and up) or download the binaries from 
https://github.com/guardicore/mimikatz/releases/tag/1.0.0
Download both 32 and 64 bit DLLs and place them under [code location]\chaos_monkey\bin