monkey/monkey/monkey_island
Shreya 80c8a42bd0 Mentioning 'type' doesn't seem necessary 2020-06-24 14:36:03 +05:30
..
cc Mentioning 'type' doesn't seem necessary 2020-06-24 14:36:03 +05:30
deb-package No need to qualify python since we sourced `activate` 2020-04-12 19:26:26 +03:00
linux Merge branch 'monkey_telemetry_fabrication' into zt_performance_fixes 2020-05-11 16:42:53 +03:00
pyinstaller_hooks Added pyinstaller hook for stix2 module 2020-04-16 23:22:58 +03:00
scripts Fixed double parentheses in print method invocations 2019-10-10 16:41:47 +03:00
windows CR improvement 2019-11-19 12:46:46 +02:00
__init__.py Move everything under monkey 2018-05-23 16:05:41 +03:00
monkey_island.ico Merge branch 'master' into develop 2019-04-14 16:39:15 +03:00
monkey_island.spec Trying to disable UPX to make it work on 2012 R2 2020-04-20 09:37:53 +03:00
readme.md dev-setup: Fix minor issues in dev-setup readme 2020-03-07 14:45:48 +05:30
requirements.txt Merge remote-tracking branch 'upstream/develop' into monkey_telemetry_fabrication 2020-05-07 12:15:43 +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 Island manually, refer to the instructions below.

How to set up the Monkey Island server

On Windows

  1. Exclude the folder you are planning to install the Monkey in from your AV software, as it might block or delete files from the installation.

  2. Create folder "bin" under monkey\monkey_island

  3. Place portable version of Python 3.7.4

  4. Install Island's requirements

    • python -m pip install -r monkey\monkey_island\requirements.txt
  5. Setup mongodb (Use one of the following two options):

    OR

    • Use already running instance of mongodb
      1. Run 'set MONKEY_MONGO_URL="mongodb://:27017/monkeyisland"'. Replace '' with address of mongo server
  6. Place portable version of OpenSSL

  7. Download and install Microsoft Visual C++ redistributable for Visual Studio 2017

  8. Generate SSL Certificate

    • run ./windows/create_certificate.bat when your current working directory is monkey_island
  9. 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 monkey-windows-64.exe - monkey binary for windows 64bit

  10. Install npm

  11. Build Monkey Island frontend

    • cd to 'monkey_island\cc\ui'
    • run 'npm update'
    • run 'npm run dist'

How to run

  1. When your current working directory is monkey_island, run monkey_island\windows\run_server_py.bat

On Linux

  1. Get python 3.7 and pip if your linux distribution doesn't have it built in (following steps are for Ubuntu 16):

    • sudo add-apt-repository ppa:deadsnakes/ppa
    • sudo apt-get update
    • sudo apt install python3.7 python3-pip python3.7-dev
    • python3.7 -m pip install pip
  2. Install required packages:

    • sudo apt-get install libffi-dev upx libssl-dev libc++1 openssl
  3. Create the following directories in monkey island folder (execute from ./monkey):

    • mkdir -p ./monkey_island/bin/mongodb
    • mkdir -p ./monkey_island/db
    • mkdir -p ./monkey_island/cc/binaries
  4. Install the packages from monkey_island/requirements.txt:

    • sudo python3.7 -m pip install -r ./monkey_island/requirements.txt
  5. Put monkey binaries in /monkey_island/cc/binaries (binaries can be found in releases on github).

    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 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 monkey/monkey_island/bin/mongodb:
      1. Run ./monkey_island/linux/install_mongo.sh ./monkey_island/bin/mongodb. This will download and extract the relevant mongoDB for your OS.

    OR

    • Use already running instance of mongodb
      1. Run set MONKEY_MONGO_URL="mongodb://<SERVER ADDR>:27017/monkeyisland". Replace '' with address of mongo server
  7. Generate SSL Certificate:

    • cd ./monkey_island
    • chmod 755 ./linux/create_certificate.sh
    • ./linux/create_certificate.sh
  8. Install npm and node by running:

    • sudo apt-get install curl
    • curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    • sudo apt-get install -y nodejs
  9. Build Monkey Island frontend

    • cd to 'monkey_island/cc/ui'
    • npm install sass-loader node-sass webpack --save-dev
    • npm update
    • npm run dist

How to run

  1. When your current working directory is monkey, run chmod 755 ./monkey_island/linux/run.sh followed by ./monkey_island/linux/run.sh (located under /linux)