PDA

View Full Version : how to rollback openvas to cd original



reaperz73
2013-05-15, 21:01
Hey everyone this is a how to rollback openvas to the cd original after apt-get dist-upgrade breaks it.
!!! Updated May 17 to do both 64 bit and i386 !!!
This is for a hard drive install with Kali 64 bit and i386.

copy this code to a file ie. openvasrollback.sh


#!/bin/bash
echo -e "\033[31mThis script will roll OpenVas back to Version 5\033[m"
echo "Do you want to rollback ? (Y/N)"
read install
if [[ $install = Y || $install = y ]] ; then
echo -e "\033[31m====== Rolling OpenVas back to V5 ======\033[m"
apt-get remove --purge greenbone-security-assistant libopenvas6 openvas-administrator openvas-manager openvas-cli openvas-scanner
mkdir openvasfix
cd openvasfix
if [ $(uname -m) == "x86_64" ] ; then
#64 bit system
wget http://repo.kali.org/kali/pool/main/o/openvas-manager/openvas-manager_3.0.4-1kali0_amd64.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-administrator/openvas-administrator_1.2.1-1kali0_amd64.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-cli/openvas-cli_1.1.5-1kali0_amd64.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-scanner/openvas-scanner_3.3.1-1kali1_amd64.deb
wget http://repo.kali.org/kali/pool/main/o/openvas/openvas_1.1_amd64.deb
wget http://repo.kali.org/kali/pool/main/g/greenbone-security-assistant/greenbone-security-assistant_3.0.3-1kali0_amd64.deb
wget http://repo.kali.org/kali/pool/main/libo/libopenvas/libopenvas5_5.0.4-1kali0_amd64.deb
else
#32 bit system
wget http://repo.kali.org/kali/pool/main/o/openvas-manager/openvas-manager_3.0.4-1kali0_i386.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-administrator/openvas-administrator_1.2.1-1kali0_i386.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-cli/openvas-cli_1.1.5-1kali0_i386.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-scanner/openvas-scanner_3.3.1-1kali1_i386.deb
wget http://repo.kali.org/kali/pool/main/o/openvas/openvas_1.1_i386.deb
wget http://repo.kali.org/kali/pool/main/g/greenbone-security-assistant/greenbone-security-assistant_3.0.3-1kali0_i386.deb
wget http://repo.kali.org/kali/pool/main/libo/libopenvas/libopenvas5_5.0.4-1kali0_i386.deb
fi
dpkg -i *
apt-get install gsd kali-linux kali-linux-full
wget --no-check-certificate https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-setup
chmod +x openvas-check-setup
./openvas-check-setup --v5
else
echo -e "\e[32m[-] Ok,maybe later !\e[0m"
fi
echo -e "\e[32m[-] Done!\e[0m"

save the file ie. openvasrollback.sh and then chmod +x it.
run this script with ie.
./openvasrollback.sh

enjoy openvas 5 again! :)

compuwar
2013-05-15, 21:19
I had to add http://repo.kali.org/kali/pool/main/libo/libopenvas/libopenvas5_5.0.4-1kali0_amd64.deb
It's still not totally happy with the stuff in init.d to run the setup, but I can at least start the server now, still looking for the init packages.

reaperz73
2013-05-15, 21:28
I had to add http://repo.kali.org/kali/pool/main/libo/libopenvas/libopenvas5_5.0.4-1kali0_amd64.deb
It's still not totally happy with the stuff in init.d to run the setup, but I can at least start the server now, still looking for the init packages.

thanks I fixed the script to include libopenvas5 and also the check setup script

compuwar
2013-05-15, 22:01
I just re-ran this after adding the lib and gsd to the downloads and now the original openvas-setup script runs but openvas manager is grumpy about its database versions:

md main:MESSAGE:2013-05-15 22h00.16 utc:19769: init_manage: database version of database: 11

md main:MESSAGE:2013-05-15 22h00.16 utc:19769: init_manage: database version supported by manager: 56

md main:CRITICAL:2013-05-15 22h00.16 utc:19769: main: database is wrong version


openvasmd --rebuild, openvasmd --migrate and openvasmd --update all seem to not work. I tried nuking openvas.* are reinstalling, but no joy. Thoughts?

reaperz73
2013-05-15, 22:08
I just re-ran this after adding the lib and gsd to the downloads and now the original openvas-setup script runs but openvas manager is grumpy about its database versions:

md main:MESSAGE:2013-05-15 22h00.16 utc:19769: init_manage: database version of database: 11

md main:MESSAGE:2013-05-15 22h00.16 utc:19769: init_manage: database version supported by manager: 56

md main:CRITICAL:2013-05-15 22h00.16 utc:19769: main: database is wrong version


openvasmd --rebuild, openvasmd --migrate and openvasmd --update all seem to not work. I tried nuking openvas.* are reinstalling, but no joy. Thoughts?

run the openvas-check-setup script
also note I just changed the original post and added apt-get install gsd kali-linux kali-linux-full to the script so you will have the menu items back
be aware when you run the check-setup up script it will take a really long time to repair the databases

compuwar
2013-05-15, 22:49
check-setup gave me:

Error: no such table: meta
ERROR: Could not determine database revision, database corrupt or in invalid format.
FIX: Delete database at /var/lib/openvas/mgr/tasks.db and rebuild it.

