Uninstalling Dr.Web vxCube

To remove all vxCube components from the server in case of installation errors, you can use a script. Run it on every node where you have vxCube components installed.

warning_green

If you run the uninstallation script on the host of vxcube_web_host, it will remove the vxcube-web database, including all previous scan results, created users, and all other data.

Uninstallation Keeping Windows VMs

To save time on re-installation, pass the keepvm argument when running the script. It will keep the information on all cloned virtual machines on hosts with Windows analyzers (hyperbox_hosts).

Then you will be able to restart the installer with the option hyperbox_hbsetup: false (the flag that indicates if VMs need to be recloned) and avoid having to clone the machines again.

Running a Script

To run a script

1.Save the contents below to the file clean.sh.

2.To run it, use the command sudo bash clean.sh.
 

clear

echo 'Warning! This uninstallation script will completely remove all data and services associated with vxCube installation, including the database, scan results, created users, integration settings, etc.'

while true; do

   read -p "Continue uninstallation? (yes/no) " yn

   case $yn in

       [Yy]* ) echo go clean; break;;

       [Nn]* ) exit;;

       * ) echo "Needs response Yes or No.";;

   esac

done

 

set -x

 

# docker services

docker container stop $(docker container ls -aq)

docker system prune -a --volumes -f

docker image prune -a -f

systemctl stop docker

rm -rf /etc/docker

apt purge -y docker-ce

apt purge -y docker.io

rm -rf /etc/systemd/system/multi-user.target.wants/containerd.service

# docker vxcube web

rm -rf /var/lib/vxcube

rm -rf /opt/vxcube

rm -rf /var/log/vxcube

userdel -f -r vxcube

# docker yara

rm -rf /etc/yara_service /var/log/yara_service

# docker drweb

rm -rf /etc/drweb-service /var/log/drweb

 

# vxcube-flow-api

systemctl stop vxcube-flow-api

systemctl disable vxcube-flow-api

rm -rf /var/lib/vxcube-flow-api /var/log/vxcube-flow-api /etc/vxcube-flow-api

rm -rf /etc/apt/sources.list.d/*

rm -rf /etc/systemd/system/vxcube-flow-api.service

rm -rf /etc/systemd/system/multi-user.target.wants/vxcube-flow-api.service

userdel -f -r hyperbox-api

 

# linuxbox

systemctl stop linuxbox-routes

systemctl stop linuxbox_rpc

systemctl disable linuxbox-routes

systemctl disable linuxbox_rpc

rm -rf /etc/systemd/system/linuxbox-routes.service

rm -rf /etc/systemd/system/linuxbox_rpc.service

/var/lib/linuxbox/routes_reset.sh

rm -rf /var/lib/linuxbox

rm -rf /var/lib/storage/linuxbox-*

rm -rf /etc/linuxbox

apt purge -y qemu*

 

# dimas

systemctl stop dimas_android7.1_vxcube

systemctl stop dimasnet

systemctl disable dimas_android7.1_vxcube

systemctl disable vboxapi_android

rm -rf /etc/systemd/system/dimas*.service

rm -rf /etc/systemd/system/vboxapi_android.service

rm -rf /etc/systemd/system/multi-user.target.wants/apkrobot_*.service /etc/systemd/system/apkrobot_*.service

userdel -f -r dimas

rm -rf /var/lib/dimas

rm -rf /var/log/dimas

rm -rf /etc/dimas

 

# hyperbox

systemctl stop hbcheck

systemctl stop vboxsvc

systemctl stop hyperbox_winxpx86_vxcube hyperbox_win7x64_vxcube hyperbox_win7x86_vxcube hyperbox_win10x64_1903_vxcube hyperbox_win10x64_1511_vxcube

systemctl disable vboxsvc hbcheck hyperbox_winxpx86_vxcube hyperbox_win7x64_vxcube hyperbox_win7x86_vxcube hyperbox_win10x64_1903_vxcube hyperbox_win10x64_1511_vxcube

systemctl disable vboxdrv vboxautostart-service vboxballoonctrl-service

rm -rf /etc/systemd/system/hbcheck.service

rm -rf /etc/systemd/system/hyperbox_*.service

rm -rf /etc/systemd/system/vboxapi.service

rm -rf /etc/systemd/system/vboxnet.service

rm -rf /etc/systemd/system/vboxsvc.service

rm -rf /etc/fakenet /etc/vbox /etc/hyperbox /var/lib/vboxnet_workspace

rm -rf /var/log/hyperbox /var/log/vbox*

if [ "$1" == "keepvm" ]; then

 # this will keep vms and configs

 apt remove -y virtualbox-hyperbox

else

 # this will delete all

 apt purge -y virtualbox-hyperbox

 userdel -f -r hyperbox

 rm -rf /var/lib/hyperbox

 rm /var/lib/storage/* -r

fi

apt purge drweb-procdump -y

apt purge aksusbd -y

 

# evparser

systemctl stop evparser

systemctl disable evparser

rm -rf /var/lib/evparser /var/lib/evparser/.cache /etc/evparser /var/log/evparser

rm -rf /etc/systemd/system/evparser.service

rm -rf /etc/systemd/system/multi-user.target.wants/evparser.service

userdel -f -r evparser

 

# pogreb

rm -rf /etc/pogreb-client /var/log/pogreb-client

 

# ftp

systemctl stop proftpd

sudo apt purge -y proftpd*

rm -rf /etc/proftpd /var/log/proftpd

rm -rf /srv/vxcube

 

# dhcp

apt purge -y dnsmasq

apt purge -y isc-dhcp-server

# remove includes from dhcp config (they will not be deleted by dpkg)

DHCP_CONF=/etc/dhcp/dhcpd.conf

if [ -f $DHCP_CONF ] ; then

   sed -i 's#include "/etc/dhcp/dhcpd.vbox";##g' $DHCP_CONF

   sed -i 's#include "/etc/dhcp/dhcpd_android.vbox";##g' $DHCP_CONF

fi

rm /etc/dhcp/dhcpd.vbox

rm /etc/dhcp/dhcpd_android.vbox

 

# openvpn

systemctl stop openvpn

rm -rf /var/log/openvpn

rm -rf /etc/openvpn

apt purge -y openvpn

 

# nginx

systemctl stop nginx

# dpkg warns on non-empty

rm -rf /etc/nginx /var/www/html /var/log/nginx

apt purge -y nginx*

 

# rabbitmq

systemctl stop rabbitmq-server

apt purge -y rabbitmq-server

 

# zabbix

apt purge -y zabbix-*

rm -rf /etc/systemd/system/multi-user.target.wants/zabbix-agent.service

 

# all virtualenvs

rm -rf /var/lib/virtualenvs

 

apt purge -y python-pip

apt purge -y python3-pip

 

# firewall clean

iptables -t nat -F

iptables -t mangle -F

iptables -F

iptables -X

iptables -P INPUT ACCEPT

iptables -P FORWARD ACCEPT

iptables -P OUTPUT ACCEPT

iptables-save | sudo tee /etc/iptables/rules.v4 >> /dev/null

 

apt autoremove -y

 

systemctl daemon-reload

systemctl reset-failed