036a382e95
2323 use socketaddress in running on island |
||
---|---|---|
.. | ||
credential_collectors | ||
credential_repository | ||
exploit | ||
i_puppet | ||
island_api_client | ||
master | ||
model | ||
network | ||
network_scanning | ||
payload | ||
post_breach | ||
puppet | ||
pyinstaller_hooks | ||
telemetry | ||
transport | ||
utils | ||
Pipfile | ||
Pipfile.lock | ||
__init__.py | ||
agent_event_forwarder.py | ||
build_linux.sh | ||
build_windows.bat | ||
config.py | ||
control.py | ||
custom_types.py | ||
dropper.py | ||
i_control_channel.py | ||
i_master.py | ||
main.py | ||
monkey.ico | ||
monkey.py | ||
monkey.spec | ||
readme.md | ||
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
-
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.
- Run the following command on a cmd console (Replace C:\Python37 with your python directory if it's different)
-
Install further dependencies
- if not installed, install Microsoft Visual C++ 2017 SP1 Redistributable Package
-
Download the dependent python packages using
pip install -r requirements.txt
-
Download and extract UPX binary to monkey\infection_monkey\bin\upx.exe: https://github.com/upx/upx/releases/download/v3.94/upx394w.zip
-
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.
-
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
-
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
-
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
-
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