#!/bin/bash # Install script for OpenVAS-Client/how to install OpenVAS-Client # This script is provided as is and the author does not accept any responsibility # It is generated for you convenience to install tools automatically # If you have comments or perhaps some suggestions you can contact me at # info (at) hacktoolrepository.com # (c) http://www.hacktoolrepostory.com # Script to automatically download and install OpenVAS-Client # Must be run by user who can run 'make install'. # # # Will install the following in this script: # OpenSSL # GnuPG Made Easy # Libgpg-error # Libgcrypt # GnuTLS # libpcap # openvas-libraries # OpenVAS Scanner # openvas-libnasl # AlienVault Feed # Amap # ike-scan # Libwhisker # Net SSLeay # nmap # Nikto # openvas-plugins # openvas-server # OpenVAS-Client #XVER = version number of software package X #XFILE = The file to download and untar #XDIR = The Directory which comes from the untar (i.e. XFILE without extention) #XPATH = Download path #XINSTDIR = The directory where the software should be installed #========================================================================================= PATH68="http://www.hacktoolrepository.com/files/Libraries/OpenSSL/openssl-1.0.0a.tar.gz" FILE68="openssl-1.0.0a.tar.gz" DIR68="openssl-1.0.0a" PROG68="openssl" PATH117="http://www.hacktoolrepository.com/files/Libraries/GnuPG%20Made%20Easy/gpgme-1.1.8.tar.bz2" FILE117="gpgme-1.1.8.tar.bz2" DIR117="gpgme-1.1.8" PROG117="gpgme" PATH109="http://www.hacktoolrepository.com/files/Libraries/Libgpg-error/libgpg-error-1.9.tar.gz" FILE109="libgpg-error-1.9.tar.gz" DIR109="libgpg-error-1.9" PROG109="libgpg" PATH108="http://www.hacktoolrepository.com/files/Libraries/Libgcrypt/libgcrypt-1.4.6.tar.bz2" FILE108="libgcrypt-1.4.6.tar.bz2" DIR108="libgcrypt-1.4.6" PROG108="libgcrypt" PATH94="http://www.hacktoolrepository.com/files/Libraries/GnuTLS/gnutls-2.8.6.tar.bz2" FILE94="gnutls-2.8.6.tar.bz2" DIR94="gnutls-2.8.6" PROG94="gnutls" PATH4="http://www.hacktoolrepository.com/files/Libraries/libpcap/libpcap-1.1.1.tar.gz" FILE4="libpcap-1.1.1.tar.gz" DIR4="libpcap-1.1.1" PROG4="libpcap" PATH115="http://www.hacktoolrepository.com/files/Libraries/openvas-libraries/openvas-libraries-3.1.2.tar.gz" FILE115="openvas-libraries-3.1.2.tar.gz" DIR115="openvas-libraries-3.1.2" PROG115="openvas" PATH147="http://www.hacktoolrepository.com/files/Vulnerability/OpenVAS%20Scanner/openvas-scanner-3.1.0.tar.gz" FILE147="openvas-scanner-3.1.0.tar.gz" DIR147="openvas-scanner-3.1.0" PROG147="openvas" PATH114="http://www.hacktoolrepository.com/files/Libraries/openvas-libnasl/openvas-libnasl-2.0.2.tar.gz" FILE114="openvas-libnasl-2.0.2.tar.gz" DIR114="openvas-libnasl-2.0.2" PROG114="openvas" PATH121="http://www.hacktoolrepository.com/files/Vulnerability/AlienVault%20Feed/alienvault-feed-sync.sh" FILE121="alienvault-feed-sync.sh" DIR121="alienvault-feed-sync" PROG121="alienvault" PATH11="http://www.hacktoolrepository.com/files/Scanning/Amap/amap-5.2.tar.gz" FILE11="amap-5.2.tar.gz" DIR11="amap-5.2" PROG11="amap" PATH118="http://www.hacktoolrepository.com/files/Scanning/ike-scan/ike-scan-1.9.tar.gz" FILE118="ike-scan-1.9.tar.gz" DIR118="ike-scan-1.9" PROG118="ike" PATH86="http://www.hacktoolrepository.com/files/Libraries/Libwhisker/libwhisker2-2.5.tar.gz" FILE86="libwhisker2-2.5.tar.gz" DIR86="libwhisker2-2.5" PROG86="libwhisker" PATH90="http://www.hacktoolrepository.com/files/Libraries/Net%20SSLeay/Net-SSLeay-1.32.tar.gz" FILE90="Net-SSLeay-1.32.tar.gz" DIR90="Net-SSLeay-1.32" PROG90="Net" PATH1="http://www.hacktoolrepository.com/files/Scanning/nmap/nmap-5.21.tar.bz2" FILE1="nmap-5.21.tar.bz2" DIR1="nmap-5.21" PROG1="nmap" PATH19="http://www.hacktoolrepository.com/files/Web%20applications/Nikto/nikto-2.1.2.tar.bz2" FILE19="nikto-2.1.2.tar.bz2" DIR19="nikto-2.1.2" PROG19="nikto" PATH113="http://www.hacktoolrepository.com/files/Vulnerability/openvas-plugins/openvas-plugins-1.0.7.tar.gz" FILE113="openvas-plugins-1.0.7.tar.gz" DIR113="openvas-plugins-1.0.7" PROG113="openvas" PATH112="http://www.hacktoolrepository.com/files/Vulnerability/openvas-server/openvas-server-2.0.3.tar.gz" FILE112="openvas-server-2.0.3.tar.gz" DIR112="openvas-server-2.0.3" PROG112="openvas" PATH116="http://www.hacktoolrepository.com/files/Vulnerability/OpenVAS-Client/openvas-client-3.0.1.tar.gz" FILE116="openvas-client-3.0.1.tar.gz" DIR116="openvas-client-3.0.1" PROG116="openvas" #The directory where the source can be downloaded and build SRCDIR='/usr/local/src/OpenVAS-Client' #The directory where the software should be installed TRGDIR='/usr/local' REDOWNLOAD='no' #Remove downloaded files and download again #Variables will be discovered with which. Only change when prompted by the install script DOWNLOAD='' AWK='' SED='' #========================================================================================= # Don't change anything past here if [ -f /etc/redhat-release ]; then MANPATH='/usr/local/share/man' # for hping fi if [ -z "$1" ]; then echo usage $0 username echo username is the person you normally log on with that will configure and make the program exit fi #The download program to use (i.e. lwp-dowload or wget including full path and options) if [ -d ${DOWNLOAD} ]; then DOWNLOAD=`which wget` fi if [ -z ${DOWNLOAD} ]; then echo Could not find wget to download files. Please set the variable download at the top of the script. exit 3 else TEMPDOWN="${DOWNLOAD} -nc -t 2 --referer=http://www.hacktoolrepository.com/" DOWNLOAD=${TEMPDOWN} fi if [ -z ${SED} ]; then SED=`which sed` fi if [ -z ${SED} ]; then echo Could not find sed program. Please set variable sed at the top of the script. exit 4 fi if [ -z ${AWK} ]; then AWK=`which awk` fi if [ -z ${AWK} ]; then echo Could not find awk program. Please set variable AWK at the top of the script. exit 5 fi # Ran by superuser? eval `/usr/bin/id | ${SED} 's/[^a-z0-9=].*//'` if [ "${uid:=0}" -ne 0 ] then echo $0: You must be root to run $0 exit 2 fi SCRIPTPATH=`pwd` USER=$1 export SRCDIR TRGDIR USER DOWNLOAD SED AWK SCRIPTPATH REDOWNLOAD export PATH68 FILE68 DIR68 export PATH117 FILE117 DIR117 export PATH109 FILE109 DIR109 export PATH108 FILE108 DIR108 export PATH94 FILE94 DIR94 export PATH4 FILE4 DIR4 export PATH115 FILE115 DIR115 export PATH147 FILE147 DIR147 export PATH114 FILE114 DIR114 export PATH121 FILE121 DIR121 export PATH11 FILE11 DIR11 export PATH118 FILE118 DIR118 export PATH86 FILE86 DIR86 export PATH90 FILE90 DIR90 export PATH1 FILE1 DIR1 export PATH19 FILE19 DIR19 export PATH113 FILE113 DIR113 export PATH112 FILE112 DIR112 export PATH116 FILE116 DIR116 umask 022 mkdir -p ${SRCDIR} chown ${USER} ${SRCDIR} cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR68} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE68}" ]; then echo retrieving openssl-1.0.0a.tar.gz ${DOWNLOAD} "${PATH68}" fi; tar -xzvf "${FILE68}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR68}" ./config --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR68}" make install echo "${TRGDIR}/lib" > /etc/ld.so.conf.d/openssl.conf && ldconfig cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR117} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE117}" ]; then echo retrieving gpgme-1.1.8.tar.bz2 ${DOWNLOAD} "${PATH117}" fi; tar -xjvf "${FILE117}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR117}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR117}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR109} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE109}" ]; then echo retrieving libgpg-error-1.9.tar.gz ${DOWNLOAD} "${PATH109}" fi; tar -xzvf "${FILE109}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR109}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR109}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR108} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE108}" ]; then echo retrieving libgcrypt-1.4.6.tar.bz2 ${DOWNLOAD} "${PATH108}" fi; tar -xjvf "${FILE108}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR108}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR108}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR94} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE94}" ]; then echo retrieving gnutls-2.8.6.tar.bz2 ${DOWNLOAD} "${PATH94}" fi; tar -xjvf "${FILE94}" -C "${SRCDIR}" sed -i "s/#include /#include \"\.\.\/\.\.\/lib\/minitasn1\/libtasn1.h\"/" ${DIR94}/lib/gnutls_cert.h && sed -i "s/# include /#include \"\.\.\/\.\.\/lib\/minitasn1\/libtasn1.h\"/" ${DIR94}/lib/gnutls_mpi.h cd "${SRCDIR}/${DIR94}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR94}" make install echo ${TRGDIR}/lib > /etc/ld.so.conf.d/${PROG94}.conf cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR4} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE4}" ]; then echo retrieving libpcap-1.1.1.tar.gz ${DOWNLOAD} "${PATH4}" fi; tar -xzvf "${FILE4}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR4}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR4}" make install mkdir ${TRGDIR}/include/net && ln -sf ${TRGDIR}/include/pcap-bpf.h ${TRGDIR}/include/net/bpf.h && echo "${TRGDIR}/lib" > /etc/ld.so.conf.d/tcpdump.conf && ldconfig cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR115} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE115}" ]; then echo retrieving openvas-libraries-3.1.2.tar.gz ${DOWNLOAD} "${PATH115}" fi; tar -xzvf "${FILE115}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR115}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR115}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR147} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE147}" ]; then echo retrieving openvas-scanner-3.1.0.tar.gz ${DOWNLOAD} "${PATH147}" fi; tar -xzvf "${FILE147}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR147}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR147}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR114} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE114}" ]; then echo retrieving openvas-libnasl-2.0.2.tar.gz ${DOWNLOAD} "${PATH114}" fi; tar -xzvf "${FILE114}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR114}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR114}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR121} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE121}" ]; then echo retrieving alienvault-feed-sync.sh ${DOWNLOAD} "${PATH121}" fi; "${FILE121}" -d "${DIR121}" cd "${SRCDIR}/${DIR121}" ' cd "${SRCDIR}/${DIR121}" cp alienvault-feed-sync.sh ${TRGDIR}/bin/ cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR11} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE11}" ]; then echo retrieving amap-5.2.tar.gz ${DOWNLOAD} "${PATH11}" fi; tar -xzvf "${FILE11}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR11}" ./configure --prefix=${TRGDIR} sed -i "s/XLIBS= /XLIBS= -ldl /g" Makefile make make strip ' cd "${SRCDIR}/${DIR11}" make install cd ${TRGDIR}/etc && wget -N http://freeworld.thc.org/thc-amap/appdefs.trig && wget -N http://freeworld.thc.org/thc-amap/appdefs.resp && wget -N http://freeworld.thc.org/thc-amap/appdefs.rpc cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR118} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE118}" ]; then echo retrieving ike-scan-1.9.tar.gz ${DOWNLOAD} "${PATH118}" fi; tar -xzvf "${FILE118}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR118}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR118}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR86} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE86}" ]; then echo retrieving libwhisker2-2.5.tar.gz ${DOWNLOAD} "${PATH86}" fi; tar -xzvf "${FILE86}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR86}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR86}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR90} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE90}" ]; then echo retrieving Net-SSLeay-1.32.tar.gz ${DOWNLOAD} "${PATH90}" fi; tar -xzvf "${FILE90}" -C "${SRCDIR}" echo y > ${SRCDIR}/answer.txt cd "${SRCDIR}/${DIR90}" perl ./Makefile.PL < ${SRCDIR}/answer.txt make ' cd "${SRCDIR}/${DIR90}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR1} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE1}" ]; then echo retrieving nmap-5.21.tar.bz2 ${DOWNLOAD} "${PATH1}" fi; tar -xjvf "${FILE1}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR1}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR1}" make install cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR19} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE19}" ]; then echo retrieving nikto-2.1.2.tar.bz2 ${DOWNLOAD} "${PATH19}" fi; tar -xjvf "${FILE19}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR19}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR19}" cd .. && cp -R ${DIR19}/* ${TRGDIR}/bin/ cd ${TRGDIR}/bin && ./nikto.pl -update cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR113} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE113}" ]; then echo retrieving openvas-plugins-1.0.7.tar.gz ${DOWNLOAD} "${PATH113}" fi; tar -xzvf "${FILE113}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR113}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR113}" make install ldconfig cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR112} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE112}" ]; then echo retrieving openvas-server-2.0.3.tar.gz ${DOWNLOAD} "${PATH112}" fi; tar -xzvf "${FILE112}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR112}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR112}" make install openvas-nvt-sync cd ${SRCDIR} rm -fr ${SRCDIR}/${DIR116} su ${USER} -c ' cd ${SRCDIR} if [ ! -f "${FILE116}" ]; then echo retrieving openvas-client-3.0.1.tar.gz ${DOWNLOAD} "${PATH116}" fi; tar -xzvf "${FILE116}" -C "${SRCDIR}" cd "${SRCDIR}/${DIR116}" ./configure --prefix=${TRGDIR} make ' cd "${SRCDIR}/${DIR116}" make install echo '#########################################################' echo '# #' echo '# Done installing OpenVAS-Client' echo '# #' echo '#########################################################' echo echo version info for OpenVAS-Client ${TRGDIR}/bin/openssl version ${TRGDIR}/bin/gpgme-config -h ${TRGDIR}/sbin/openvassd -V sh ${TRGDIR}/bin/alienvault-feed-sync.sh openvas > alienvault.log ${TRGDIR}/bin/amap -W ${TRGDIR}/bin/ike-scan -V "${TRGDIR}/bin/${PROG1}" -v cd ${TRGDIR}/bin && ./nikto.pl ${TRGDIR}/bin/OpenVAS-Client -V