A fork bomb (also named Rabbit virus) is a denial of service attack against a system.

As its name says, it is based on the fork function and it recursively replicates itself (like Rabbits….), in this way the fork bomb can consume all the resources of the system.

 

Rabbits

 

the classical fork bomb is the following one:

:~ $ cat forkbomb.sh 

:(){ : | : & }; : 

:~ $

It has a strange syntax, but it is really simple. To simplify the reading, change ":" with "forkbomb". 

:~ $ cat forkbomb_simplified.sh 

forkbomb(){ forkbomb | forkbomb & }; forkbomb

:~ $

Often, sys administrators use the above fork bomb to test users limitation on their systems.

On Linux you can act on the /etc/security/limits.conf file to change process limits. You can also use the ulimit command.

Gg1