Forum Thread: 5 "Deadly" Linux Commands

5 "Deadly" Linux Commands

Everyday, Null Byte is getting bigger, and most of the newcomers are new to hacking and Linux. Without some knowledge on deadly commands, it is easy to trick a newbie into executing these and destroying their Linux OS. I made a list with some of the deadliest commands from tecmint that either remove files, overwrites them, or freezes your system.

Warning: These commands should NEVER be executed. They will most likely destroy your system (or ruin a major part) before you can stop them, however, if you want to see how they work, you could run them inside a Virtual Machine.

So, let's get started:

  1. "rm -rf /"
  • This command basically means "remove all files (even Read Only files) recursively in the root (top) directory" (can also be written as "shred -rf /)"
  1. ":(){:|:&};:"
  • This command is known as a 'Fork Bomb'. It operates by defining a function called ':', which calls itself twice, once in the foreground and once in the background. It keeps on executing again and again till the system freezes. (Source: tecmint.)
  1. "'command' > /dev/sda"
  • This command writes the output of 'command' to the specified drive. This is considered deadly because it overwrites any data on the drive.
  1. "mkfs.ext3 /dev/sda"
  • This command is known as a format command. It will format the specified drive to an ext3 format, wiping everything on the drive.
  1. "dd if=/dev/random of=/dev/sda"
  • This command writes random data onto the specified drive, and overwrites any data within that drive.

These are a few of the many deadly commands for Linux. This post was made for the newcomers in Linux (and maybe some of the veterans) who are likely to run the commands if told it will fix a problem. I, myself, was tricked into executing the 1st command listed here a while back and it took me FOREVER to get all my data and documents back. Also, if you have any more deadly commands, post them below.

Next post: Social Engineering: Getting the 'keys' to the world.

10 Responses

dd is a true deadly command indeed! it wouldn't surprise me if it were named dd because of DeaDly. cool post!

-Phoenix750

Dd is powerful both ways. Best way to clone disks, straight forward and fast.

Shred and /dev/random are the deadliest as far as I know, because they don't just clear the disk out of hard links, but they also replace all the disks content with random data.

I wish I could understand how that Fork Bomb works, I just can't make sense of those symbols.

I think () means foreground and & means background. I think this command bounces something back and forth between through the foreground and background as stated and overloads the system

From Wikipedia:

:(){ :|: & };:

By replacing the function identifier ":" with "bomb" and re-indenting, the code reads:

bomb() {
bomb | bomb &
};
bomb

So, what it does is create a bash function that is a loop and run it.

Knowing that : can be the name of the function everything becomes clear. Thanks Marcelo Brandao :)

I wrote words to explain each symbol, and you gave me the missing piece :)

: = Name of the function
() = No argument for the function
{ = Start content of the function

:|:& = Run itself and then pipe to a new instance of itself in the background that runs itself in the foreground, and pipes to itself in the background, and so on (loop)

} = End content of the function
; = New bash argument
: = Run the function

Boom.

Eh... shred is more permanent...

Good job for writing this so we won't have problems with Miz running evil code...

A good reason to not run any scripts made by somebody unless you know what they do.

i was also tricked into running the first command when i was looking for ways to speed up my system

Share Your Thoughts

  • Hot
  • Active