#!/bin/sh
echo "WARNING: This script will install docker AND add it as an apt source."
echo ""
echo "If you do not want this, please press ctrl + C to cancel the script."
echo ""
echo "The script will start in 10 seconds."
sleep 10
echo "Running BYOB app setup..."
which python3 > /dev/null
status=$?
if test $status -ne 0
then
echo "Installing Python 3.6..."
apt-get install python3.6 -y
else
echo "Confirmed Python is installed."
sudo apt install python3-pip
fi
which docker > /dev/null
status=$?
if test $status -ne 0
then
echo "Installing Docker..."
chmod +x get-docker.sh
./get-docker.sh
sudo usermod -aG docker $USER
sudo chmod 666 /var/run/docker.sock
else
echo "Confirmed Docker is installed."
echo "If you run into issues generating a Windows payload, please uninstall docker and rerun this script"
fi
echo "Installing Python packages..."
python3 -m pip install CMake==3.18.4
python3 -m pip install -r requirements.txt
echo "Building Docker images - this will take a while, please be patient..."
cd docker-pyinstaller
docker build -f Dockerfile-py3-amd64 -t nix-amd64 .
docker build -f Dockerfile-py3-i386 -t nix-i386 .
docker build -f Dockerfile-py3-win32 -t win-x32 .
read -p "To use some Byob features, you must reboot your system. If this is not your first time running this script, please answer no. Reboot now? [Y/n]: " agreeTo
case $agreeTo in
y|Y|yes|Yes|YES)
echo "Rebooting..."
sleep 1
sudo reboot now
exit
;;
n|N|no|No|NO)
cd ..
echo "Running C2 server with locally hosted web app GUI...";
echo "Navigate to http://127.0.0.1:5000 and set up your user to get started.";
python3 run.py
exit
;;
esac