monkey/monkey/infection_monkey
Ilija Lazoroski 897bc11d7b Agent: Use distinct fields for SSH Keypair 2022-02-16 18:37:16 +01:00
..
credential_collectors Agent: Use distinct fields for SSH Keypair 2022-02-16 18:37:16 +01:00
exploit Agent, Island: Remove MS08_67 exploiter 2022-01-31 11:11:33 +01:00
i_puppet Agent: Add SSH keypair credential type 2022-02-16 17:29:21 +01:00
master Agent: refactor ssh fingerprinter to fit the new model 2022-02-10 07:10:45 -05:00
model Merge branch 'release/1.13.0' into agent-refactor 2022-01-25 13:35:49 -05:00
network Agent: Add sleep back into _check_tcp_ports() 2022-02-10 18:14:36 +01:00
payload Agent: Extract code from try/except in _leave_readme_in_target_directory 2022-01-25 19:57:07 -05:00
post_breach Agent: Don't download exe on Linux during signed script PBA execution 2021-11-12 07:58:04 -05:00
puppet Agent: Implement scan_tcp_ports in tcp_scanner 2022-02-08 15:03:12 -05:00
pyinstaller_hooks Agent: Add pyinstaller hooks for pypsrp 2021-08-25 14:44:31 -04:00
system_info Merge pull request #1715 from guardicore/1695-credential-collectors 2022-02-15 14:34:47 -05:00
telemetry Agent: Add T1145 attack telemetry 2022-02-16 15:44:35 +01:00
transport Agent: Remove do_POST in HTTPConnectProxyHandler 2022-02-01 16:39:57 +01:00
utils Merge pull request #1712 from guardicore/1696-refactor-aws-collector 2022-02-14 17:12:28 +02:00
Pipfile Agent: bumped pyinstaller to 4.9 and locked pywin32 to windows 2022-02-11 17:24:33 +02:00
Pipfile.lock Agent: bumped pyinstaller to 4.9 and locked pywin32 to windows 2022-02-11 17:24:33 +02:00
__init__.py Remove "__author__" lines from the source code 2021-07-28 12:43:28 -04: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 Agent, Island: Remove MS08_67 exploiter 2022-01-31 11:11:33 +01:00
control.py Agent: Remove started_on_island logic 2021-12-08 21:48:13 +05:30
dropper.py Agent, UT: Remove --vulnerable-port CLI argument 2021-12-07 13:10:04 -05:00
example.conf Agent, Island: Remove MS08_67 exploiter 2022-01-31 11:11:33 +01:00
i_control_channel.py Agent: Implement should retry task in automated master 2021-12-15 16:57:39 +01:00
i_master.py Agent: Add block parameter to IMaster.terminate() 2021-12-15 10:12:10 -05:00
main.py Agent: use the refactored startup instead of legacy methods (monkey.start() instead of monkey.legacy_start(), etc.) 2021-12-01 17:04:45 +02:00
monkey.ico Move everything under monkey 2018-05-23 16:05:41 +03:00
monkey.py Agent: Run AWS Environment check in a thread 2022-02-14 16:00:38 +01:00
monkey.spec Agent: Remove sambacry binaries from monkey spec 2022-02-09 08:25:20 -05:00
monkeyfs.py Remove "__author__" lines from the source code 2021-07-28 12:43:28 -04:00
readme.md Agent: remove sambacry exploiter code and related infrastructure/docs 2021-11-10 15:43:51 +02:00
system_singleton.py Agent: Remove option for custom singleton mutex name and add it as a constant 2021-11-16 11:33:42 +05:30
tunnel.py Agent, UT: Implement VictimHostFactory 2021-12-16 14:39:54 -05:00
windows_upgrader.py Replace "LOG" naming convention with "logger" naming convention. 2021-08-31 09:51:34 -04: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 a PyInstaller compressed python archives.

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. 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.

  1. 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
  2. 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
  3. Install the python packages listed in requirements.txt using pip

    • cd [code location]/infection_monkey
    • python3.7 -m pipenv lock -r --dev > requirements.txt
    • python3.7 -m pip install -r requirements.txt
  4. To build, run in terminal:

    • cd [code location]/infection_monkey
    • chmod +x build_linux.sh
    • pipenv run ./build_linux.sh

    output is placed under dist/monkey32 or dist/monkey64 depending on your version of python

Troubleshooting

Some of the possible errors that may come up while trying to build the infection monkey:

Linux

When committing your changes for the first time, you may encounter some errors thrown by the pre-commit hooks. This is most likely because some python dependencies are missing from your system. To resolve this, use pipenv to create a requirements.txt for both the infection_monkey/ and monkey_island/ requirements and install it with pip.

  • cd [code location]/infection_monkey
  • python3.7 -m pipenv lock -r --dev > requirements.txt
  • python3.7 -m pip install -r requirements.txt

and

  • cd [code location]/monkey_island
  • python3.7 -m pipenv lock -r --dev > requirements.txt
  • python3.7 -m pip install -r requirements.txt