Fork bomb

From Computernewb Wiki
Jump to navigation Jump to search
ForkLeft.jpgForkLeft.jpgForkieIcon.pngFork.jpgFork.jpg

RedError-x16.png THIS PAGE CONTAINS FORKIE CONTENT, IT IS PROBABLY GAY TO READ THIS! RedError-x16.png

A fork bomb is a .bat (Windows) or .sh (Linux) file that contains code that constantly forks the script's process and all of the script's children. This takes up all of the available memory, causing the computer or VM to quickly freeze, along with other side effects. Very rarely will a fork bombed PC recover without requiring a force reboot. No permanent damage is likely to be caused, however unsaved data may be lost. These types of scripts are frequently used by forkies to crash the VM.

Side Effects

  • PC freezes.
  • When the PC is not frozen, all applications will be unresponsive, and sometimes even the start menu will become unresponsive.
  • On Windows, one of the Command Prompts opened by the process may cause an error. The error is caused indirectly by a lack of remaining memory, and is related to the fork bomb attempting to fork itself when the memory is completely used.

Types

This section will show the most common fork bombing commands on CollabVM.

Windows

  • %0|%0

This command forks the script into the background. The script that was forked performs this function again, and then the next script performs it again, and so on, depleting system resources until the PC crashes. This command is unpatched.

  • :loop & start fork.bat & goto loop

Uses the goto function to loop and start itself. As the goto and start commands were removed, this command is patched.

Linux

  • :(){ :|:& };:

An odd looking process that defines the function :, forks the process into the background, and then loops. This command is unpatched.

A dissection:

  • :(){ defines the function :.
  • :|: spawns the : process and pipes itself into another :.
  • & makes the piped : fork into the background.
  • }; ends the function definition.
  • : starts the loop, however the :|:& portion maintains it.