From 8327535f1b99c7fa62d49dd39496c3501c17122a Mon Sep 17 00:00:00 2001 From: Pijus Kamandulis Date: Sun, 23 Feb 2025 19:25:54 +0200 Subject: [PATCH] Create unalive.sh --- security/unalive.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 security/unalive.sh diff --git a/security/unalive.sh b/security/unalive.sh new file mode 100644 index 0000000..20af61e --- /dev/null +++ b/security/unalive.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -e + +echo "[*] Stopping services..." +swapoff -a +systemctl disable mysql +systemctl stop mysql +systemctl disable nginx +systemctl stop nginx + +echo "[*] Wiping MySQL data..." +find /var/lib/mysql -type f -exec scrub {} \; + +echo "[*] Wiping websites..." +find /var/www -type f -exec scrub {} \; +find /etc/nginx -type f -exec scrub {} \; + +echo "[*] Wiping mail server data..." +find /var/spool -type f -exec scrub {} \; +find /var/mail -type f -exec scrub {} \; + +echo "[*] Wiping logs..." +find /var/log -type f -exec scrub {} \; + +echo "[*] Wiping user-installed software..." +find /usr/local -type f -exec scrub {} \; + +echo "[*] Wiping home..." +find /root -type f -exec scrub {} \; +find /home -type f -exec scrub {} \; + +echo "[*] Wiping configs..." +find /etc -type f -exec scrub {} \; + +echo "[*] Wiping free space..." +scrub -X / + +echo "[*] Done! System is wiped."