but deleting the db didn't help- and I'm not sure what to do about the missing table. I'll try purging and re-running the script...

Ok- I had to manually nuke /var/cache/openvas. gsd wouldn't install without a download and the check script gets an SSL validation error, but I already had a copy of it resident...

Here's what I ended up doing:

added gsd_1.2.2-1kali0_amd64.deb to the mix
purged each individual package
rm -rf /var/lib/openvas and /var/cache/openvas
re-ran the script
ran openvas-setup

but now I have a disk error I have to fix, so I have to reboot to see where things are...

reaperz73
2013-05-15, 22:59
That's weird compuwar gsd version in the repos has not changed?
Oh well lets see how it goes after your reboot.

compuwar
2013-05-15, 23:02
I changed my sources.list to try to reinstall from CD, probably the issue.
doing openvas-scapdata-sync now, it's slow...

compuwar
2013-05-15, 23:04
FYI: openvas-check-setup probably needs a --v5 at the end above too, unless your version is older than mine

reaperz73
2013-05-15, 23:04
yeah openvas-scapdata-sync takes forever

reaperz73
2013-05-15, 23:05
FYI: openvas-check-setup probably needs a --v5 at the end above too, unless your version is older than mine

Thanks I just fixed it.

compuwar
2013-05-16, 00:16
Needed an openvsmd --rebuild followed by openvas-setup then everything worked- thanks so much for your help!

n1tr0g3n
2013-05-17, 05:06
Thanks reaperz73, I just ran the bash script and it fixed it and added OpenVAS back to the menu under Vulnerability Analysis > OpenVAS Quick heads up for everyone I had to reboot before I could log in to OpenVAS and also to use the web interface at http://127.0.0.1:9392

Thanks again reaperz73

reaperz73
2013-05-18, 01:52
In the rollback script,
I have replaced this
wget https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-setup
with this
wget --no-check-certificate https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-setup

to ignore the certificate error

something is up with openvas certificate.

reaperz73
2013-05-18, 02:50
!!! Update re-wrote script to be 64 bit and i386 and sexier check first post for the new version

when123
2013-05-25, 14:22
Hey everyone this is a how to rollback openvas to the cd original after apt-get dist-upgrade breaks it.
!!! Updated May 17 to do both 64 bit and i386 !!!
This is for a hard drive install with Kali 64 bit and i386.

copy this code to a file ie. openvasrollback.sh


#!/bin/bash
echo -e "\033[31mThis script will roll OpenVas back to Version 5\033[m"
echo "Do you want to rollback ? (Y/N)"
read install
if [[ $install = Y || $install = y ]] ; then
echo -e "\033[31m====== Rolling OpenVas back to V5 ======\033[m"
apt-get remove --purge greenbone-security-assistant libopenvas6 openvas-administrator openvas-manager openvas-cli openvas-scanner
mkdir openvasfix
cd openvasfix
if [ $(uname -m) == "x86_64" ] ; then
#64 bit system
wget http://repo.kali.org/kali/pool/main/o/openvas-manager/openvas-manager_3.0.4-1kali0_amd64.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-administrator/openvas-administrator_1.2.1-1kali0_amd64.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-cli/openvas-cli_1.1.5-1kali0_amd64.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-scanner/openvas-scanner_3.3.1-1kali1_amd64.deb
wget http://repo.kali.org/kali/pool/main/o/openvas/openvas_1.1_amd64.deb
wget http://repo.kali.org/kali/pool/main/g/greenbone-security-assistant/greenbone-security-assistant_3.0.3-1kali0_amd64.deb
wget http://repo.kali.org/kali/pool/main/libo/libopenvas/libopenvas5_5.0.4-1kali0_amd64.deb
else
#32 bit system
wget http://repo.kali.org/kali/pool/main/o/openvas-manager/openvas-manager_3.0.4-1kali0_i386.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-administrator/openvas-administrator_1.2.1-1kali0_i386.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-cli/openvas-cli_1.1.5-1kali0_i386.deb
wget http://repo.kali.org/kali/pool/main/o/openvas-scanner/openvas-scanner_3.3.1-1kali1_i386.deb
wget http://repo.kali.org/kali/pool/main/o/openvas/openvas_1.1_i386.deb
wget http://repo.kali.org/kali/pool/main/g/greenbone-security-assistant/greenbone-security-assistant_3.0.3-1kali0_i386.deb
wget http://repo.kali.org/kali/pool/main/libo/libopenvas/libopenvas5_5.0.4-1kali0_i386.deb
fi
dpkg -i *
apt-get install gsd kali-linux kali-linux-full
wget --no-check-certificate https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-setup
chmod +x openvas-check-setup
./openvas-check-setup --v5
else
echo -e "\e[32m[-] Ok,maybe later !\e[0m"
fi
echo -e "\e[32m[-] Done!\e[0m"

save the file ie. openvasrollback.sh and then chmod +x it.
run this script with ie.
./openvasrollback.sh

enjoy openvas 5 again! :)


gsad: error while loading shared libraries: libmicrohttpd.so.10: cannot open shared object file: No such file or directory

reaperz73
2013-06-03, 05:42
@when123

apt-get install libmicrohttpd

However OpenVas 6 is working now. So no need to rollback.