opens terminal, pauses So how fucked is my system gonna be afterwards?
:(){ :|:& };:is a classic fork bomb for bash (and other shells which allow:as a function name).running it will likely cause your system to need to be rebooted.
For those curious as to how this works…
Part one is ‘:()’. This creates a new function named ‘:’. That’s because we start with the name, ‘:’, then the open and closed brackets (this is where you put any inputs the function expects), which is the shell syntax for creating a function.
Part two is ’ :'. This creates the content of the function. The curly braces define the beginning and end of the content. Everything inside them is the function itself. The first part of the actual function is ‘:’, so it’s literally running itself. On its own this would just mean it runs forever doing nothing. But then we have a ‘|’ (pipe) character; this takes the output of the previous command and feeds it into the input of the next one. The next command is another ‘:’, so it’s calling itself again. What this means is that every time ‘:’ gets called, it calls itself twice. The last part of the function is an ‘&’ character so that the second call of the function gets run in the background. So now every time this loop runs we create two copies of our program (yes, this is a program, just a very simple one), which each create two copies, and so on.
Finally, we have the last characters / commands. The first is a ‘;’ (semi-colon) which means “After doing that, do this.” That allows us to continue on to the last command, which is ‘:’ again. So, having defined our endlessly multiplying function, we finally run it for the first time, setting off the entire self-replicating loop. Endless copies of this tiny program will run themselves infinitely, eating up all our RAM and CPU time and crashing the PC.
In practice, modern Linux systems have an upper limit on the number of processes that can run, so if your system resources are high enough it won’t crash, just struggle.
Why is the pipe required tho?
Why is the pipe required tho?
it isn’t really. what is required for it to consume memory very rapidly is for each invocation of the function to call itself more than once. using the pipe is just one way to do this; it would work just as well if the pipe character were replaced with an
&
If you’re referring to the cat, it’s a fork bomb. IIRC your system should realize what’s going on and terminate the process before your PC commits seppuku, unless your system is really old. Either way I wouldn’t recommend running it
A similar attack used to be able to be done in Windows by creating a batch file that calls itself at the end.
We used to do it where it would open the command prompt several times and then call itself, so after a couple seconds you would have dozens or hundreds of command prompt windows opening. On a system that only had 128 megs of RAM it didn’t take long for the system to become unresponsive.
:loop notepad.exe goto loopThen place the .bat in the startup folder
Pulling the script out of the vague recesses of my brain, what we did was more like:
ECHO pwned! start /c start.bat start /c start.bat start /c start.bat start.batThen make a shortcut, call it Internet Explorer with the blue E, and wait.
I also wrote a script that would create 1000 folders in your network drive and then change the owner so you couldn’t delete them. We used that one when people left their machine unlocked.
You’ll get a syntax error because bash functions require a space after the {
It’ll be fine after a reboot, or a killall -9 command
Hm…
fish: command substitutions not allowed hereStrange name for a catCurious if
f(){;f|f&};fworks in fish. The version in the image is bash specific, but iirc fish isn’t posix compliant so idk if posix version worksFish has a more explicit syntax so we would need something like
function :;:&;:&;end;:But sadly it notices and stops itNope. Still doesn’t work.
fish: command substitutions not allowed in command position. Try var=(your-cmd) $var ... f(){;f|f&}; ^^
🐟🐟🐟
this was already posted 3 days ago!
oh well ~ ~ ~<3
That’s actually a bashism (defining
:as a function name). For maximum damage, usef(){;f|f&};fWhy do all my forks suddenly explode?! What have you done!









