2018-07-23 08:55:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Install PoshC2
|
|
|
|
echo ""
|
2018-12-31 18:09:06 +00:00
|
|
|
echo """ __________ .__. _________ ________
|
|
|
|
\_______ \____ _____| |__ \_ ___ \ \_____ \\
|
|
|
|
| ___/ _ \/ ___/ | \ / \ \/ / ____/
|
|
|
|
| | ( <_> )___ \| Y \ \ \____/ \\
|
|
|
|
|____| \____/____ >___| / \______ /\_______ \\
|
|
|
|
\/ \/ \/ \/
|
2019-01-09 22:27:44 +00:00
|
|
|
================= www.PoshC2.co.uk ================"""
|
2018-12-31 18:09:06 +00:00
|
|
|
echo ""
|
2018-07-23 08:55:15 +00:00
|
|
|
echo ""
|
|
|
|
echo "[+] Installing PoshC2"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
# Update apt
|
|
|
|
echo "[+] Performing apt-get update"
|
|
|
|
apt-get update
|
|
|
|
|
|
|
|
# Check if /opt/ exists, else create folder opt
|
|
|
|
if [ ! -d /opt/ ]; then
|
|
|
|
echo ""
|
|
|
|
echo "[+] Creating folder in /opt/"
|
|
|
|
mkdir /opt/
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Install requirements for PoshC2_Python
|
|
|
|
echo ""
|
|
|
|
echo "[+] Installing git & cloning PoshC2_Python into /opt/PoshC2_Python/"
|
|
|
|
apt-get install -y git
|
|
|
|
git clone https://github.com/nettitude/PoshC2_Python /opt/PoshC2_Python/
|
|
|
|
|
|
|
|
# Install requirements for PoshC2_Python
|
|
|
|
echo ""
|
|
|
|
echo "[+] Installing requirements using apt"
|
2018-12-27 13:25:48 +00:00
|
|
|
apt-get install -y screen python-setuptools python-dev build-essential python-pip mingw-w64-tools mingw-w64 mingw-w64-x86-64-dev mingw-w64-i686-dev mingw-w64-common espeak graphviz mono-devel
|
2018-07-23 08:55:15 +00:00
|
|
|
|
2019-01-09 22:27:44 +00:00
|
|
|
# Setting the minimum protocol to TLS1.0 to allow the python server to support TLSv1.0+
|
|
|
|
echo ""
|
|
|
|
echo "[+] Updating TLS protocol minimum version in /etc/ssl/openssl.cnf"
|
|
|
|
echo "[+] Backup file generated - /etc/ssl/openssl.cnf.bak"
|
|
|
|
sed -i.bak 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1.0/g' /etc/ssl/openssl.cnf
|
|
|
|
|
2018-07-23 08:55:15 +00:00
|
|
|
# Check if PIP is installed, if not install it
|
|
|
|
if [! which pip > /dev/null]; then
|
|
|
|
echo "[+] Installing pip as this was not found"
|
|
|
|
wget https://bootstrap.pypa.io/get-pip.py
|
|
|
|
python get-pip.py
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Run pip with requirements file
|
|
|
|
echo ""
|
|
|
|
echo "[+] Installing requirements using pip"
|
|
|
|
echo "[+] python -m pip install -r /opt/PoshC2_Python/requirements.txt"
|
|
|
|
echo ""
|
|
|
|
pip install --upgrade pip
|
|
|
|
python -m pip install -r /opt/PoshC2_Python/requirements.txt
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "[+] Setup complete"
|
|
|
|
echo ""
|
2018-12-31 18:09:06 +00:00
|
|
|
echo """ __________ .__. _________ ________
|
|
|
|
\_______ \____ _____| |__ \_ ___ \ \_____ \\
|
|
|
|
| ___/ _ \/ ___/ | \ / \ \/ / ____/
|
|
|
|
| | ( <_> )___ \| Y \ \ \____/ \\
|
|
|
|
|____| \____/____ >___| / \______ /\_______ \\
|
|
|
|
\/ \/ \/ \/
|
2019-01-09 22:27:44 +00:00
|
|
|
================= www.PoshC2.co.uk ================"""
|
2018-07-23 08:55:15 +00:00
|
|
|
echo ""
|
|
|
|
echo "EDIT the config file: '/opt/PoshC2_Python/Config.py'"
|
|
|
|
echo ""
|
|
|
|
echo "sudo python /opt/PoshC2_Python/C2Server.py"
|
|
|
|
echo "sudo python /opt/PoshC2_Python/ImplantHandler.py"
|
|
|
|
echo ""
|
2018-12-27 13:25:48 +00:00
|
|
|
echo "To install via systemctl read poshc2.service"
|