Script install OpenVAS 8, DB Redis and Debian 8.1 (Jessie) x86_64

#!/bin/bash
#OpenVAS 8
#version 8.0.4
#Debian 8.1
#Script
#Mauro Risonho de Paula Assumpção aka firebits mauro.risonho@gmail.com
#11.12.2015 17:51:03

apt-get install -y build-essential devscripts dpatch libassuan-dev libglib2.0-dev libgpgme11-dev libpcre3-dev libpth-dev libwrap0-dev libgmp-dev libgmp3-dev libgpgme11-dev libpcre3-dev libpth-dev quilt cmake pkg-config libssh-dev libglib2.0-dev libpcap-dev libgpgme11-dev uuid-dev bison libksba-dev doxygen sqlfairy xmltoman sqlite3 libsqlite3-dev wamerican redis-server libhiredis-dev libsnmp-dev libmicrohttpd-dev libxml2-dev libxslt1-dev xsltproc libssh2-1-dev libldap2-dev autoconf nmap libgnutls28-dev libpopt-dev heimdal-dev heimdal-multidev libpopt-dev mingw32 texlive-full rpm alien nsis rsync python2.7 python-setuptools

cp /etc/redis/redis.conf /etc/redis/redis.orig
echo “unixsocket /tmp/redis.sock” >> /etc/redis/redis.conf
service redis-server restart

mkdir openvas8
cd openvas8/

wget –no-check-certificate http://wald.intevation.org/frs/download.php/2191/openvas-libraries-8.0.5.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2129/openvas-scanner-5.0.4.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2195/openvas-manager-6.0.6.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2200/greenbone-security-assistant-6.0.6.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2209/openvas-cli-1.4.3.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/1975/openvas-smb-1.0.1.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2177/ospd-1.0.2.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2005/ospd-ancor-1.0.0.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2097/ospd-debsecan-1.0.0.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2003/ospd-ovaldi-1.0.0.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2149/ospd-paloalto-1.0b1.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2004/ospd-w3af-1.0.0.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2181/ospd-acunetix-1.0b1.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2185/ospd-ikescan-1.0b1.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2204/ospd-ikeprobe-1.0b1.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2213/ospd-ssh-keyscan-1.0b1.tar.gz
wget –no-check-certificate http://wald.intevation.org/frs/download.php/2219/ospd-netstat-1.0b1.tar.gz

find | grep “.tar.gz$” | xargs -i tar zxvfp ‘{}’

###############################################

cd openvas-smb*
mkdir build
cd build/
cmake ..
make
make doc-full
make install
cd ../../

cd openvas-libraries-*
mkdir build
cd build
cmake ..
make
make doc-full
make install
cd ../../

cd openvas-scanner-*
mkdir build
cd build/
cmake ..
make
make doc-full
make install
cd ../../

cd openvas-manager-*
mkdir build
cd build/
cmake ..
make
make doc-full
make install
cd ../../

cd openvas-cli-*
mkdir build
cd build/
cmake ..
make
make doc-full
make install
cd ../../

cd greenbone-security-assistant-*
mkdir build
cd build/
cat ../src/xslt_i18n.h | sed ‘s///’ > test; cat test > ../src/xslt_i18n.h
cmake ..
make
make doc-full
make install
cd ../../

###

cd ospd-1*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-ancor-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-debsecan-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-ovaldi-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-paloalto-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-w3af-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-acunetix-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-ikescan-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-ikeprobe-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-ssh-keyscan-*
python setup.py install –prefix=/usr/local
cd ../

cd ospd-netstat-&
python setup.py install –prefix=/usr/local
cd ../

#reload libraries
ldconfig

###############################################

#create cert
openvas-mkcert
openvas-mkcert-client -n -i

#create user
openvasmd –create-user=admin –role=Admin && openvasmd –user=admin –new-password=admin
#(write down the password)

####

echo ‘#!/bin/bash’ > /usr/local/sbin/openvas-update
echo ‘/usr/local/sbin/openvas-nvt-sync’ >> /usr/local/sbin/openvas-update
echo ‘/usr/local/sbin/openvas-scapdata-sync’ >> /usr/local/sbin/openvas-update
echo ‘/usr/local/sbin/openvas-certdata-sync’ >> /usr/local/sbin/openvas-update
chmod +x /usr/local/sbin/openvas-update

echo ‘#!/bin/bash’ > /usr/local/sbin/openvas-start
echo ‘/usr/local/sbin/openvasmd –rebuild’ >> /usr/local/sbin/openvas-start
echo ‘/usr/local/sbin/openvasmd’ >> /usr/local/sbin/openvas-start
echo ‘/usr/local/sbin/openvassd’ >> /usr/local/sbin/openvas-start
echo ‘/usr/local/sbin/gsad’ >> /usr/local/sbin/openvas-start
chmod +x /usr/local/sbin/openvas-start

echo ‘#!/bin/bash’ > /usr/local/sbin/openvas-kill
echo “ps aux | egrep \”(openvas.d|gsad)\” | awk ‘{print \$2}’ | xargs -i kill ‘{}'” >> /usr/local/sbin/openvas-kill
chmod +x /usr/local/sbin/openvas-kill

rclocal=`cat /etc/rc.local | grep -v “exit 0” | grep -v “openvas”`
echo “$rclocal” > /etc/rc.local
echo “date >> /var/log/openvas_init” >> /etc/rc.local
echo “echo ‘openvas init started’ >> /var/log/openvas_init” >> /etc/rc.local
echo “/usr/local/sbin/openvas-kill >> /var/log/openvas_init || /bin/true” >> /etc/rc.local
echo “/usr/local/sbin/openvas-start >> /var/log/openvas_init || /bin/true” >> /etc/rc.local
echo “echo ‘openvas init finished’ >> /var/log/openvas_init” >> /etc/rc.local
echo “exit 0” >> /etc/rc.local

####

/usr/local/sbin/openvas-kill
/usr/local/sbin/openvas-update
/usr/local/sbin/openvas-start

# check installation
wget https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-setup –no-check-certificate
chmod 0755 openvas-check-setup
./openvas-check-setup –v8 –server

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s