monkey/monkey/infection_monkey
Ace Pace 1f11173545 Remove reg_utils, unused file.
Moved WMI imports to be gated behind win32 check.
Set wmi package to be installed only on win32 platform.

The mongo_utils and wmi_utils modules are only imported by the windows_info_collector which is only imported if we're on windows.
2020-05-11 14:35:24 +03:00
..
exploit Fix a few more. Re set the number of flake warnings to be higher :( 2020-05-05 23:47:41 +03:00
model Fix really random linting errors from flake8 2020-05-01 13:00:54 +03:00
network Fix really random linting errors from flake8 2020-05-01 13:00:54 +03:00
post_breach Improved the monkey start function structure a bit, extracted to functions 2020-01-01 15:33:02 +02:00
pyinstaller_hooks Add pyinstaller hook for systeminfo plugins 2020-01-21 17:31:57 +02:00
system_info Fix really random linting errors from flake8 2020-05-01 13:00:54 +03:00
telemetry Renamed display to log 2020-04-12 19:58:20 +03:00
transport Fix really random linting errors from flake8 2020-05-01 13:00:54 +03:00
utils Fix really random linting errors from flake8 2020-05-01 13:00:54 +03:00
__init__.py Move everything under monkey 2018-05-23 16:05:41 +03:00
build_linux.sh Added version argument to monkey build scripts 2020-02-09 15:20:34 +02:00
build_windows.bat Added version argument to monkey build scripts 2020-02-09 15:20:34 +02:00
config.py Merge pull request #522 from guardicore/feature/521-environment-check 2020-01-21 16:20:33 +02:00
control.py Fix spacing 2019-11-28 12:46:33 +01:00
dropper.py Auto reformat all code 2019-10-28 21:11:05 +02:00
example.conf Auto reformat all code 2019-10-28 21:11:05 +02:00
main.py Logging version when initializing Monkey and Island. 2020-02-09 11:20:29 +02:00
monkey.ico Move everything under monkey 2018-05-23 16:05:41 +03:00
monkey.py Added depth logging for easier debugging down the line 2020-05-10 15:09:43 +03:00
monkey.spec The tuple is from source file to dst folder 2020-03-01 18:00:57 +02:00
monkeyfs.py Intentional shadowing of builtins 2019-10-28 16:15:52 +02:00
pyinstaller_utils.py Auto reformat all code 2019-10-28 21:11:05 +02:00
readme.md dev-setup: Fix minor issues in dev-setup readme 2020-03-07 14:45:48 +05:30
requirements.txt Remove reg_utils, unused file. 2020-05-11 14:35:24 +03:00
system_singleton.py Auto reformat all code 2019-10-28 21:11:05 +02:00
tunnel.py Removed unnecessary comments, unused file, improved parsing of linux requests 2020-03-12 15:56:06 +02:00
windows_upgrader.py Broke monkey_utils to utils/ and moved sambacry_runner to exploit. This commit is 100% refactoring without any new code, just deleted unused utils. 2019-09-16 13:00:42 +03:00

readme.md

Monkey island dev. env. setup guide

To easily setup development environment for Monkey Island and the Monkey look into deployment scripts folder. If you want to setup dev. env. for the Monkey manually, refer to the instructions below.

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.
  • Traceroute binaries - Two linux binaries, 32/64bit.

Windows

  1. Install python 3.7.4 and choose ADD to PATH option when installing.

    Download and install from: https://www.python.org/ftp/python/3.7.4/

    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
    • Close the console, make sure you execute all commands in a new cmd console from now on.
  2. Install further dependencies

  3. Download the dependent python packages using pip install -r requirements.txt

  4. Download and extract UPX binary to monkey\infection_monkey\bin\upx.exe: https://github.com/upx/upx/releases/download/v3.94/upx394w.zip

  5. Build/Download Sambacry and Mimikatz binaries

    • Build/Download according to sections at the end of this readme.
    • 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\monkey32.exe or dist\monkey64.exe depending on your version of Python

Linux

Tested on Ubuntu 16.04. 0. On older distributions of Ubuntu (16.04) you'll need to download python3.7 via ppa: - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt install python3.7

  1. Install dependencies by running:

    • sudo apt install python3-pip
    • python3.7 -m pip install pip
    • 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
    • python3.7 -m pip install -r requirements.txt
  3. Build Sambacry binaries

    • Build/Download according to sections at the end of this readme.
    • Place the binaries under [code location]/infection_monkey/bin, under the names 'sc_monkey_runner32.so', 'sc_monkey_runner64.so'
  4. Build Traceroute binaries

    • Build/Download according to sections at the end of this readme.
    • 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/monkey32 or dist/monkey64 depending on your version of python

Sambacry

Sambacry requires two standalone binaries to execute remotely.

  1. Build sambacry binaries yourself

    • Install gcc-multilib if it's not installed sudo apt-get install gcc-multilib
    • Build the binaries
      1. cd [code location]/infection_monkey/exploit/sambacry_monkey_runner
      2. ./build.sh
  2. Download our pre-built sambacry binaries

Mimikatz

Mimikatz is required for the Monkey to be able to steal credentials on Windows. It's possible to either compile binaries from source (requires Visual Studio 2013 and up) or download them from our repository.

  1. Build Mimikatz yourself

    • Building mimikatz requires Visual Studio 2013 and up
    • Clone our version of mimikatz from https://github.com/guardicore/mimikatz/tree/1.1.0
    • Build using Visual Studio.
    • Put each version in a zip file
      1. The zip should contain only the Mimikatz DLL named tmpzipfile123456.dll
      2. It should be protected using the password 'VTQpsJPXgZuXhX6x3V84G'.
      3. The zip file should be named mk32.zip/mk64.zip accordingly.
      4. Zipping with 7zip has been tested. Other zipping software may not work.
  2. Download our pre-built mimikatz binaries

Traceroute

Traceroute requires two standalone binaries to execute remotely. The monkey carries the standalone binaries since traceroute isn't built in all Linux distributions. You can either build them yourself or download pre-built binaries.

  1. Build traceroute yourself
  2. Download our pre-built traceroute binaries