When typed into a bash prompt :(){ :|:&};: I have been told it does bad things so don't try it, is it folklore or does it really do something nasty ?
On Wed, 2004-11-03 at 22:47 +0100, Wayne Stallwood wrote:
When typed into a bash prompt :(){ :|:&};: I have been told it does bad things so don't try it, is it folklore or does it really do something nasty ?
It's a fork bomb.. read fully it is: define function called ':' as being the result of calling ':' piped through ':' put into the background. Then call the function ':' Rapidly spirals into doom. A common alternative you see floating around is: _(){_&_}_ D. -- Daniel Silverstone http://www.digital-scurf.org/ PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895
On 03-Nov-04 Daniel Silverstone wrote:
On Wed, 2004-11-03 at 22:47 +0100, Wayne Stallwood wrote:
When typed into a bash prompt :(){ :|:&};: I have been told it does bad things so don't try it, is it folklore or does it really do something nasty ?
It's a fork bomb.. read fully it is:
define function called ':' as being the result of calling ':' piped through ':' put into the background. Then call the function ':'
Rapidly spirals into doom.
A common alternative you see floating around is:
_(){_&_}_
Another subtle bomb is cat < /dev/tty0 If you don't like what happens, you can try killing it from another console. This one is relatively less disastrous, in that it is possible to close it down. Just how, is left as an exercise for the reader[1]. Best wishes to all, Ted. [1] Hint: X -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 04-Nov-04 Time: 09:32:09 ------------------------------ XFMail ------------------------------
On Wed, Nov 03, 2004 at 10:47:12PM +0100, Wayne Stallwood wrote:
When typed into a bash prompt
:(){ :|:&};:
I have been told it does bad things so don't try it, is it folklore or does it really do something nasty ?
Looking at it, I'd say it creates a function called : and then recursively executes itself through itself... probably ends in an infinite loop, with lots and lots and lots of forks. Though, I could be wrong :) If anyone else can see anything obvious, that I've missed, I'd be interested. Thanks, -- Brett Parker web: http://www.sommitrealweird.co.uk/ email: iDunno@sommitrealweird.co.uk
On Wed, Nov 03, 2004 at 10:01:14PM +0000, Brett Parker wrote:
On Wed, Nov 03, 2004 at 10:47:12PM +0100, Wayne Stallwood wrote:
When typed into a bash prompt
:(){ :|:&};:
I have been told it does bad things so don't try it, is it folklore or does it really do something nasty ?
Looking at it, I'd say it creates a function called : and then recursively executes itself through itself... probably ends in an infinite loop, with lots and lots and lots of forks.
Though, I could be wrong :)
If anyone else can see anything obvious, that I've missed, I'd be interested.
Thanks,
Note to self: when you think it's going to fork lots, and you've posted this to the list, at least give it 5 mins for Daniel to confirm it *before* you decide to randomly try it to see what happens Note number2: process limit myself so that I can't cause such pain and unclean reboots again Note number3: XFS rocks, the machine came back cleanly, and fast :) Thanks, -- Brett Parker web: http://www.sommitrealweird.co.uk/ email: iDunno@sommitrealweird.co.uk
On Wednesday 03 November 2004 10:11 pm, Brett Parker wrote:
Note to self: when you think it's going to fork lots, and you've posted this to the list, at least give it 5 mins for Daniel to confirm it *before* you decide to randomly try it to see what happens
Note number2: process limit myself so that I can't cause such pain and unclean reboots again
Note number3: XFS rocks, the machine came back cleanly, and fast :)
Thanks,
LOL (really I did) Now you know why I posted to the list rather than trying it.
participants (4)
-
Brett Parker -
Daniel Silverstone -
Ted.Harding@nessie.mcc.ac.uk -
Wayne Stallwood