Simplest Virus – Fork Bomb

A virus (as you know) is a piece of code that does something that it shouldn’t. It is a common misconception that you need a vast skill set to make these and that they are extremely complex however in reality they are as simple as sin to make which is why they are so damn annoying. A Fork bomb is considered to be the smallest writable virus in the batch language and it is capable of being annoying and if launched on a home computer however on a server will probably result in a crash. A fork bomb creates two instances which each create two instances and so on…The processes recursively fork; this “forks” the processor and jamm it completely until a crash occurs. Here is how to make it.

Notepad Fork Bomb

Open up notepad and type:
%0|%0
Code language: Arduino (arduino)
and save it as fork.bat Yep..its a virus of just 5 characters :P . On double clicking this file,it will lead to total CPU jam by opening about 500+ process of command prompt.

C Fork Bomb

Here is a in C++ version of Fork bomb.
#include <unistd.h> int main(void) { while(1) fork(); return 0; }
Code language: Arduino (arduino)

Shell Script Fork Bomb

And a shell (Unix/bash) version.
: (){ : |:& };:
Code language: Bash (bash)
Once a successful fork bomb has activated in a system, one may have to reboot to resume normal operation. Stopping a fork bomb requires destroying all running instances of it. Trying to use a program to kill the rogue processes normally requires creating another process a difficult or impossible task as it will totally use memory for its instances. You can get creative and try to use program executables or call system applications or utilities recursively in the same manner and increase the damage manifolds. Let your creativity run loose. Use it for crashing your friends/foe’s PC :P Cheers
About the Author
Rishabh Dangwal is a freelance security consultant, technoblogger and a student pursuing engineering. His tastes include fiddling with every possible piece of computers and technology he could get his hands on and sharing them to the world.

View Comments

  • thanks a lot ........i like to receive this command from you....have a good day...obviously i am going to destroy my foes using this technology,,,,,thank you again...

  • Thanks for this. please send me more codes about making virus. How can i protect my code from illegal use. thanks.

Share
Published by
Rishabh Dangwal
Tags: c language hacked security

Recent Posts

  • Java

Java URL Encoder/Decoder Example

Java URL Encoder/Decoder Example - In this tutorial we will see how to URL encode/decode…

5 years ago
  • General

How to Show Multiple Examples in OpenAPI Spec

Show Multiple Examples in OpenAPI - OpenAPI (aka Swagger) Specifications has become a defecto standard…

5 years ago
  • General

How to Run Local WordPress using Docker

Local WordPress using Docker - Running a local WordPress development environment is crucial for testing…

5 years ago
  • Java

Create and Validate JWT Token in Java using JJWT

1. JWT Token Overview JSON Web Token (JWT) is an open standard defines a compact…

5 years ago
  • Spring Boot

Spring Boot GraphQL Subscription Realtime API

GraphQL Subscription provides a great way of building real-time API. In this tutorial we will…

5 years ago
  • Spring Boot

Spring Boot DynamoDB Integration Test using Testcontainers

1. Overview Spring Boot Webflux DynamoDB Integration tests - In this tutorial we will see…

5 years ago