4 ms·
Wait, is this run locally because I could just do :(){:|:&}; :& which is pretty effective.
by chuhnk 16y ago
Wait, is this run locally because I could just do :(){:|:&}; :& which is pretty effective.
- JoachimSchipper 16y agoNot on a competently-run (multiuser) system, which will have process limits etc in place.
- nailer 16y agoIndeed. I'm wondering if the parent attack somehow bypasses open file hard limits.
- rcfox 16y agoAm I the only one who initially thought this was a sequence of emoticons?
- chuhnk 16y agohaha yes I can see it now. Its a bash function that gets called recursively. Nice and simple, I've tested it in a few different environments, linux 2.4, linux 2.6, open bsd, solaris. All vanilla installs. Solaris is the only one I havent seen die.
- zandorg 16y agoConfuse the computer by making it sad?
- johnswamps 16y agoI'm not sure why : has been chosen as the canonical fork bomb function name, but it's more readable with something like resurse() { recurse | recurse &}; recurse
- kmort 16y agoAnd it's usually accompanied by the adjective "elegant", which I find rather baffling. "Cute" or "cryptic", perhaps.
- marbu 16y agoIn this example, the poor readability is a feature. Nevertheless the ":" character is bash inner function, which tells the shell to do nothing (except the arguments expansion), like pass in python. This means that you can redefine it and use it to confuse others. Most of other special characters are not functions so you are not able to redefine them that easily.
- pyre 16y agoFor the uninitiated see the Wikipedia entry on "fork bombs"
- hdx 16y agou mind sharing what ":(){:|:&}; :&" means?
- callahad 16y agohttp://en.wikipedia.org/wiki/Fork_bomb http://en.wikipedia.org/wiki/Fork_bomb
- chuhnk 16y ago:() is a function that accepts no arguments, it calls itself (recursion) then pipes the output to another call to itself that is backgrounded, basically two calls to the function. That is the function definition, it is then called and backgrounded via :& I am a true believer in the power of bash and despite the fact that it is not a programming language I will still try use it in that form just for fun.