Wednesday, November 23, 2011

Understanding the BASH fork bomb

:(){ :|:& }

is a good old fashion troll against noobs in linux. The above command basically sets up a function named ":" - This trips up noobies because they dont quite get what that is, the dont realize that functions can be named almost anything, not just conventional names like myFunction().

The core of the function basically sets up a pipe and runs in the background that constantly runs and runs again. Thereby using up all the resources on the machine extremely quickly. The funny part is if they try to perform some action to free up resources, the function simply uses up those resources again.

Its a classic.

No comments:

Post a Comment