Fork Bombs
Last updated
Last updated
Ok, so beginning with some basic malware... The simplest of all is a Fork Bomb. Wikipedia defines them as:
A fork bomb (also called rabbit virus or wabbit) is a wherein a continually replicates itself to deplete available system resources, slowing down or crashing the system due to .
Every process that runs on your computer requires some "computing power", and every computer has a limited amount of said computing power. So, if we make a program that consumes all of this computing power, we can essentially render the system (either temporarily or permanently) unusable. Now, there are a lot of ways to do this. But the core concept is that of forking a process. Which means that the process creates a copy of itself (often called the child).
Here are some examples of fork bombs implemented in different mediums/languages:
A fork bomb written in C
:
A fork bomb written in python
:
A fork bomb written in perl
:
A fork bomb written in bash
:
In each example, the core concept is the same, the parent process creates a child process indefinitely.
If you wish to see an... overengineered example of a fork bomb, you can have a look at a package I wrote called GFB:
NOTE: The GFB package actually makes use of yet another package I wrote for a logic bomb, so if you wanna look into it, please do consider first reading up on Logical Bombs.