2

I was watching this Defcon video and around 4:30 he shows a custom pattern of drive wiping — the drive is filled with a constant text pattern.

Whether he is joking or not, is this possible? How would it be done using Linux's dd command?

1 Answers1

5

The drive shown is filled with a repeating text pattern. This is dead easy to do. Not with dd, because dd doesn't do repeated patterns. There's no magic in dd, it's just a tool to copy bytes in slightly weird ways, which is very occasionally useful. The magic is in the block device (e.g. /dev/sda for a disk or /dev/sda1 for a partition). To generate a constant pattern, use yes:

yes 'Now wouldn'\'' you like to know what was there before?' >/dev/sda

(Don't run this at home! This is a command to wipe your hard drive. Also, note that in order to wipe the whole drive, you'd probably have to do it from an independent live system: if you wipe the mounted disk you're running from, the system is likely to crash as it tries to load bits of files and fails.)

  • "yes "string of test" | tr "\n" " " > /dev/sda" if you don't like newlines. Excellent for my purpose if writing to a fake USB to see corruption – Sir_Scofferoff Feb 18 '20 at 13:21