Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fork Bombs
- In computing, a fork bomb is a denial-of-service attack whereby a process continually replicates itself to deplete available system resources.
- - Wikipedia
- So, a fork bomb is a program that just copies itself until (hopefully) the system crashes.
- In the windows cmd and the linux sh / bash shells, you can launch multiple programs at the same time by piping them into each other.
- Let's analyse some example implementations:
- Windows Batch file (.bat)
- Code:
- %0 | %0
- This one is the "classic" forkbomb. %0 is always the name of the current batch file, or the full path to it if you open it from another directory. So if you write this into a fork.bat and launch it, it will execute as this:
- fork.bat | fork.bat
- The pipe character moves the output from one thread into the input of a second one. For that to work both must be running.
- This means that in theory the number of executing batch files will exponentially grow, as every batch window will open two new ones.
- Here is another .bat:
- Code:
- @echo off
- :start
- start "Forkbomb" /high %0
- goto start
- This one works a bit different. Instead of launching two parallel copies, it repeatedly creates a copy of itself.
- BASH function
- Code:
- :(){ :|:&};:
- This is probably the most popular fork bomb. It works on bash shells and makes use of bash functions.
- Part 2 - https://hightechlowlife.eu/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement