Welcome to my site. Please CLICK HERE to give your opinions regarding this new look of "PCTipsbyAnu". Thanks for visiting.

Sunday, August 8, 2010

Browse » Home » , , , , , » How to secure Linux against Fork Bombs?

How to secure Linux against Fork Bombs?






I came across this while browsing, has some pretty solid stuff, goes deeperthan most basic Linux security guides.

It has some good sections like this on protection against fork bombs:

Fork bombs are programs that keep creating child processes until systemresources are all used, they actually aren’t remote exploits because theyrequire a local user to execute the bomb, however, users may be tricked intorunning a fork bomb

For example the following example may look innocent, butrunning it on an unprotected system may take the whole system down:
:( ){ : |:& }; :
WARNING: do NOT run the above code on an unprotected system!

The above shell script will actually keep forking at an exponential rateuntil system resources are exhausted.

To protect a system against such attacks, there is a file for limiting thenumber of processes for each user, it is /etc/security/limits.conf, add thefollowing two lines to it:
@users soft nproc 100
@users hard nproc 150
The lines prevent anyone in the users group from having more than 150processes, and issue a warning at 100 processes.

Your system may not have a users group, so you may need to edit the lines tosuit your needs.

There are some other things you can do like using a file integrity checker,installing a log checker or centralising logs with something like syslog-ng,scanning for SU files on a regular basis, setup alerts if a new user is addedand so on, but this gives you a start.

It has some security tips for OpenSSH, Samba and MySQL too.
I recommend taking a look anyway!
Tips to SecureLinux Workstation.
You can leave a response, or trackback from your own site.

About 'Anu': My name is 'Anu' also Known as 'ANU 007 TIGER' .I'm administrator of 'PC Tips by Anu' blog .This blog was opened for sharing contents about hacking n cracking.
Thanks YAHOO OR GMAIL

0 comments:

Post a Comment

 
Back to Top