Advertisement
iarmin

Self Destruct

May 10th, 2011
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.02 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. #: Filename    : selfdestruct.sh
  4. #: Title       : Self Destruct
  5. #: Author      : "Iarmin" <[email protected]>
  6. #: Version     : 0.1
  7. #: Description : Erases your machine... DO NOT USE IT!
  8. #: Usage       : ./selfdestruct.sh
  9. #  
  10.  
  11. #!/bin/bash
  12.  
  13. cp `which shred` /bin/shred
  14. cp `which find` /bin/find
  15.  
  16.  
  17. destruct() {
  18.     echo "  Shredding: $1"
  19.     find -type f "$1" | while read f; do
  20. #       /bin/shred -n 1 -z -f -u "$f"
  21.         dd if=/dev/zero "of=$f" bs=4M
  22.     done
  23.     echo "  Deleting: $1"
  24.     rm -rf "$1"
  25. }
  26.  
  27. echo "Shredding files..."
  28. destruct /var
  29. destruct /home
  30. destruct /root
  31. destruct /tmp
  32. destruct /etc
  33. destruct /boot
  34. destruct /srv
  35. destruct /opt
  36. destruct /media
  37. destruct /mnt
  38. destruct /usr
  39. destruct /lib
  40.  
  41. echo "Overwriting free space with junk..."
  42. dd if=/dev/urandom of=/placeholder bs=1M
  43. rm -f /placeholder
  44.  
  45. echo "Overwriting the whole disk with junk..."
  46. dd if=/dev/urandom of=/dev/sda bs=1M
  47. dd if=/dev/urandom of=/dev/sdb bs=1M
  48. dd if=/dev/urandom of=/dev/sdc bs=1M
  49. dd if=/dev/urandom of=/dev/sdd bs=1M
  50.  
  51. halt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement