how to make the world’s simplest malware in C

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 …


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » how to make the world’s simplest malware in C." seatbelt | Sciencx - Wednesday July 30, 2025, https://www.scien.cx/2025/07/30/how-to-make-the-worlds-simplest-malware-in-c/
HARVARD
seatbelt | Sciencx Wednesday July 30, 2025 » how to make the world’s simplest malware in C., viewed ,<https://www.scien.cx/2025/07/30/how-to-make-the-worlds-simplest-malware-in-c/>
VANCOUVER
seatbelt | Sciencx - » how to make the world’s simplest malware in C. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/07/30/how-to-make-the-worlds-simplest-malware-in-c/
CHICAGO
" » how to make the world’s simplest malware in C." seatbelt | Sciencx - Accessed . https://www.scien.cx/2025/07/30/how-to-make-the-worlds-simplest-malware-in-c/
IEEE
" » how to make the world’s simplest malware in C." seatbelt | Sciencx [Online]. Available: https://www.scien.cx/2025/07/30/how-to-make-the-worlds-simplest-malware-in-c/. [Accessed: ]
rf:citation
» how to make the world’s simplest malware in C | seatbelt | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.