monkey/monkey/infection_monkey
Kekoa Kaaikala 036a382e95
Merge pull request #2354 from guardicore/2323-use-socketaddress-in-running_on_island
2323 use socketaddress in running on island
2022-09-27 09:44:04 -04:00
..
credential_collectors Agent: Fix imports common.events -> common.agent_events 2022-09-16 08:58:02 -04:00
credential_repository Agent: Fix mypy issues in propagation credentials 2022-09-21 17:42:52 +00:00
exploit Agent: Remove stale comment 2022-09-22 13:11:08 +00:00
i_puppet Agent: Move PingScanData to common 2022-09-26 18:52:23 +00:00
island_api_client Agent: Use SocketAddress in IIslandAPIClient 2022-09-27 15:33:28 +05:30
master Merge pull request #2348 from guardicore/2299-rename-local-network-scan 2022-09-27 16:00:36 +03:00
model Agent: Get rid of default_tunnel 2022-09-09 08:19:56 -04:00
network Merge pull request #2354 from guardicore/2323-use-socketaddress-in-running_on_island 2022-09-27 09:44:04 -04:00
network_scanning Merge pull request #2348 from guardicore/2299-rename-local-network-scan 2022-09-27 16:00:36 +03:00
payload Agent: Fix mypy issues in ransomware and encryption 2022-09-23 09:42:25 +03:00
post_breach Agent: Update ControlClient to use SocketAddress 2022-09-27 17:01:47 +05:30
puppet Agent: Move PingScanData to common 2022-09-26 18:52:23 +00:00
pyinstaller_hooks Agent, Island: remove/rename system info collection infrastructure 2022-03-01 14:54:20 +02:00
telemetry Agent: Fix mypy issues in ransomware and encryption 2022-09-23 09:42:25 +03:00
transport Agent: Move IslandAPIClient to island_api_client package 2022-09-19 08:00:00 -04:00
utils Agent: Fix mypy issues in capture_output.py 2022-09-21 22:23:03 +00:00
Pipfile Agent, Island: Add mypy to dev dependencies 2022-09-23 12:40:41 +03:00
Pipfile.lock Agent, Island: Add mypy to dev dependencies 2022-09-23 12:40:41 +03:00
__init__.py
agent_event_forwarder.py Agent: Move AbstractAgentEvent serialization to HTTPIslandAPIClient 2022-09-20 09:45:00 -04:00
build_linux.sh
build_windows.bat
config.py Agent: Remove IGUID from config 2022-08-16 11:58:53 +02:00
control.py Agent: Update ControlClient to use SocketAddress 2022-09-27 17:01:47 +05:30
custom_types.py Agent: Rename typing to custom_types 2022-03-29 14:28:16 -04:00
dropper.py Agent: Add list of servers to dropper 2022-09-09 08:07:24 -04:00
i_control_channel.py Agent: Move register_agent out of ControlChannel 2022-09-20 18:21:55 +00:00
i_master.py
main.py Agent: Remove WormConfiguration and cleanup related infrastructure 2022-06-17 16:40:40 +03:00
monkey.ico
monkey.py Merge pull request #2354 from guardicore/2323-use-socketaddress-in-running_on_island 2022-09-27 09:44:04 -04:00
monkey.spec Agent: Remove T1216_random_executable.exe from agent binary on Linux 2022-04-11 06:35:56 -04:00
readme.md Agent: Update README to remove mentions of 32-bit binaries 2022-02-25 02:28:53 -05:00
system_singleton.py

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\monkey64.exe.

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

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