Dan Siemon

Bash fork() bomb

Today, I stumbled onto the following nasty bit of shell code in SECURITY Limit User Processes over on the Gentoo Wiki. No, I haven’t switched to Gentoo.

:(){ :|:& };:

Warning, this will cause your shell to create processes as fast as it can; most likely grinding your computer to a halt if you don’t have the appropriate limits set.

After spending some time trying to figure out what this command was doing assuming the colon was functioning as a no-op, I did a quick Google search and found this nice explanation of what it actually does. So, today I learned that Bash allows functions to be defined which override built-in commands.

Exit mobile version