Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
malwaredllc
GitHub Repository: malwaredllc/byob
Path: blob/master/web-gui/startup.sh
1292 views
1
#!/bin/sh
2
echo "WARNING: This script will install docker AND add it as an apt source."
3
echo ""
4
echo "If you do not want this, please press ctrl + C to cancel the script."
5
echo ""
6
echo "The script will start in 10 seconds."
7
8
sleep 10
9
10
echo "Running BYOB app setup..."
11
12
# Install Python if necessary
13
which python3 > /dev/null
14
status=$?
15
16
if test $status -ne 0
17
then
18
echo "Installing Python 3.6..."
19
apt-get install python3.6 -y
20
21
else
22
echo "Confirmed Python is installed."
23
24
# Installs Pip even if a Python installation is found because some users don't install pip
25
26
sudo apt install python3-pip
27
28
fi
29
30
# Install Docker if necessary
31
which docker > /dev/null
32
status=$?
33
34
if test $status -ne 0
35
then
36
echo "Installing Docker..."
37
chmod +x get-docker.sh
38
./get-docker.sh
39
sudo usermod -aG docker $USER
40
sudo chmod 666 /var/run/docker.sock
41
42
else
43
echo "Confirmed Docker is installed."
44
echo "If you run into issues generating a Windows payload, please uninstall docker and rerun this script"
45
fi
46
47
# Install Python packages
48
echo "Installing Python packages..."
49
python3 -m pip install CMake==3.18.4
50
python3 -m pip install -r requirements.txt
51
52
# Build Docker images
53
echo "Building Docker images - this will take a while, please be patient..."
54
cd docker-pyinstaller
55
docker build -f Dockerfile-py3-amd64 -t nix-amd64 .
56
docker build -f Dockerfile-py3-i386 -t nix-i386 .
57
docker build -f Dockerfile-py3-win32 -t win-x32 .
58
59
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
60
#Reboots system if user answers Yes
61
case $agreeTo in
62
y|Y|yes|Yes|YES)
63
echo "Rebooting..."
64
sleep 1
65
sudo reboot now
66
exit
67
;;
68
#Runs app if user answers No
69
n|N|no|No|NO)
70
cd ..
71
echo "Running C2 server with locally hosted web app GUI...";
72
echo "Navigate to http://127.0.0.1:5000 and set up your user to get started.";
73
python3 run.py
74
exit
75
;;
76
esac
77
78