bash OSX 恶意终端命令(冒号、方括号、大括号、apersand 等)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1017440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
OSX Malicious Terminal Command (colon, brackets, curly brackets, apersand, etc)
提问by Colin Ramsay
Ok, so someone "challenged" me to enter this into my OSX Terminal, but I have no idea what it would do:
好的,所以有人“挑战”我将其输入到我的 OSX 终端,但我不知道它会做什么:
WARNINGto the reader: the following line can be harmful; do NOTenter it unless you know what you are doing:
警告读者:以下行可能有害;千万不要除非你知道自己在做什么,输入:
:(){ :|:& };:
Any ideas?
有任何想法吗?
回答by Telemachus
It's a fork bomb. Don't do it. (Actually, as GB pointed out quickly, the copy here started out as a broken fork bomb. It was missing its final colon.) Still, if someone says, "Try this command" while snickering, and you don't know what it does, common sense says...
这是一个叉子炸弹。不要这样做。(实际上,正如 GB 很快指出的那样,这里的副本最初是一个破碎的叉形炸弹。它缺少最后一个冒号。)不过,如果有人一边窃笑一边说“试试这个命令”,而你不知道它是什么是的,常识说...
Edit: The one you have hereis pretty famous as a work of artby Jaromil, a digital artist.
回答by realkstrawn93
Breaking down the command so it's actually understandable:
分解命令以便它实际上是可以理解的:
:() #Define new function
#named ':'
{ #Begin function definition
#block
:|:& #Pipe the very ':' function through itself,
#creating two processes, and make the
#resulting copy run in the background
#(the & part)
} #End function definition block
;: #Call ':' for the first time, initiating a chain
#reaction: each instance of ':' will create two
#more instances, ad infinitum
Then again, from my experience Mac OS X happens to have a per-user limit for the number of processes one can execute, so unless you actually have the guts to run the fork bomb under a sudo -sor sudo -ishell, you should be fine.
再说一次,根据我的经验,Mac OS X 碰巧对每个用户可以执行的进程数有限制,所以除非你真的有胆量在 asudo -s或sudo -ishell下运行 fork 炸弹,否则你应该没问题。
回答by ilya n.
It does nothing harmful, since Mac OS X has a (per-user) upper bound for number of processes.
它没有任何危害,因为 Mac OS X 有一个(每个用户)进程数的上限。
回答by G B
Absolutely nothing. It's an incomplete version of the "fork bomb", missing a colon at the end.
绝对没有。这是“叉式炸弹”的不完整版本,末尾缺少一个冒号。
回答by TheBonsai
On properly configured systems it doesn't do much harm, you should be able to try it.
在正确配置的系统上它不会造成太大伤害,您应该可以尝试一下。
回答by samoz
Fork bomb!
叉炸弹!
I mean... fun bomb! Give it a try inside a virtual machine.
我的意思是……有趣的炸弹!在虚拟机中尝试一下。

