Tuesday, November 08, 2005

Bash - Choking the system - Fork bomb

This is a wicked post. If you execute the script given in this, then you would need to restart the machine. The command:

:(){ :|:& };:

What does this mean:

:()
{
: | : &
}
:

It creates a function called : and then calls the same recursively in the background. This would cause the system to choke due to continues creation of processes. This is called as a fork-bomb. Fork-bombs can be created in many languages/ways. Check this Wikipedia page.