Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-22-2007, 09:06 AM
|
#1
|
Member
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474
Rep:
|
fork bomb (again)
Hi there,
Could anyone please explain me how does the following fork bomb function?
I now what a fork bomb is but I don't understand that command. So $0 is the name of the script, && is logical AND (1&&1=1 else 0) and & at the end put the command in background.
I don't understand how this could fork child processes.
For those who doesn't know that a fork bomb is (as a concept ) look here: http://en.wikipedia.org/wiki/Fork_bomb
Thanks
|
|
|
02-22-2007, 10:57 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
The $0 is a fork of the original process that called it.
This fork in turn calls $0 as a fork of itself.
This next fork calls $0 as a fork of itself as well.
etc...
Of course the && spawns yet another fork chain that way as well so it's doing it twice on each invocation.
Since $0 for each invocation is the same program/script name it's calling multiple copies of the original program/script name.
It's a lot like just typing:
while true
do $0 &
done
|
|
|
02-22-2007, 11:03 AM
|
#3
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,927
|
And for what it's worth, there is usually a limit on the number of processes any one session can spawn.
|
|
|
02-22-2007, 01:51 PM
|
#4
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
Correct - Depending on kernel parameters. Unfortunately for monolithic apps one sometimes has to bump up NPROC et al to allow the single admin account of the app to open more than would normally be prudent for a single real user. Once it's wide open for that admin user it's wide open for all users. e.g. if one were running Oracle EBusiness Suite most of the process would be started by a single appl user. That wouldn't prevent someone else from shooting the system in the foot by created some loop that eats up CPU and/or memory by utilizing the same resources over and over.
|
|
|
All times are GMT -5. The time now is 01:17 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|