Bash Bomb
January 10, 2008 Leave a comment
So my buddy Greg pointed me to what he called a ‘bash bomb’. It looks like:
:(){ :|:& };:
Anyway, all it does is recursively fork. http://www.cyberciti.biz/faq/understanding-bash-fork-bomb/ gives a good explanation. I do like it, because of its simplicity and obscurity. I have to deal with recursively forking things all the time (thanks operating system class with students experimenting with fork for the first time).
A simple pam hard limit on the number of processes can mitigate against this. Put it in /etc/security/limits.conf.
My applicable limits are (fairly liberal):
* soft nproc 225
* hard nproc 300
So far, nothing has crashed the system with these, but I keep having to tweak them, so I may restrict them further in the future.