Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- #: Filename : selfdestruct.sh
- #: Title : Self Destruct
- #: Author : "Iarmin" <[email protected]>
- #: Version : 0.1
- #: Description : Erases your machine... DO NOT USE IT!
- #: Usage : ./selfdestruct.sh
- #
- #!/bin/bash
- cp `which shred` /bin/shred
- cp `which find` /bin/find
- destruct() {
- echo " Shredding: $1"
- find -type f "$1" | while read f; do
- # /bin/shred -n 1 -z -f -u "$f"
- dd if=/dev/zero "of=$f" bs=4M
- done
- echo " Deleting: $1"
- rm -rf "$1"
- }
- echo "Shredding files..."
- destruct /var
- destruct /home
- destruct /root
- destruct /tmp
- destruct /etc
- destruct /boot
- destruct /srv
- destruct /opt
- destruct /media
- destruct /mnt
- destruct /usr
- destruct /lib
- echo "Overwriting free space with junk..."
- dd if=/dev/urandom of=/placeholder bs=1M
- rm -f /placeholder
- echo "Overwriting the whole disk with junk..."
- dd if=/dev/urandom of=/dev/sda bs=1M
- dd if=/dev/urandom of=/dev/sdb bs=1M
- dd if=/dev/urandom of=/dev/sdc bs=1M
- dd if=/dev/urandom of=/dev/sdd bs=1M
- halt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement