LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   military grade disk wipe (https://www.linuxquestions.org/questions/linux-security-4/military-grade-disk-wipe-653786/)

Red Squirrel 07-05-2008 03:34 PM

military grade disk wipe
 
Anyone know of a good program that will run within my existing linux OS (aka not a boot disk) that will completly low level wipe a given device?

Right now I'm using a program called copywipe in windows but I'd like to do my drive wiping downstairs in the server room (too hot in my room to have such operation going on) and hook it up to the Linux server instead. I just use a USB connection with an enclosure then point a fan to the drive (gets VERY hot otherwise). The key is I need the wipe to be extremely good so that even if the FBI or other such snoopy organizations got ahold of it, they would not be able to retrieve anything even by removing the platters and analysing the magnetics etc...

This process can take a week per drive, I'm fine with that. I just want to basically fire it up and forget about it then come back and check it later.

Before you say "just physically destroy the drive" these are practically brand new and I rather recycle then throw out.

OlRoy 07-05-2008 03:50 PM

Just so you know, if your drive was made around 2001 or so and later, it's not vulnerable to laboratory microscope attacks. The technology has changed, and you only need to overwrite data once now. The reason why the government still requires many overwrites is in case someone comes out with a similar attack in the future. At least that's what they said in the SANS GCFA training.

Red Squirrel 07-05-2008 04:13 PM

Quote:

Originally Posted by OlRoy (Post 3205049)
Just so you know, if your drive was made around 2001 or so and later, it's not vulnerable to laboratory microscope attacks. The technology has changed, and you only need to overwrite data once now. The reason why the government still requires many overwrites is in case someone comes out with a similar attack in the future. At least that's what they said in the SANS GCFA training.

Good to know. I'd still like to know of such software though so I can still do a decent wipe, but keeping that in mind I'll only do it like 5 times.

XavierP 07-05-2008 05:22 PM

http://dban.sourceforge.net is a bootable CD which gives you many options for wiping hard drives. One of which, from memory, gives you 7 wipes and rewrites and is, apparently, recommended by the NSA.

Red Squirrel 07-06-2008 01:28 PM

That looks good but I'm hoping for something that I can install/run rather the boot off of. I'll be attaching the disks to be wiped via usb external enclosure and plugging them into my live server, don't want to have to boot out of it for that long and my vmware idea did not work. I tried booting off it using my backup server which I can afford to have down for a few days, but it would not recognize usb, guessing it runs at a rather low level dos'ish type format, and not full blown linux with all drivers etc.

simonapnic 07-06-2008 01:36 PM

Well, there are a lot of tools that could help you.
For example, I always shred my data instead of rm-ing it. The shred utility is available on most *NIX-es nowadays. But if you want to do a full disk wipe, you can use the wipe utility Debian provides or just dd-ing it or shred-ing from a LiveCD with some Linux distribution on it.

OlRoy 07-06-2008 01:41 PM

Couldn't you do something like dd if=/dev/random of=/dev/usbdevice? If not, there are some programs on SourceForge

Meson 07-06-2008 01:59 PM

Quote:

Originally Posted by OlRoy (Post 3205766)
Couldn't you do something like dd if=/dev/random of=/dev/usbdevice?

I think that's all those shredding/wiping programs do. They just organize how many cycles are done, and what is in each cycle. You could do 8 full wipes to a disk with some being all 0s, some being all 1s, some being random, and some being specific patterns.

Red Squirrel 07-06-2008 07:32 PM

Quote:

Originally Posted by Meson (Post 3205779)
I think that's all those shredding/wiping programs do. They just organize how many cycles are done, and what is in each cycle. You could do 8 full wipes to a disk with some being all 0s, some being all 1s, some being random, and some being specific patterns.

Can someone explain that command in details? I have an idea of what its doing but the --help file gives me absolutely no info that helps me understand it. I could just write a bash script and have some paterns setup in advanced. Or would copying /dev/urandom a couple times be very efficient?

Right now I found a program called wipe so I did "wipe /dev/sdc" and its at 2% since like, this morning lol.

I figure the odds of goverment agencies getting ahold of the drive (or people with same ability as them) is VERY slim, but rather not take chances. And I rather stay green and have someone else put the drive to good use, then to just smash it. Though smashing it and doing other physical destruction *IS* much more fun. But I'd feel bad doing it to 3 rather new 500GB drives. :P

pinniped 07-06-2008 09:30 PM

'dd' would be the simplest and most effective. Software like 'wipe' makes too many assumptions and doesn't necessarily work, nor would it affect any blocks which it believes is unused.

So:

dd if=/dev/random of=/dev/your_device_to_be_wiped

You can use 'urandom' instead of 'random' if it is faster.
Just run that dd line a few times and everything's gone; better if you can script it because it can take a few hours per pass. Some 'random' devices are pretty slow, so you'd better check on the progress of the 'dd' - otherwise it can take you months to do a single pass. You can check on dd's progress via:

kill -SIGUSR1 $(pidof dd)

jiml8 07-06-2008 09:38 PM

I agree about dd. It is the easiest and best way. Just set up a bash script to run it as many times as you think necessary. If you really want to, you could set up pattern files and write those to the drive, but I would just use /dev/urandom a few times.

Red Squirrel 07-06-2008 09:50 PM

Does DD actually end though? like does it know when it reaches the end of the disk?

Meson 07-06-2008 10:20 PM

Quote:

Originally Posted by Red Squirrel (Post 3206077)
Does DD actually end though? like does it know when it reaches the end of the disk?

Yes, it will stop at the end of the device you specify (in your case either a disk or a partition on a disk.)

You'd probably be better off doing something overnight like:

Code:

dd if=/dev/urandom of=/dev/your_device_to_be_wiped
dd if=/dev/null of=/dev/your_device_to_be_wiped

The NSA specification was something like 8 passes. Two or three should be good though.

If you're worried about time definitely use urandom because if you walk away from your computer overnight there might not be that much activity on /dev/random. To counteract this, you could try shuffling a playlist of all your music - then /dev/random will most likely not be your weakest link.

syg00 07-06-2008 10:26 PM

Yes. You can also get it to report its progress - see the manpage. Also use a (decent) blksize to speed things up.

lwasserm 07-06-2008 11:54 PM

Why not just copy a partition or 2 or 3 & maybe a bunch of jpgs or mp3s from a system you don't care about. Maybe install Vista. It will look like the disk is just a backup or was removed from a working system. An empty, wiped disk would raise some suspicions all by itself that a disk with innocuous data would not.


All times are GMT -5. The time now is 02:54 AM.