Results 1 to 6 of 6
Hi
Recently i saw a post with the following script:
Code:
:() { :|: & } ; :
Out of curiosity i ran it on my machine - and it ...
- 03-17-2010 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 18
dangerous script
Hi
Recently i saw a post with the following script:
Out of curiosity i ran it on my machine - and it completely froze:Code::() { :|: & } ; :
i even couldn't connect via ssh. I had to do a cold start...
Can anybody explain what exactly this script does?
I have no idea what those brackets and colons mean.
Thank You
Jody
- 03-17-2010 #2
It´s a fork bomb.
It forks children and waits for their completion, but the childs also fork childs and wait....
That grows exponentially.
So the machines´ load explodes and it will run out of memory eventually.
You can prevent that by setting limits.
Which might be a good idea in a multi-user environmentYou must always face the curtain with a bow.
- 03-17-2010 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 18
Thank you for your reply
I'd like to understand the details:
Could you explain in more detail the different parts?
Like which is the command for forking, what is the
meaning of the curly brackets and their content, and
what do the colons mean?
Or perhaps you can give a ointer where i can read about this?
(I tried googling these things, but googling for colons or brackets doesn't work.)
Thank You
Jody
- 03-17-2010 #4
The : are equal to true and the others...well they may actually depend on context so I'm not sure...but you can try here
Advanced Bash-Scripting Guide
If I had to guess
Code::() { :|: & } ; : :() is a function declaration {}this is the body of the function :|:& is the contents of the function and finally : is caling the function..Like I said guessLast edited by gerard4143; 03-17-2010 at 05:02 PM.
Make mine Arch Linux
- 03-17-2010 #5linux user # 503963
- 03-21-2010 #6is equivalent. It works by starting new processes in the background, each of which starts new processes. Eventually the computer can't keep up with the number of processes being started.Code:
function fork() { fork | fork & } fork()
By coincidence, I am wearing a t-shirt withon itCode::() { :|: & } ; :
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.


Reply With Quote
