diff --git a/config/bootloaders/grub-pc/live-theme/theme.txt b/config/bootloaders/grub-pc/live-theme/theme.txt index 6c1d4a2..4659367 100644 --- a/config/bootloaders/grub-pc/live-theme/theme.txt +++ b/config/bootloaders/grub-pc/live-theme/theme.txt @@ -1,7 +1,7 @@ desktop-image: "../splash.png" title-color: "#ffffff" title-font: "DejaVu Sans Bold 16" -title-text: "CLI-Testing" +title-text: "CLI-WipeStation" message-font: "Unifont Regular 16" terminal-font: "Unifont Regular 16" diff --git a/config/bootloaders/isolinux/menu.cfg b/config/bootloaders/isolinux/menu.cfg index eb890d0..5637092 100644 --- a/config/bootloaders/isolinux/menu.cfg +++ b/config/bootloaders/isolinux/menu.cfg @@ -2,7 +2,7 @@ timeout 100 menu hshift 0 menu width 82 -menu title CLI-Testing +menu title CLI-WipeStation include stdmenu.cfg label live diff --git a/config/includes.chroot/etc/skel/.bash_profile b/config/includes.chroot/etc/skel/.bash_profile new file mode 100644 index 0000000..f805a16 --- /dev/null +++ b/config/includes.chroot/etc/skel/.bash_profile @@ -0,0 +1 @@ +bash /opt/WipeTool.sh \ No newline at end of file diff --git a/config/includes.chroot/opt/WipeTool.sh b/config/includes.chroot/opt/WipeTool.sh new file mode 100644 index 0000000..3d20565 --- /dev/null +++ b/config/includes.chroot/opt/WipeTool.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +############################### +# @author: Bram Prieshof # +############################### + +#Live Ramdisk/Usb Check +if [ $(findmnt -T /run/live/medium | awk '{print $2}' | sed '1d' | grep -o '.*[^0-9]') == "/dev/shm" ]; then + TERM=ansi whiptail --nocancel --title "WipeStation: Welcome" --msgbox " Running from ram,\n Please make sure the bootable usb is disconnected" 8 60 +fi + +# function to dubble confirm the users action +FuncConfirm(){ + if ! (whiptail --title "WipeStation: Confirmation" --defaultno --yes-button "Yes, erase all data" --yesno " WARNING! WARNING! WARNING! \n All data on connected disk(s) will be wiped and lost. \n\n Do you want to continue?" 10 78); then + return 1 + fi + if ! (whiptail --title "WipeStation: Confirmation" --defaultno --yes-button "Yes, erase all data" --yesno " Just to be sure, \n All data on connected disk(s) will be wiped and lost.\n\n Do you want to continue?" 10 78); then + return 1 + fi +} + +#ABAN function(Not in use, Broken on debian11/Bullseye) +## To enable add the following to the menu: +# "ABAN" "Use Anthony Boot And Nuke erase data on all disks" \ +FuncABAN(){ + #Ask for confirmation before starting task + FuncConfirm + local exitstatusConfirm=$? + [[ "$exitstatusConfirm" = 1 ]] && return 1; + #Run Job + sudo ABAN DESTROY ALL DATA +} + +#wipefs function +FuncWipefs(){ + #Ask for confirmation before starting task + FuncConfirm + local exitstatusConfirm=$? + [[ "$exitstatusConfirm" = 1 ]] && return 1; + #loop through all disk and wipe them + for disk in $(ls /sys/block | grep -v "loop\|sr\|fd\|$(findmnt -T /run/live/medium | awk '{print $2}' | sed -e 's#/dev/###' -e '1d' | grep -o '.*[^0-9]')") + do + echo "Erasing $disk" + sudo /usr/sbin/wipefs -a /dev/$disk + done +} + +#scrub function +FuncScrub(){ + #Ask for scrub/wipe methode + ScrubMETHOD=$( + whiptail --title "WipeStation: scrub select wipe methode" --menu "Make your choice" 16 100 9 \ + "nnsa" "4-pass, NNSA Policy Letter NAP-14.1-C (XVI-8)" \ + "dod" "4-pass, DoD 5220.22-M section 8-306 procedure" \ + "bsi" "9-pass, recommended by the German Center of Security in Information" \ + "gutmann" "5-pass, sequence from Gutmanns paper." \ + "schneier" "7-pass, Bruce Schneier method" \ + "pfitzner7" "7-random-pass, Roy Pfitzner method." \ + "pfitzner33" "33-random-pass, Roy Pfitzner method." \ + "usarmy" "US Army AR380-19 method" \ + "fillzero" "1-pass, fill with zerros." \ + "fillff" "1-pass, fill with ones." \ + "random" "1-pass, fill with random data." \ + "random2" "2-pass, fill with random data." 3>&2 2>&1 1>&3 + ) + local exitstatusMenu=$? + [[ "$exitstatusMenu" = 1 ]] && return 1; + #Ask for confirmation before starting + FuncConfirm + local exitstatusConfirm=$? + [[ "$exitstatusConfirm" = 1 ]] && return 1; + #loop through all disk and wipe them + for disk in $(ls /sys/block | grep -v "loop\|sr\|fd\|$(findmnt -T /run/live/medium | awk '{print $2}' | sed -e 's#/dev/###' -e '1d' | grep -o '.*[^0-9]')") + do + echo "Erasing $disk" + sudo scrub -p $ScrubMETHOD /dev/$disk + done +} + +# Main Menu +while true; do + MainMenu=$( + whiptail --nocancel --title "WipeStation: Main menu" --menu "Make your choice" 16 100 9 \ + "Wipefs" "Remove all partitons, and clear MBR" \ + "Scrub" "Use scrub to erase data on all disks" \ + "Exit" "Exit to shell" \ + "Reboot" "" \ + "Poweroff" "" 3>&2 2>&1 1>&3 + ) + case $MainMenu in + "Poweroff") + sudo poweroff + exit + ;; + "Reboot") + sudo reboot + ;; + "Exit") + exit + ;; + *) + Func$MainMenu + ;; + esac + unset MainMenu + whiptail --nocancel --title "WipeStation: Done" --msgbox " Operation completed \n Press enter to return to the main menu" 8 60 +done diff --git a/config/package-lists/wipe.list.chroot b/config/package-lists/wipe.list.chroot new file mode 100644 index 0000000..d70f0d9 --- /dev/null +++ b/config/package-lists/wipe.list.chroot @@ -0,0 +1,5 @@ +eject +sysstat +hdparm +smartmontools +scrub \ No newline at end of file