Re: wipe utilities

From: David Douthitt (ssratat_private)
Date: Tue Jul 03 2001 - 09:06:39 PDT

  • Next message: daniel heinonen: "Re: Preview in Encase (or other package) rather than image"

    sarnoldat_private wrote:
    
    > Getting other
    > values written will require a bit more work, though I would hope
    > something such as the following would be a good first shot (noting of
    > course that a smarter implementation would probably go much faster):
    > 
    > # boring.c
    > #include <stdio.h>
    > int main(int argc, char *argv[]) {
    >         while(1) {
    >                 printf("%d", argv[1]);
    >         }
    > }
    > 
    > ./boring | dd if=- of=/dev/hda
    
    You could use "yes"; it is essentially the same as "boring.c" with a "y"
    default and a line terminator:
    
    yes "wipe" | dd if=- of=/dev/hda
    
    ...would write the word "wipe" followed by a line-terminator to the hard
    drive over and over.
    
    You could also use the shell:
    
    ( while true; do echo -n "$VAL" ; done ) | dd if=- of=/dev/hda
    
    > If stochastic differences are sufficient, you could probably get away
    > with a small shell script such as this:
    > 
    > #!/bin/sh
    > dd if=/dev/zero         of=/dev/hda
    > dd if=/dev/urandom      of=/dev/hda
    > dd if=/dev/zero         of=/dev/hda
    > dd if=/dev/urandom      of=/dev/hda
    > dd if=/dev/zero         of=/dev/hda
    > dd if=/dev/urandom      of=/dev/hda
    > dd if=/dev/zero         of=/dev/hda
    > dd if=/dev/urandom      of=/dev/hda
    > 
    > The urandom device isn't terribly fast, but you may be able to "get away
    > with" fewer runs due to the more random behavior. <shrug>
    
    What about...
    
    #!/bin/sh
    
    ITER=5
    DEV=/dev/hda
    
    for i in seq 1 $ITER ; do
       dd if=/dev/zero of=$DEV
       dd if=/dev/urandom of=$DEV
    done
    
    -----------------------------------------------------------------
    
    This list is provided by the SecurityFocus ARIS analyzer service.
    For more information on this free incident handling, management 
    and tracking system please see:
    
    http://aris.securityfocus.com
    



    This archive was generated by hypermail 2b30 : Thu Jul 05 2001 - 09:08:29 PDT