@@ -74,18 +74,18 @@ cat << EOI
74
74
Problems with PyOpenSSL?
75
75
sudo rm -rf /usr/local/lib/python3.8/dist-packages/OpenSSL/
76
76
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
78
78
79
79
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
81
81
82
82
Problem with pillow:
83
83
* ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
84
84
* ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
85
85
Solution:
86
86
# https://askubuntu.com/a/1094768
87
87
# 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
89
89
EOI
90
90
}
91
91
@@ -145,7 +145,7 @@ EndOfHelp
145
145
146
146
function install_crowdsecurity() {
147
147
echo " [+] Install crowdsecurity"
148
- sudo apt-get install bash gettext whiptail curl wget
148
+ sudo apt-get install -y bash gettext whiptail curl wget
149
149
cd /tmp || return
150
150
if [ ! -d crowdsec-release.tgz ]; then
151
151
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() {
171
171
function install_docker() {
172
172
echo " [+] Install docker"
173
173
# 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
175
175
176
176
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg --yes
177
177
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
178
178
179
179
sudo apt-get update
180
- sudo apt-get install docker-ce
180
+ sudo apt-get install -y docker-ce
181
181
sudo usermod -aG docker ${USER}
182
182
}
183
183
184
184
function install_jemalloc() {
185
185
# https://zapier.com/engineering/celery-python-jemalloc/
186
186
if ! $( dpkg -l " libjemalloc*" | grep -q " ii libjemalloc" ) ; then
187
- apt-get install libjemalloc-dev -y
187
+ sudo apt-get install -y libjemalloc-dev
188
188
fi
189
189
}
190
190
@@ -258,7 +258,7 @@ function install_librenms() {
258
258
if [ " $librenms_enable " -ge 1 ]; then
259
259
echo " [+] Install librenms"
260
260
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 \
262
262
libjson-perl libconfig-tiny-perl libdbi-perl libfile-slurp-perl \
263
263
libstatistics-lite-perl libdbi-perl libdbd-pg-perl monitoring-plugins \
264
264
monitoring-plugins-contrib monitoring-plugins-standard dmidecode wget snmpd
@@ -271,7 +271,7 @@ function install_librenms() {
271
271
chmod +x /etc/snmp/extends/distro /etc/snmp/extends/cape /etc/snmp/extends/smart /etc/snmp/extends/osupdate
272
272
273
273
if [ " $librenms_mdadm_enable " -ge 1 ]; then
274
- apt-get install -y jq
274
+ sudo apt-get install -y jq
275
275
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/mdadm -O /etc/snmp/extends/mdadm
276
276
chmod +x /etc/snmp/extends/mdadm
277
277
fi
@@ -297,7 +297,7 @@ function install_librenms() {
297
297
function install_modsecurity() {
298
298
echo " [+] Install modsecurity"
299
299
# 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
301
301
git clone --depth 500 -b v3/master --single-branch https://github.com/SpiderLabs/ModSecurity
302
302
cd ModSecurity || return
303
303
git submodule init
602
602
603
603
function install_letsencrypt(){
604
604
echo " [+] Install and configure letsencrypt"
605
- sudo apt-get install python3 python3-venv libaugeas0
605
+ sudo apt-get install -y python3 python3-venv libaugeas0
606
606
sudo pip install certbot certbot-nginx --break-system-packages
607
607
echo " server_name $1 www.$1 ;" > /etc/nginx/sites-available/" $1 "
608
608
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
@@ -612,7 +612,7 @@ function install_letsencrypt(){
612
612
613
613
function install_fail2ban() {
614
614
echo " [+] Installing fail2ban"
615
- sudo apt-get install fail2ban -y
615
+ sudo apt-get install -y fail2ban
616
616
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
617
617
sudo sed -i /etc/fail2ban/jail.local
618
618
systemctl start fail2ban
@@ -656,7 +656,7 @@ function redsocks2() {
656
656
657
657
function distributed() {
658
658
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
660
660
sudo -u ${USER} bash -c ' /etc/poetry/bin/poetry run pip install flask flask-restful flask-sqlalchemy requests'
661
661
662
662
sudo cp /opt/CAPEv2/uwsgi/capedist.ini /etc/uwsgi/apps-available/cape_dist.ini
701
701
702
702
function install_suricata() {
703
703
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
706
706
touch /etc/suricata/threshold.config
707
707
708
708
# Download etupdate to update Emerging Threats Open IDS rules:
@@ -782,7 +782,7 @@ function install_yara() {
782
782
783
783
echo ' [+] Installing Yara'
784
784
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
786
786
787
787
cd /tmp || return
788
788
yara_info=$( curl -s https://api.github.com/repos/VirusTotal/yara/releases/latest)
@@ -832,9 +832,9 @@ function install_mongo(){
832
832
sudo curl -fsSL " https://pgp.mongodb.com/server-${MONGO_VERSION} .asc" | sudo gpg --dearmor -o /etc/apt/keyrings/mongo.gpg --yes
833
833
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
834
834
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
838
838
839
839
# Check pip version. Only pip3 versions 23+ have the '--break-system-packages' flag.
840
840
PIP_VERSION=$( pip3 -V | awk ' {print $2}' | cut -d' .' -f1)
@@ -844,11 +844,11 @@ function install_mongo(){
844
844
pip3 install pymongo -U
845
845
fi
846
846
847
- apt-get install -y ntp
847
+ sudo apt-get install -y ntp
848
848
systemctl start ntp.service && sudo systemctl enable ntp.service
849
849
850
850
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
852
852
echo " kernel/mm/transparent_hugepage/enabled = never" >> /etc/sysfs.conf
853
853
echo " kernel/mm/transparent_hugepage/defrag = never" >> /etc/sysfs.conf
854
854
fi
@@ -915,7 +915,7 @@ function install_elastic() {
915
915
# Elasticsearch 8.x
916
916
# 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
917
917
918
- apt-get update && apt-get install elasticsearch
918
+ sudo apt-get update && sudo apt-get install -y elasticsearch
919
919
920
920
# Check pip version. Only pip3 versions 23+ have the '--break-system-packages' flag.
921
921
PIP_VERSION=$( pip3 -V | awk ' {print $2}' | cut -d' .' -f1)
@@ -934,8 +934,8 @@ function install_postgresql() {
934
934
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg > /dev/null
935
935
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
936
936
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
939
939
940
940
sudo systemctl enable postgresql.service
941
941
sudo systemctl start postgresql.service
@@ -974,25 +974,25 @@ function dependencies() {
974
974
# sudo canonical-livepatch enable APITOKEN
975
975
976
976
# 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
983
983
# for bingraph
984
- sudo apt install libgraphviz-dev
984
+ sudo apt-get install -y libgraphviz-dev
985
985
986
986
# APT poetry is ultra outdated
987
987
curl -sSL https://install.python-poetry.org | POETRY_HOME=/etc/poetry python3 -
988
988
echo " PATH=$PATH :/etc/poetry/bin/" >> /etc/bash.bashrc
989
989
source /etc/bash.bashrc
990
990
poetry self add poetry-plugin-shell
991
991
992
- apt-get install locate # used by extra/libvirt_installer.sh
992
+ sudo apt-get install -y locate # used by extra/libvirt_installer.sh
993
993
994
994
# 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
996
996
de4dot_package_name=" de4dot_3.1.41592.3405-2_all.deb"
997
997
# if not exist download package
998
998
if [ ! -f $de4dot_package_name ]; then
@@ -1006,15 +1006,15 @@ function dependencies() {
1006
1006
return
1007
1007
fi
1008
1008
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
1010
1010
# pip3 install --upgrade pip
1011
1011
# /usr/bin/pip
1012
1012
# from pip import __main__
1013
1013
# if __name__ == '__main__':
1014
1014
# sys.exit(__main__._main())
1015
1015
1016
1016
# re2 - dead on py3.11
1017
- # apt-get install libre2-dev -y
1017
+ # sudo apt-get install -y libre2-dev
1018
1018
# re2 for py3
1019
1019
# pip3 install cython
1020
1020
# pip3 install git+https://github.com/andreasvc/pyre2.git
@@ -1026,7 +1026,7 @@ function dependencies() {
1026
1026
sudo -u postgres -H sh -c " psql -d \" ${USER} \" -c \" GRANT ALL PRIVILEGES ON DATABASE ${USER} to ${USER} ;\" "
1027
1027
sudo -u postgres -H sh -c " psql -d \" ${USER} \" -c \" ALTER DATABASE ${USER} OWNER TO ${USER} ;\" "
1028
1028
1029
- apt-get install apparmor-utils -y
1029
+ sudo apt-get install -y apparmor-utils
1030
1030
TCPDUMP_PATH=` which tcpdump`
1031
1031
aa-complain ${TCPDUMP_PATH}
1032
1032
aa-disable ${TCPDUMP_PATH}
@@ -1044,7 +1044,7 @@ function dependencies() {
1044
1044
usermod -a -G systemd-journal ${USER}
1045
1045
1046
1046
# https://www.torproject.org/docs/debian.html.en
1047
- sudo apt-get install gnupg2 -y
1047
+ sudo apt-get install -y gnupg2
1048
1048
1049
1049
wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | sudo tee /usr/share/keyrings/deb.torproject.org-keyring.gpg > /dev/null
1050
1050
@@ -1060,7 +1060,7 @@ function dependencies() {
1060
1060
1061
1061
sudo apt-get update 2> /dev/null
1062
1062
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
1064
1064
1065
1065
sed -i ' s/#RunAsDaemon 1/RunAsDaemon 1/g' /etc/tor/torrc
1066
1066
@@ -1126,7 +1126,7 @@ EOF
1126
1126
sudo sysctl -p
1127
1127
1128
1128
# ## 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
1130
1130
cd /tmp || return
1131
1131
1132
1132
# From pevious install
@@ -1153,7 +1153,7 @@ EOF
1153
1153
1154
1154
function install_clamav() {
1155
1155
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
1157
1157
1158
1158
cat >> /usr/share/clamav-unofficial-sigs/conf.d/00-clamav-unofficial-sigs.conf << EOF
1159
1159
# This file contains user configuration settings for the clamav-unofficial-sigs.sh
@@ -1303,7 +1303,7 @@ function install_CAPE() {
1303
1303
fi
1304
1304
1305
1305
# 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
1307
1307
sudo -u ${USER} bash -c ' /etc/poetry/bin/poetry run /opt/CAPEv2/extra/yara_installer.sh'
1308
1308
1309
1309
if [ -d /tmp/yara-python ]; then
@@ -1413,7 +1413,7 @@ function install_node_exporter() {
1413
1413
1414
1414
function install_volatility3() {
1415
1415
echo " [+] Installing volatility3"
1416
- sudo apt-get install unzip
1416
+ sudo apt-get install -y unzip
1417
1417
sudo -u ${USER} /etc/poetry/bin/poetry run pip3 install git+https://github.com/volatilityfoundation/volatility3
1418
1418
vol_path=$( sudo -u ${USER} /etc/poetry/bin/poetry run python3 -c " import volatility3.plugins;print(volatility3.__file__.replace('__init__.py', 'symbols/'))" )
1419
1419
cd $vol_path || return
@@ -1439,9 +1439,9 @@ function install_guacamole() {
1439
1439
echo " [+] Installing guacamole"
1440
1440
# Kudos to @Enzok https://github.com/kevoreilly/CAPEv2/pull/1065
1441
1441
# 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
1443
1443
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
1445
1445
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
1446
1446
1447
1447
# https://downloads.apache.org/guacamole/$guacamole_version/source/
@@ -1469,7 +1469,7 @@ function install_guacamole() {
1469
1469
sudo ldconfig
1470
1470
1471
1471
# pip3 install -U 'Twisted[tls,http2]'
1472
- sudo apt install python3-twisted -y
1472
+ sudo apt-get install -y python3-twisted
1473
1473
1474
1474
if [ -f " /etc/systemd/system/guacd.service" ] ; then
1475
1475
sudo rm /etc/systemd/system/guacd.service
@@ -1503,14 +1503,14 @@ function install_guacamole() {
1503
1503
1504
1504
function install_DIE() {
1505
1505
echo " [+] Installing Detect It Easy"
1506
- apt-get install libqt5opengl5 libqt5script5 libqt5scripttools5 libqt5sql5 -y
1506
+ sudo apt-get install -y libqt5opengl5 libqt5script5 libqt5scripttools5 libqt5sql5
1507
1507
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
1508
1508
}
1509
1509
1510
1510
function install_fluentd() {
1511
1511
echo " [+] Installing fluentd"
1512
1512
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
1514
1514
sudo apt-get install -y google-fluentd-catch-all-config-structured
1515
1515
sudo service google-fluentd start && sudo service google-fluentd status
1516
1516
}
@@ -1519,7 +1519,7 @@ function install_postgres_pg_activity() {
1519
1519
echo " [+] Installing pg-activity"
1520
1520
# amazing tool for monitoring https://github.com/dalibo/pg_activity
1521
1521
# sudo -u postgres pg_activity -U postgres
1522
- apt install pg-activity -y
1522
+ sudo apt-get install -y pg-activity
1523
1523
}
1524
1524
1525
1525
# Doesn't work ${$1,,}
0 commit comments