diff --git a/monkey_island/linux/clear_db.sh b/monkey_island/linux/clear_db.sh new file mode 100644 index 000000000..d6839ed2a --- /dev/null +++ b/monkey_island/linux/clear_db.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +service monkey-mongo stop +cd /var/monkey_island +rm -rf ./db/* +service monkey-mongo start diff --git a/monkey_island/linux/create_certificate.sh b/monkey_island/linux/create_certificate.sh new file mode 100644 index 000000000..f42f9950b --- /dev/null +++ b/monkey_island/linux/create_certificate.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +cd /var/monkey_island +openssl genrsa -out cc/server.key 1024 +openssl req -new -key cc/server.key -out cc/server.csr +openssl x509 -req -days 366 -in cc/server.csr -signkey cc/server.key -out cc/server.crt diff --git a/monkey_island/linux/monkey-island.service b/monkey_island/linux/monkey-island.service new file mode 100644 index 000000000..b996af5df --- /dev/null +++ b/monkey_island/linux/monkey-island.service @@ -0,0 +1,9 @@ +[Unit] +Description=Monkey Island Service + +[Service] +WorkingDirectory=/var/monkey_island/cc +ExecStart=/usr/bin/python main.py + +[Install] +WantedBy=multi-user.target diff --git a/monkey_island/linux/monkey-mongo.service b/monkey_island/linux/monkey-mongo.service new file mode 100644 index 000000000..29be3b3f6 --- /dev/null +++ b/monkey_island/linux/monkey-mongo.service @@ -0,0 +1,9 @@ +[Unit] +Description=Monkey Island Mongo Service + +[Service] +WorkingDirectory=/var/monkey_island/ +ExecStart=/var/monkey_island/bin/mongodb/bin/mongod --dbpath db + +[Install] +WantedBy=multi-user.target diff --git a/monkey_island/readme.txt b/monkey_island/readme.txt index 9665200f3..c5747a91c 100644 --- a/monkey_island/readme.txt +++ b/monkey_island/readme.txt @@ -1,5 +1,6 @@ -How to setup C&C server: -On Windows: +How to set C&C server: + +---------------- On Windows ----------------: 1. Install python 2.7 https://www.python.org/download/releases/2.7 2. Download & Run get-pip.py @@ -18,7 +19,7 @@ On Windows: 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 -4. Download MongoDb & Extract to C:\MonkeyIsland\bin\mongodb +4. Download MongoDB & Extract to C:\MonkeyIsland\bin\mongodb http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-latest.zip 5. Install OpenSSL https://slproweb.com/download/Win64OpenSSL_Light-1_0_2d.exe @@ -35,4 +36,26 @@ How to Connect to build environment: How to run: 1. start run_mongodb.bat 2. start run_cc.bat -3. to clear db, run clear_db.bat \ No newline at end of file +3. to clear db, run clear_db.bat + +---------------- On Linux ----------------: +1. Create the following directories: + mkdir -p /var/monkey_island/bin + mkdir -p /var/monkey_island/db + mkdir -p /var/monkey_island/cc/binaries +2. put monkey binaries in /var/monkey_island/cc/binaries + 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 64bi +3. Download MongoDB and extract it to /var/monkey_island/bin/mongodb + for debian64 - https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian71-3.0.7.tgz + for ubuntu64 14.10 - https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1410-clang-3.0.7.tgz + find more at - https://www.mongodb.org/downloads#production +4. install OpenSSL + apt-get install openssl +5. Generate SSL Certificate, Run create_certificate.sh + +How to run: +1. run run.sh +2. to clear db, run clear.db.sh diff --git a/monkey_island/clear_db.bat b/monkey_island/windows/clear_db.bat similarity index 100% rename from monkey_island/clear_db.bat rename to monkey_island/windows/clear_db.bat diff --git a/monkey_island/create_certificate.bat b/monkey_island/windows/create_certificate.bat similarity index 100% rename from monkey_island/create_certificate.bat rename to monkey_island/windows/create_certificate.bat diff --git a/monkey_island/run_cc.bat b/monkey_island/windows/run_cc.bat similarity index 100% rename from monkey_island/run_cc.bat rename to monkey_island/windows/run_cc.bat diff --git a/monkey_island/run_mongodb.bat b/monkey_island/windows/run_mongodb.bat similarity index 100% rename from monkey_island/run_mongodb.bat rename to monkey_island/windows/run_mongodb.bat