Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It transpires from another thread that there's more to the space before the the start of the first partition than just the MBR. In order to be sure of wiping out any viruses lurking in the pre-first partition space it turns out one would have to wipe not just the first 512 bytes, but the first 62 sectors:
Code:
sudo dd if=/dev/zero of=/dev/sda bs=31744 count=1
One could then still boot the system from a rescue CD. I just thought I'd run this idea past the panel to see if there's any problem with it I haven't envisaged?
*harmless;
He said he still wanted to boot from a rescue CD, so wiping the whole disk is not the right answer.
*Clueless;
63 sectors, not 62-----#0 is the MBR, 1st partition typically starts on #63 (Doesn't everyone count from zero?...)
So:
sudo dd if=/dev/zero of=/dev/sda bs=32256 count=1
OR
sudo dd if=/dev/zero of=/dev/sda bs=512 count=63
GRUB typically puts stage 1.5 and stage 2 after the MBR, so your boot method has to be compatible with all that being gone.
Why not wipe the area and then just re-install GRUB???
Quote:
I think there's hiding room elsewhere too
There's 63 empty sectors at the start of an extended, and all logical, partitions. Otherwise, where is there more hiding space?
Whoops, so he did, my mistake. Isn't there also some space at the end of the disk where metadata for software RAID sits?
I suppose so, but keep in mind that a RAID setup creates a "virtual device" which looks to the OS like a single physical drive. At that point, what is actually written to the physical drives is not relevant to the typical user.
*harmless;
He said he still wanted to boot from a rescue CD, so wiping the whole disk is not the right answer.
That's the understatement of the decade!
I do like his sig, though. :-)
Quote:
63 sectors, not 62-----#0 is the MBR, 1st partition typically starts on #63 (Doesn't everyone count from zero?...)
So:
sudo dd if=/dev/zero of=/dev/sda bs=32256 count=1
OR
sudo dd if=/dev/zero of=/dev/sda bs=512 count=63
These aren't equivalent, are they? The first command nukes the first 63 sectors once; the second over-writes the MBR 63 times, n'est pas?
That's the understatement of the decade!
I do like his sig, though. :-)
Code:
63 sectors, not 62-----#0 is the MBR, 1st partition typically starts on #63 (Doesn't everyone count from zero?...)
So:
sudo dd if=/dev/zero of=/dev/sda bs=32256 count=1
OR
sudo dd if=/dev/zero of=/dev/sda bs=512 count=63
These aren't equivalent, are they? The first command nukes the first 63 sectors once; the second over-writes the MBR 63 times, n'est pas?
The first command writes 32256 bytes in one large chunk. The second command writes 32256 bytes in 512 byte chunks (63 of them).
EDIT:
Quote:
Originally Posted by mostlyharmless
I think there's hiding room elsewhere too. Why not nuke the whole disk:
sudo dd if=/dev/random of=/dev/sda
if I have the syntax right...
That command would never finish, you would have to use '/dev/urandom', but I don't see why not just use /dev/zero ... unless you wanted to cover up the data, but then you'd still have to do it more than once.
Last edited by H_TeXMeX_H; 05-27-2009 at 05:43 AM.
The first command writes 32256 bytes in one large chunk. The second command writes 32256 bytes in 512 byte chunks (63 of them).
Sigh... Oh well, I obviously need to look into "dd" a bit more.
So in that case, say one wanted to over-write the MBR 35 times with random data (the so-called Guttmann Method for secure wiping) what would the command be?
Sigh... Oh well, I obviously need to look into "dd" a bit more.
So in that case, say one wanted to over-write the MBR 35 times with random data (the so-called Guttmann Method for secure wiping) what would the command be?
No, there's no such option AFAIK, but why 35 times ? Whatever virus might have been there is gone after the first wipe. Multiple wipes are only done to make sure forensic tools used by agencies cannot recover any data even with the most sophisticated of technology.
No, there's no such option AFAIK, but why 35 times ? Whatever virus might have been there is gone after the first wipe. Multiple wipes are only done to make sure forensic tools used by agencies cannot recover any data even with the most sophisticated of technology.
It was only by way of an example, TM. Replace 35X with whatever factor >1 you please. I'm just curious as to what the syntax of the command would look like. However, if you say no such option for multiple overwrites exists with 'dd' then unless someone else knows better, I'm quite happy to accept your assertion. ;-)
dd is not very complicated, and I don't think you will find any ambiguity in the answer to your question.
dd may or may not be complicated, but the man pages for it (and for so many other commands) are an atrocity against the English language. Whoever writes such gibberish should be strung up.
BTW, you're up awfully early aren't you?
Last edited by Completely Clueless; 05-27-2009 at 08:22 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.