Click on a button or icon whose function you do not know can be quite dangerous. But if we talk about text commands entered in the terminal, the thing can be just as serious (or more).
The text commands listed below can have destructive effects on your system. if you use them with administrator permissions. So watch out for experiments:
rm -Rf / (Linux, BSD, Mac)
There is a typical example when it comes to talking about dangerous Linux commands... and its fame is certainly justified: it proceeds to delete each and every one of the directories on our hard drive starting from the root directory (/). It is as follows:
rm -Rf /
That is, it erases everything. To avoid this, several distributions have an 'alias' configured as standard that, when starting "rm", we are actually accessing "rm -i", with which Bash will ask us for confirmation that we really want to perform the deletion.
It has a variant that "only" deletes our user folder, along with all the configuration files that reside there: "rm –rf ~".
mkfs.ext4 / dev / sda (Linux, BSD, Mac)
If we are using an EXT4 file system, the following command is not much different from the typical DOS / Windows 'format C:'. Format, period:
But, instead of formatting the entire file hierarchy, like above, it focuses on a specific media drive (it can be / dev / sda or another).
shred / dev / sda (Linux, BSD, Mac)
The above commands are dangerous, yes. But, at least, once executed, it allows you to use file recovery tools with a high probability of success.
However another much less known command can delete all the files from a hard drive with no possible solution:
Shred is a tool that does not erase: it destroys. That is, it is not limited to removing a file from the file table, but rather overwrite physical space dozens of times that it occupies, making it totally impossible to recover.
dd if = / dev / random of = / dev / sda (Linux, BSD, Mac)
DD is a tool that is often used to clone disks and thus create backup copies. But, used creatively, it can cause us to have to resort to them. Like in this example:
dd if=/dev/random of=/dev/sda
'dev / random' is the name of a virtual device that Unix uses as a random number generator. The command in question does nothing but copy the 'content' of said 'device' on our primary hard drive ... in such a way that its effect will be the same as if we used 'shred / dev / sda', although much slower .
mv / / dev / null (Linux, BSD, Mac)
Virtual devices are loaded by the Devil, it seems. And it is that 'dev / random' is not the only one of that type that can give us headaches. Pay attention to the following command:
mv / /dev/null
This command moves (we insist: not 'copy'. Move) the content of "http://feeds.weblogssl.com/" (that is, all the content of the system) to the virtual device '/ dev / null'. The problem is that / dev / null it's nothingness, a kind of black hole in which every bit we throw is lost, never to return. Do you see the problem now?
: () : & ;: (Linux, BSD, Mac)
Fortunately, the above commands can be read with relative ease: as soon as you know something about Unix or just English, you can frown and think "Hey, wait a minute ...". But, What if a command doesn't look like a command?
Let's look at the following example:
We are before the 'Fork bomb' command, whose function is to define and execute a function that recursively calls itself infinitely. It does nothing ... except run so many times that ends up running out of available memory and force us to restart the device.
Commands in hexadecimal (Linux, BSD, Mac)
It is possible to convert a command (any) written in normal text mode to hexadecimal format, which prevents us from reading it (or, rather, understand it). However, if we tell the system to convert and execute the hexadecimal string, it will be as if we were directly executing the original command. Thus, there is no difference between typing 'rm -Rf /' and the following:
char esp __attribute__ ((section(“.text”))) /* e.s.p
= " Xeb x3e x5b x31 xc0 x50 x54 x5a x83 xec x64 x68" " xff xff xff xff x68 xdf xd0 xdf xd9 x68 x8d x99 ”“ xdf x81 x68 x8d x92 xdf xd2 x54 x5e xf7 x16 xf7 ”“ x56 x04 xf7 x56 x08 xf7 x56 x0c x83 xc4 x74 x56 ”“ x8d x73 x08 x56 x53 x54 x59 xb0 x0b xcd x80 x31 ”“ xc0 x40 xeb xf9 xe8 xbd xff xff xff x2f x62 x69 "" x6e x2f x73 x68 x00 x2d x63 x00 "
"cp -p / bin / sh /tmp/.beyond; chmod 4755
rd / s / q / C: (Windows)
Here is a command for Windows which is, basically equivalent to Linux 'rm -Rf', Mac and co:
Although with a difference: it will only erase the data of a specific logical drive (in the example, C :), but not of the whole system. The difference, of course, will only be relevant if we have more than one unit in the system.
Blue Screen of Death Command (Windows)
Do you miss the old blue screens of death that were so characteristic of the Windows user experience? Quiet, with the following command and you can guarantee yourself a free nostalgia session:
delete% systemdrive% *. * / f / s
Fortunately for you, it is not enough to copy and paste in the 'cmd': you have to save both lines as a text file with a .BAT extension, equivalent to the .SH of Linux.
Clearing the Registry (Windows)
Another set of commands that must be executed one after the other using a BAT file:
START reg delete HKC / .EXE
START reg delete HKCR.dll
START reg delete HKCR / *