Difference between revisions of "Linux Secure Delete"
From Hack Sphere Labs Wiki
(Created page with " sudo apt-get install secure-delete This has four tools: srm - securely delete an existing file smem - securely delete traces of a file from ram sfill - wipe all the space mark...") |
(→SCRIPTS) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
This has four tools: | This has four tools: | ||
− | srm - securely delete an existing file | + | srm - securely delete an existing file |
− | smem - securely delete traces of a file from ram | + | smem - securely delete traces of a file from ram |
− | sfill - wipe all the space marked as empty on your hard drive | + | sfill - wipe all the space marked as empty on your hard drive |
− | sswap - wipe all the data from you swap space. | + | sswap - wipe all the data from you swap space. |
+ | |||
+ | =Wipe Drive Erase= | ||
+ | *dd command | ||
+ | dd if=/dev/zero of=/dev/sdX iflag=nocache oflag=direct bs=4096 | ||
+ | |||
+ | *dd command repeat | ||
+ | |||
+ | <pre> | ||
+ | while [ 1 ]; | ||
+ | do | ||
+ | dd if=/dev/zero of=/dev/sdX iflag=nocache oflag=direct bs=4096 | ||
+ | sleep 5; | ||
+ | done | ||
+ | </pre> | ||
+ | |||
+ | *Progress of DD | ||
+ | <pre> | ||
+ | while [ 1 ]; | ||
+ | do | ||
+ | kill -USR1 $(pidof dd) | ||
+ | sleep 5; | ||
+ | done | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | ==Notes== | ||
+ | *https://wiki.archlinux.org/index.php/Securely_wipe_disk#Checking_progress_of_dd_while_running | ||
+ | |||
+ | =SCRIPTS= | ||
+ | <pre> | ||
+ | cat * | ||
+ | #! /bin/bash | ||
+ | #wtf | ||
+ | |||
+ | if [ -z "$1" ] | ||
+ | then | ||
+ | echo "Please specify a target:" | ||
+ | echo "/dev/sda" | ||
+ | echo "/anything/anything" | ||
+ | exit | ||
+ | fi | ||
+ | |||
+ | echo "Reading Entire Drive" | ||
+ | |||
+ | while [ 1 ]; | ||
+ | do | ||
+ | dd if=$1 of=/dev/zero bs=64M | ||
+ | sleep 5; | ||
+ | done | ||
+ | |||
+ | #! /bin/bash | ||
+ | #wtf | ||
+ | |||
+ | if [ -z "$1" ] | ||
+ | then | ||
+ | echo "Please specify a target:" | ||
+ | echo "/dev/sda" | ||
+ | echo "/anything/anything" | ||
+ | exit | ||
+ | fi | ||
+ | |||
+ | echo "Writing Entire Drive" | ||
+ | |||
+ | while [ 1 ]; | ||
+ | do | ||
+ | dd if=/dev/zero of=$1 bs=64M | ||
+ | sleep 5; | ||
+ | done | ||
+ | |||
+ | #! /bin/bash | ||
+ | while [ 1 ]; | ||
+ | do | ||
+ | kill -USR1 $(pidof dd) | ||
+ | sleep 5; | ||
+ | done | ||
+ | |||
+ | </pre> |
Latest revision as of 04:41, 16 October 2014
sudo apt-get install secure-delete
This has four tools:
srm - securely delete an existing file smem - securely delete traces of a file from ram sfill - wipe all the space marked as empty on your hard drive sswap - wipe all the data from you swap space.
Wipe Drive Erase
- dd command
dd if=/dev/zero of=/dev/sdX iflag=nocache oflag=direct bs=4096
- dd command repeat
while [ 1 ]; do dd if=/dev/zero of=/dev/sdX iflag=nocache oflag=direct bs=4096 sleep 5; done
- Progress of DD
while [ 1 ]; do kill -USR1 $(pidof dd) sleep 5; done
Notes
SCRIPTS
cat * #! /bin/bash #wtf if [ -z "$1" ] then echo "Please specify a target:" echo "/dev/sda" echo "/anything/anything" exit fi echo "Reading Entire Drive" while [ 1 ]; do dd if=$1 of=/dev/zero bs=64M sleep 5; done #! /bin/bash #wtf if [ -z "$1" ] then echo "Please specify a target:" echo "/dev/sda" echo "/anything/anything" exit fi echo "Writing Entire Drive" while [ 1 ]; do dd if=/dev/zero of=$1 bs=64M sleep 5; done #! /bin/bash while [ 1 ]; do kill -USR1 $(pidof dd) sleep 5; done