Added WipeStation modification
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
1
config/includes.chroot/etc/skel/.bash_profile
Normal file
1
config/includes.chroot/etc/skel/.bash_profile
Normal file
@@ -0,0 +1 @@
|
||||
bash /opt/WipeTool.sh
|
||||
107
config/includes.chroot/opt/WipeTool.sh
Normal file
107
config/includes.chroot/opt/WipeTool.sh
Normal file
@@ -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
|
||||
5
config/package-lists/wipe.list.chroot
Normal file
5
config/package-lists/wipe.list.chroot
Normal file
@@ -0,0 +1,5 @@
|
||||
eject
|
||||
sysstat
|
||||
hdparm
|
||||
smartmontools
|
||||
scrub
|
||||
Reference in New Issue
Block a user