Skip to content

Commit 747a069

Browse files
committed
Merge branch 'master' into staging
2 parents f2d604a + ba61597 commit 747a069

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

installer/cape2.sh

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ cat << EOI
7474
Problems with PyOpenSSL?
7575
sudo rm -rf /usr/local/lib/python3.8/dist-packages/OpenSSL/
7676
sudo rm -rf /home/${USER}/.local/lib/python3.8/site-packages/OpenSSL/
77-
sudo apt-get install --reinstall python-openssl
77+
sudo apt-get install -y --reinstall python-openssl
7878
7979
Problem with PIP?
80-
sudo python -m pip3 uninstall pip3 && sudo apt-get install python3-pip --reinstall
80+
sudo python -m pip3 uninstall pip3 && sudo apt-get install -y --reinstall python3-pip
8181
8282
Problem with pillow:
8383
* ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
8484
* ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
8585
Solution:
8686
# https://askubuntu.com/a/1094768
8787
# you may need to adjust version of libjpeg-turbo8
88-
sudo apt-get install zlib1g-dev libjpeg-turbo8-dev libjpeg-turbo8=1.5.2-0ubuntu5
88+
sudo apt-get install -y zlib1g-dev libjpeg-turbo8-dev libjpeg-turbo8=1.5.2-0ubuntu5
8989
EOI
9090
}
9191

@@ -145,7 +145,7 @@ EndOfHelp
145145

