2015-08-05 18:36:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-09-23 18:04:35 +00:00
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
|
|
echo " [!]This script must be run as root" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-11-21 23:24:17 +00:00
|
|
|
IFS='/' read -a array <<< pwd
|
|
|
|
|
|
|
|
if [[ "$(pwd)" != *setup ]]
|
|
|
|
then
|
|
|
|
cd ./setup
|
|
|
|
fi
|
|
|
|
|
2017-08-14 19:21:12 +00:00
|
|
|
wget https://bootstrap.pypa.io/get-pip.py
|
|
|
|
python get-pip.py
|
|
|
|
|
2015-11-13 23:01:41 +00:00
|
|
|
version=$( lsb_release -r | grep -oP "[0-9]+" | head -1 )
|
|
|
|
if lsb_release -d | grep -q "Fedora"; then
|
|
|
|
Release=Fedora
|
2017-08-13 14:44:26 +00:00
|
|
|
dnf install -y make g++ python-devel m2crypto python-m2ext swig python-iptools python3-iptools libxml2-devel default-jdk openssl-devel libssl1.0.0 libssl-dev
|
2017-08-14 19:21:12 +00:00
|
|
|
pip install --upgrade urllib3
|
2016-09-29 13:31:39 +00:00
|
|
|
pip install setuptools
|
2015-11-13 23:01:41 +00:00
|
|
|
pip install pycrypto
|
|
|
|
pip install iptools
|
|
|
|
pip install pydispatcher
|
2016-03-22 00:20:03 +00:00
|
|
|
pip install flask
|
2016-09-23 18:04:35 +00:00
|
|
|
pip install macholib
|
|
|
|
pip install dropbox
|
2016-10-17 22:00:02 +00:00
|
|
|
pip install pyOpenSSL
|
2016-12-09 20:57:39 +00:00
|
|
|
pip install pyinstaller
|
2017-01-05 03:39:37 +00:00
|
|
|
pip install zlib_wrapper
|
2017-04-26 04:36:06 +00:00
|
|
|
pip install netifaces
|
2015-11-13 23:01:41 +00:00
|
|
|
elif lsb_release -d | grep -q "Kali"; then
|
|
|
|
Release=Kali
|
2017-08-13 14:44:26 +00:00
|
|
|
apt-get install -y make g++ python-dev python-m2crypto swig python-pip libxml2-dev default-jdk libssl1.0.0 libssl-dev
|
2017-08-14 19:21:12 +00:00
|
|
|
pip install --upgrade urllib3
|
2016-09-29 13:31:39 +00:00
|
|
|
pip install setuptools
|
2015-11-13 23:01:41 +00:00
|
|
|
pip install pycrypto
|
|
|
|
pip install iptools
|
|
|
|
pip install pydispatcher
|
2016-03-22 00:20:03 +00:00
|
|
|
pip install flask
|
2016-09-23 18:04:35 +00:00
|
|
|
pip install macholib
|
|
|
|
pip install dropbox
|
2016-10-17 22:00:02 +00:00
|
|
|
pip install pyOpenSSL
|
2016-12-09 20:57:39 +00:00
|
|
|
pip install pyinstaller
|
2017-01-05 03:39:37 +00:00
|
|
|
pip install zlib_wrapper
|
2017-04-26 04:36:06 +00:00
|
|
|
pip install netifaces
|
2017-05-17 02:02:53 +00:00
|
|
|
if ! which powershell > /dev/null; then
|
2017-06-19 05:28:21 +00:00
|
|
|
wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb
|
2017-05-17 02:02:53 +00:00
|
|
|
wget http://ftp.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
2017-06-19 05:28:21 +00:00
|
|
|
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.16/powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
|
|
|
apt-get install -y libunwind8
|
|
|
|
dpkg -i libicu55_55.1-7_amd64.deb
|
2017-05-17 02:02:53 +00:00
|
|
|
dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
2017-06-19 05:28:21 +00:00
|
|
|
dpkg -i powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
|
|
|
apt-get install -f -y
|
|
|
|
rm libicu55_55.1-7_amd64.deb
|
2017-05-17 02:02:53 +00:00
|
|
|
rm libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
2017-06-19 05:28:21 +00:00
|
|
|
rm powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
2017-05-17 02:02:53 +00:00
|
|
|
fi
|
|
|
|
mkdir -p /usr/local/share/powershell/Modules
|
|
|
|
cp -r ../lib/powershell/Invoke-Obfuscation /usr/local/share/powershell/Modules
|
2015-11-13 23:01:41 +00:00
|
|
|
elif lsb_release -d | grep -q "Ubuntu"; then
|
|
|
|
Release=Ubuntu
|
2017-08-13 14:44:26 +00:00
|
|
|
apt-get install -y make g++ python-dev python-m2crypto swig python-pip libxml2-dev default-jdk libssl1.0.0 libssl-dev
|
2017-08-14 19:21:12 +00:00
|
|
|
pip install --upgrade urllib3
|
2016-09-29 13:31:39 +00:00
|
|
|
pip install setuptools
|
2015-11-13 23:01:41 +00:00
|
|
|
pip install pycrypto
|
|
|
|
pip install iptools
|
|
|
|
pip install pydispatcher
|
2016-03-22 00:20:03 +00:00
|
|
|
pip install flask
|
2016-07-10 22:45:56 +00:00
|
|
|
pip install pyOpenSSL
|
2016-09-23 18:04:35 +00:00
|
|
|
pip install macholib
|
|
|
|
pip install dropbox
|
2016-10-17 21:58:32 +00:00
|
|
|
pip install pyopenssl
|
2016-12-09 20:57:39 +00:00
|
|
|
pip install pyinstaller
|
2017-01-05 03:39:37 +00:00
|
|
|
pip install zlib_wrapper
|
2017-04-26 04:36:06 +00:00
|
|
|
pip install netifaces
|
2017-05-17 02:02:53 +00:00
|
|
|
if ! which powershell > /dev/null; then
|
2017-06-19 05:28:21 +00:00
|
|
|
wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb
|
|
|
|
wget http://ftp.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
|
|
|
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.16/powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
|
|
|
apt-get install -y libunwind8
|
|
|
|
dpkg -i libicu55_55.1-7_amd64.deb
|
|
|
|
dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
|
|
|
dpkg -i powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
|
|
|
apt-get install -f -y
|
|
|
|
rm libicu55_55.1-7_amd64.deb
|
|
|
|
rm libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
|
|
|
rm powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
|
|
|
fi
|
|
|
|
mkdir -p /usr/local/share/powershell/Modules
|
|
|
|
cp -r ../lib/powershell/Invoke-Obfuscation /usr/local/share/powershell/Modules
|
2015-11-13 23:01:41 +00:00
|
|
|
else
|
|
|
|
echo "Unknown distro - Debian/Ubuntu Fallback"
|
2017-08-13 14:44:26 +00:00
|
|
|
apt-get install -y make g++ python-dev python-m2crypto swig python-pip libxml2-dev default-jdk libffi-dev libssl1.0.0 libssl-dev
|
2017-08-14 19:21:12 +00:00
|
|
|
pip install --upgrade urllib3
|
2016-09-29 13:31:39 +00:00
|
|
|
pip install setuptools
|
2015-11-13 23:01:41 +00:00
|
|
|
pip install pycrypto
|
|
|
|
pip install iptools
|
|
|
|
pip install pydispatcher
|
2016-03-22 00:20:03 +00:00
|
|
|
pip install flask
|
2016-09-23 18:04:35 +00:00
|
|
|
pip install macholib
|
|
|
|
pip install dropbox
|
2016-09-29 17:14:02 +00:00
|
|
|
pip install cryptography
|
2016-10-17 22:00:02 +00:00
|
|
|
pip install pyOpenSSL
|
2016-12-09 20:57:39 +00:00
|
|
|
pip install pyinstaller
|
2017-01-05 03:39:37 +00:00
|
|
|
pip install zlib_wrapper
|
2017-04-26 04:36:06 +00:00
|
|
|
pip install netifaces
|
2017-05-17 02:02:53 +00:00
|
|
|
if ! which powershell > /dev/null; then
|
2017-06-19 05:28:21 +00:00
|
|
|
wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb
|
|
|
|
wget http://ftp.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
|
|
|
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.16/powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
|
|
|
apt-get install -y libunwind8
|
|
|
|
dpkg -i libicu55_55.1-7_amd64.deb
|
|
|
|
dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
|
|
|
dpkg -i powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
|
|
|
apt-get install -f -y
|
|
|
|
rm libicu55_55.1-7_amd64.deb
|
|
|
|
rm libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
|
|
|
rm powershell_6.0.0-alpha.16-1ubuntu1.16.04.1_amd64.deb
|
2017-05-17 02:02:53 +00:00
|
|
|
fi
|
|
|
|
mkdir -p /usr/local/share/powershell/Modules
|
|
|
|
cp -r ../lib/powershell/Invoke-Obfuscation /usr/local/share/powershell/Modules
|
2015-11-13 23:01:41 +00:00
|
|
|
fi
|
2016-09-29 02:32:56 +00:00
|
|
|
tar -xvf ../data/misc/xar-1.5.2.tar.gz
|
|
|
|
(cd xar-1.5.2 && ./configure)
|
|
|
|
(cd xar-1.5.2 && make)
|
|
|
|
(cd xar-1.5.2 && make install)
|
|
|
|
git clone https://github.com/hogliux/bomutils.git
|
|
|
|
(cd bomutils && make)
|
|
|
|
(cd bomutils && make install)
|
|
|
|
chmod 755 bomutils/build/bin/mkbom && cp bomutils/build/bin/mkbom /usr/local/bin/mkbom
|
2015-11-21 23:24:17 +00:00
|
|
|
# set up the database schema
|
2015-08-05 18:36:39 +00:00
|
|
|
./setup_database.py
|
2015-11-21 23:24:17 +00:00
|
|
|
|
|
|
|
# generate a cert
|
|
|
|
./cert.sh
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo -e '\n [*] Setup complete!\n'
|