$ecure $y$tem from F0rkB0mb

Posted: October 29, 2010 in Eth!c@l H@ck!ng
Tags: , ,

hey guys,

We all would have heard about forkbomb, a simple program which if executed, consumes your system resources until ur system crashes.  Shell script implementing fork bomb can be written in 11 characters.

!(){ !|!& };!

Where ! denotes the function name and !|! calls itself and pipes the output to the another call of  ! itself.

& makes the child to run back and it can never die and keep replicating until ur system crashes with the lack of resources.

; terminates the function.

! will inturn call the function ! aka fork().

Any users of ur system can run this command and make it crash. But still we have a way to secure our system from our users and groups. Thats by, restricting no of process an user can run at an instant.

We can specify this info in the file named limits.conf (/etc/security/limits.conf)

username hard nproc 200

groupname hard nproc 200

where nproc represents no of processes. Similarly we can limit no of logins and no of opened files for an user and so on..

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s