146146
function install_crowdsecurity() {
147147
echo "[+] Install crowdsecurity"
148-
sudo apt-get install bash gettext whiptail curl wget
148+
sudo apt-get install -y bash gettext whiptail curl wget
149149
cd /tmp || return
150150
if [ ! -d crowdsec-release.tgz ]; then
151151
curl -s https://api.github.com/repos/crowdsecurity/crowdsec/releases/latest | grep browser_download_url| cut -d '"' -f 4 | wget -i -
@@ -171,20 +171,20 @@ function install_crowdsecurity() {
171171
function install_docker() {
172172
echo "[+] Install docker"
173173
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
174-
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
174+
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
175175

176176
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg --yes
177177
echo "deb [signed-by=/etc/apt/keyrings/docker.gpg arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
178178

179179
sudo apt-get update
180-
sudo apt-get install docker-ce
180+
sudo apt-get install -y docker-ce
181181
sudo usermod -aG docker ${USER}
182182
}
183183

184184
function install_jemalloc() {
185185
# https://zapier.com/engineering/celery-python-jemalloc/
186186
if ! $(dpkg -l "libjemalloc*" | grep -q "ii libjemalloc"); then
187-
apt-get install libjemalloc-dev -y
187+
sudo apt-get install -y libjemalloc-dev
188188
fi
189189
}
190190

@@ -258,7 +258,7 @@ function install_librenms() {
258258
if [ "$librenms_enable" -ge 1 ]; then
259259
echo "[+] Install librenms"
260260
echo "Enabling stuff for LibreNMS"
261-
apt-get install -y zlib1g-dev cpanminus libjson-perl libfile-readbackwards-perl \
261+
sudo apt-get install -y zlib1g-dev cpanminus libjson-perl libfile-readbackwards-perl \
262262
libjson-perl libconfig-tiny-perl libdbi-perl libfile-slurp-perl \
263263
libstatistics-lite-perl libdbi-perl libdbd-pg-perl monitoring-plugins \
264264
monitoring-plugins-contrib monitoring-plugins-standard dmidecode wget snmpd
@@ -271,7 +271,7 @@ function install_librenms() {
271271
chmod +x /etc/snmp/extends/distro /etc/snmp/extends/cape /etc/snmp/extends/smart /etc/snmp/extends/osupdate
272272

273273
if [ "$librenms_mdadm_enable" -ge 1 ]; then
274-
apt-get install -y jq
274+
sudo apt-get install -y jq
275275
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/mdadm -O /etc/snmp/extends/mdadm
276276
chmod +x /etc/snmp/extends/mdadm
277277
fi
@@ -297,7 +297,7 @@ function install_librenms() {
297297
function install_modsecurity() {
298298
echo "[+] Install modsecurity"
299299
# Tested on nginx 1.(16|18).X Based on https://www.nginx.com/blog/compiling-and-installing-modsecurity-for-open-source-nginx/ with fixes
300-
sudo apt-get install git g++ apt-utils autoconf automake build-essential libcurl4-openssl-dev libgeoip-dev liblmdb-dev libpcre2-dev libtool libxml2-dev libyajl-dev pkgconf zlib1g-dev
300+
sudo apt-get install -y git g++ apt-utils autoconf automake build-essential libcurl4-openssl-dev libgeoip-dev liblmdb-dev libpcre2-dev libtool libxml2-dev libyajl-dev pkgconf zlib1g-dev
301301
git clone --depth 500 -b v3/master --single-branch https://github.com/SpiderLabs/ModSecurity
302302
cd ModSecurity || return
303303
git submodule init
@@ -602,7 +602,7 @@ fi
602602

603603
function install_letsencrypt(){
604604
echo "[+] Install and configure letsencrypt"
605-
sudo apt-get install python3 python3-venv libaugeas0
605+
sudo apt-get install -y python3 python3-venv libaugeas0
606606
sudo pip install certbot certbot-nginx --break-system-packages
607607
echo "server_name $1 www.$1;" > /etc/nginx/sites-available/"$1"
608608
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
@@ -612,7 +612,7 @@ function install_letsencrypt(){
612612

613613
function install_fail2ban() {
614614
echo "[+] Installing fail2ban"
615-
sudo apt-get install fail2ban -y
615+
sudo apt-get install -y fail2ban
616616
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
617617
sudo sed -i /etc/fail2ban/jail.local
618618
systemctl start fail2ban
@@ -656,7 +656,7 @@ function redsocks2() {
656656

657657
function distributed() {
658658
echo "[+] Configure distributed configuration"
659-
sudo apt-get install uwsgi uwsgi-plugin-python3 nginx -y 2>/dev/null
659+
sudo apt-get install -y uwsgi uwsgi-plugin-python3 nginx 2>/dev/null
660660
sudo -u ${USER} bash -c '/etc/poetry/bin/poetry run pip install flask flask-restful flask-sqlalchemy requests'
661661

662662
sudo cp /opt/CAPEv2/uwsgi/capedist.ini /etc/uwsgi/apps-available/cape_dist.ini
@@ -701,8 +701,8 @@ EOL
701701

702702
function install_suricata() {
703703
echo '[+] Installing Suricata'
704-
add-apt-repository ppa:oisf/suricata-stable -y
705-
apt-get install suricata suricata-update -y
704+
sudo add-apt-repository -y ppa:oisf/suricata-stable
705+
sudo apt-get install -y suricata suricata-update
706706
touch /etc/suricata/threshold.config
707707

708708
# Download etupdate to update Emerging Threats Open IDS rules:
@@ -782,7 +782,7 @@ function install_yara() {
782782

783783
echo '[+] Installing Yara'
784784

785-
apt-get install libtool libjansson-dev libmagic1 libmagic-dev jq autoconf libyara-dev -y
785+
sudo apt-get install -y libtool libjansson-dev libmagic1 libmagic-dev jq autoconf libyara-dev
786786

787787
cd /tmp || return
788788
yara_info=$(curl -s https://api.github.com/repos/VirusTotal/yara/releases/latest)
@@ -832,9 +832,9 @@ function install_mongo(){
832832
sudo curl -fsSL "https://pgp.mongodb.com/server-${MONGO_VERSION}.asc" | sudo gpg --dearmor -o /etc/apt/keyrings/mongo.gpg --yes
833833
echo "deb [signed-by=/etc/apt/keyrings/mongo.gpg arch=amd64] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/${MONGO_VERSION} multiverse" > /etc/apt/sources.list.d/mongodb.list
834834

835-
apt-get update 2>/dev/null
836-
apt-get install libpcre3-dev numactl cron -y
837-
apt-get install -y mongodb-org
835+
sudo apt-get update 2>/dev/null
836+
sudo apt-get install -y libpcre3-dev numactl cron
837+
sudo apt-get install -y mongodb-org
838838

839839
# Check pip version. Only pip3 versions 23+ have the '--break-system-packages' flag.
840840
PIP_VERSION=$(pip3 -V | awk '{print $2}' | cut -d'.' -f1)
@@ -844,11 +844,11 @@ function install_mongo(){
844844
pip3 install pymongo -U
845845
fi
846846

847-
apt-get install -y ntp
847+
sudo apt-get install -y ntp
848848
systemctl start ntp.service && sudo systemctl enable ntp.service
849849

850850
if ! grep -q -E '^kernel/mm/transparent_hugepage/enabled' /etc/sysfs.conf; then
851-
sudo apt-get install sysfsutils -y
851+
sudo apt-get install -y sysfsutils
852852
echo "kernel/mm/transparent_hugepage/enabled = never" >> /etc/sysfs.conf
853853
echo "kernel/mm/transparent_hugepage/defrag = never" >> /etc/sysfs.conf
854854
fi
@@ -915,7 +915,7 @@ function install_elastic() {
915915
# Elasticsearch 8.x
916916
# echo "deb [signed-by=/etc/apt/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" > /etc/apt/sources.list.d/elastic-8.x.list
917917

918-
apt-get update && apt-get install elasticsearch
918+
sudo apt-get update && sudo apt-get install -y elasticsearch
919919

920920
# Check pip version. Only pip3 versions 23+ have the '--break-system-packages' flag.
921921
PIP_VERSION=$(pip3 -V | awk '{print $2}' | cut -d'.' -f1)
@@ -934,8 +934,8 @@ function install_postgresql() {
934934
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
935935
echo "deb [signed-by=/etc/apt/trusted.gpg.d/apt.postgresql.org.gpg arch=amd64] http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
936936

937-
sudo apt-get update -y
938-
sudo apt -y install libpq-dev postgresql postgresql-client
937+
sudo apt-get update
938+
sudo apt-get install -y libpq-dev postgresql postgresql-client
939939

940940
sudo systemctl enable postgresql.service
941941
sudo systemctl start postgresql.service
@@ -974,25 +974,25 @@ function dependencies() {
974974
#sudo canonical-livepatch enable APITOKEN
975975

976976
# deps
977-
apt-get install python3-pip build-essential libssl-dev libssl3 python3-dev cmake nfs-common crudini -y
978-
apt-get install innoextract msitools iptables psmisc jq sqlite3 tmux net-tools checkinstall graphviz python3-pydot git numactl python3 python3-dev python3-pip libjpeg-dev zlib1g-dev -y
979-
apt-get install zpaq upx-ucl wget zip unzip lzip rar unrar unace-nonfree cabextract geoip-database libgeoip-dev libjpeg-dev mono-utils ssdeep libfuzzy-dev exiftool -y
980-
apt-get install uthash-dev libconfig-dev libarchive-dev libtool autoconf automake privoxy software-properties-common wkhtmltopdf xvfb xfonts-100dpi tcpdump libcap2-bin wireshark-common -y
981-
apt-get install python3-pil subversion uwsgi uwsgi-plugin-python3 python3-pyelftools git curl -y
982-
apt-get install openvpn wireguard -y
977+
sudo apt-get install -y python3-pip build-essential libssl-dev libssl3 python3-dev cmake nfs-common crudini
978+
sudo apt-get install -y innoextract msitools iptables psmisc jq sqlite3 tmux net-tools checkinstall graphviz python3-pydot git numactl python3 python3-dev python3-pip libjpeg-dev zlib1g-dev
979+
sudo apt-get install -y zpaq upx-ucl wget zip unzip lzip rar unrar unace-nonfree cabextract geoip-database libgeoip-dev libjpeg-dev mono-utils ssdeep libfuzzy-dev exiftool
980+
sudo apt-get install -y uthash-dev libconfig-dev libarchive-dev libtool autoconf automake privoxy software-properties-common wkhtmltopdf xvfb xfonts-100dpi tcpdump libcap2-bin wireshark-common
981+
sudo apt-get install -y python3-pil subversion uwsgi uwsgi-plugin-python3 python3-pyelftools git curl
982+
sudo apt-get install -y openvpn wireguard
983983
# for bingraph
984-
sudo apt install libgraphviz-dev
984+
sudo apt-get install -y libgraphviz-dev
985985

986986
# APT poetry is ultra outdated
987987
curl -sSL https://install.python-poetry.org | POETRY_HOME=/etc/poetry python3 -
988988
echo "PATH=$PATH:/etc/poetry/bin/" >> /etc/bash.bashrc
989989
source /etc/bash.bashrc
990990
poetry self add poetry-plugin-shell
991991

992-
apt-get install locate # used by extra/libvirt_installer.sh
992+
sudo apt-get install -y locate # used by extra/libvirt_installer.sh
993993

994994
# de4dot selfextraction
995-
apt-get install -y libgdiplus libdnlib2.1-cil libgif7 libmono-accessibility4.0-cil libmono-ldap4.0-cil libmono-posix4.0-cil libmono-sqlite4.0-cil libmono-system-componentmodel-dataannotations4.0-cil libmono-system-data4.0-cil libmono-system-design4.0-cil libmono-system-drawing4.0-cil libmono-system-enterpriseservices4.0-cil libmono-system-ldap4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-runtime4.0-cil libmono-system-transactions4.0-cil libmono-system-web-applicationservices4.0-cil libmono-system-web-services4.0-cil libmono-system-web4.0-cil libmono-system-windows-forms4.0-cil libmono-webbrowser4.0-cil
995+
sudo apt-get install -y libgdiplus libdnlib2.1-cil libgif7 libmono-accessibility4.0-cil libmono-ldap4.0-cil libmono-posix4.0-cil libmono-sqlite4.0-cil libmono-system-componentmodel-dataannotations4.0-cil libmono-system-data4.0-cil libmono-system-design4.0-cil libmono-system-drawing4.0-cil libmono-system-enterpriseservices4.0-cil libmono-system-ldap4.0-cil libmono-system-runtime-serialization-formatters-soap4.0-cil libmono-system-runtime4.0-cil libmono-system-transactions4.0-cil libmono-system-web-applicationservices4.0-cil libmono-system-web-services4.0-cil libmono-system-web4.0-cil libmono-system-windows-forms4.0-cil libmono-webbrowser4.0-cil
996996
de4dot_package_name="de4dot_3.1.41592.3405-2_all.deb"
997997
# if not exist download package
998998
if [ ! -f $de4dot_package_name ]; then
@@ -1006,15 +1006,15 @@ function dependencies() {
10061006
return
10071007
fi
10081008

1009-
# if broken sudo python -m pip uninstall pip && sudo apt-get install python-pip --reinstall
1009+
# if broken sudo python -m pip uninstall pip && sudo apt-get install -y --reinstall python-pip
10101010
#pip3 install --upgrade pip
10111011
# /usr/bin/pip
10121012
# from pip import __main__
10131013
# if __name__ == '__main__':
10141014
# sys.exit(__main__._main())
10151015

10161016
# re2 - dead on py3.11
1017-
# apt-get install libre2-dev -y
1017+
# sudo apt-get install -y libre2-dev
10181018
#re2 for py3
10191019
# pip3 install cython
10201020
# pip3 install git+https://github.com/andreasvc/pyre2.git
@@ -1026,7 +1026,7 @@ function dependencies() {
10261026
sudo -u postgres -H sh -c "psql -d \"${USER}\" -c \"GRANT ALL PRIVILEGES ON DATABASE ${USER} to ${USER};\""
10271027
sudo -u postgres -H sh -c "psql -d \"${USER}\" -c \"ALTER DATABASE ${USER} OWNER TO ${USER};\""
10281028

1029-
apt-get install apparmor-utils -y
1029+
sudo apt-get install -y apparmor-utils
10301030
TCPDUMP_PATH=`which tcpdump`
10311031
aa-complain ${TCPDUMP_PATH}
10321032
aa-disable ${TCPDUMP_PATH}
@@ -1044,7 +1044,7 @@ function dependencies() {
10441044
usermod -a -G systemd-journal ${USER}
10451045

10461046
# https://www.torproject.org/docs/debian.html.en
1047-
sudo apt-get install gnupg2 -y
1047+
sudo apt-get install -y gnupg2
10481048

10491049
wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | sudo tee /usr/share/keyrings/deb.torproject.org-keyring.gpg >/dev/null
10501050

@@ -1060,7 +1060,7 @@ function dependencies() {
10601060

10611061
sudo apt-get update 2>/dev/null
10621062
sudo systemctl stop [email protected] && sudo systemctl disable [email protected]
1063-
apt-get install tor deb.torproject.org-keyring libzstd1 -y
1063+
sudo apt-get install -y tor deb.torproject.org-keyring libzstd1
10641064

10651065
sed -i 's/#RunAsDaemon 1/RunAsDaemon 1/g' /etc/tor/torrc
10661066

@@ -1126,7 +1126,7 @@ EOF
11261126
sudo sysctl -p
11271127

11281128
### PDNS
1129-
sudo apt-get install git binutils-dev libldns-dev libpcap-dev libdate-simple-perl libdatetime-perl libdbd-mysql-perl -y
1129+
sudo apt-get install -y git binutils-dev libldns-dev libpcap-dev libdate-simple-perl libdatetime-perl libdbd-mysql-perl
11301130
cd /tmp || return
11311131

11321132
# From pevious install
@@ -1153,7 +1153,7 @@ EOF
11531153

11541154
function install_clamav() {
11551155
echo "[+] Installing clamav"
1156-
apt-get install clamav clamav-daemon clamav-freshclam clamav-unofficial-sigs python3-pyclamd -y
1156+
sudo apt-get install -y clamav clamav-daemon clamav-freshclam clamav-unofficial-sigs python3-pyclamd
11571157

11581158
cat >> /usr/share/clamav-unofficial-sigs/conf.d/00-clamav-unofficial-sigs.conf << EOF
11591159
# This file contains user configuration settings for the clamav-unofficial-sigs.sh
@@ -1303,7 +1303,7 @@ function install_CAPE() {
13031303
fi
13041304

13051305
#packages are needed for build options in extra/yara_installer.sh
1306-
apt-get install libjansson-dev libmagic1 libmagic-dev -y
1306+
sudo apt-get install -y libjansson-dev libmagic1 libmagic-dev
13071307
sudo -u ${USER} bash -c '/etc/poetry/bin/poetry run /opt/CAPEv2/extra/yara_installer.sh'
13081308

13091309
if [ -d /tmp/yara-python ]; then
@@ -1413,7 +1413,7 @@ function install_node_exporter() {
14131413

14141414
function install_volatility3() {
14151415
echo "[+] Installing volatility3"
1416-
sudo apt-get install unzip
1416+
sudo apt-get install -y unzip
14171417
sudo -u ${USER} /etc/poetry/bin/poetry run pip3 install git+https://github.com/volatilityfoundation/volatility3
14181418
vol_path=$(sudo -u ${USER} /etc/poetry/bin/poetry run python3 -c "import volatility3.plugins;print(volatility3.__file__.replace('__init__.py', 'symbols/'))")
14191419
cd $vol_path || return
@@ -1439,9 +1439,9 @@ function install_guacamole() {
14391439
echo "[+] Installing guacamole"
14401440
# Kudos to @Enzok https://github.com/kevoreilly/CAPEv2/pull/1065
14411441
# https://guacamole.apache.org/doc/gug/installing-guacamole.html
1442-
sudo add-apt-repository ppa:remmina-ppa-team/remmina-next-daily
1442+
sudo add-apt-repository -y ppa:remmina-ppa-team/remmina-next-daily
14431443
sudo apt-get update
1444-
sudo apt -y install libcairo2-dev libjpeg-turbo8-dev libpng-dev libossp-uuid-dev freerdp2-dev
1444+
sudo apt-get install -y libcairo2-dev libjpeg-turbo8-dev libpng-dev libossp-uuid-dev freerdp2-dev
14451445
sudo apt-get install -y freerdp2-dev libssh2-1-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev libwebp-dev libpango1.0-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
14461446

14471447
# https://downloads.apache.org/guacamole/$guacamole_version/source/
@@ -1469,7 +1469,7 @@ function install_guacamole() {
14691469
sudo ldconfig
14701470

14711471
#pip3 install -U 'Twisted[tls,http2]'
1472-
sudo apt install python3-twisted -y
1472+
sudo apt-get install -y python3-twisted
14731473

14741474
if [ -f "/etc/systemd/system/guacd.service" ] ; then
14751475
sudo rm /etc/systemd/system/guacd.service
@@ -1503,14 +1503,14 @@ function install_guacamole() {
15031503

15041504
function install_DIE() {
15051505
echo "[+] Installing Detect It Easy"
1506-
apt-get install libqt5opengl5 libqt5script5 libqt5scripttools5 libqt5sql5 -y
1506+
sudo apt-get install -y libqt5opengl5 libqt5script5 libqt5scripttools5 libqt5sql5
15071507
wget "https://github.com/horsicq/DIE-engine/releases/download/${DIE_VERSION}/die_${DIE_VERSION}_Ubuntu_${UBUNTU_VERSION}_amd64.deb" -O DIE.deb && dpkg -i DIE.deb
15081508
}
15091509

15101510
function install_fluentd() {
15111511
echo "[+] Installing fluentd"
15121512
curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh && sudo bash add-logging-agent-repo.sh
1513-
sudo apt-get update && sudo apt-get install google-fluentd
1513+
sudo apt-get update && sudo apt-get install -y google-fluentd
15141514
sudo apt-get install -y google-fluentd-catch-all-config-structured
15151515
sudo service google-fluentd start && sudo service google-fluentd status
15161516
}
@@ -1519,7 +1519,7 @@ function install_postgres_pg_activity() {
15191519
echo "[+] Installing pg-activity"
15201520
# amazing tool for monitoring https://github.com/dalibo/pg_activity
15211521
# sudo -u postgres pg_activity -U postgres
1522-
apt install pg-activity -y
1522+
sudo apt-get install -y pg-activity
15231523
}
15241524

15251525
# Doesn't work ${$1,,}

0 commit comments

Comments
 (0)