LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 10-17-2006, 11:05 AM   #1
enigma_0Z
Member
 
Registered: Apr 2005
Distribution: Ubuntu, RHEL, Darwin
Posts: 73

Rep: Reputation: 15
How to creatively kill your system...


Just like the title says, how to creatively kill your system... (assume root access)

And root devs are /dev/hda1 (/boot), /dev/hda2 (swap), /dev/hda3 (/)


I'll just post the one everyone knows...

** NOT CREATIVE **
Code:
rm -rf /
OK, now here's mine:

Code:
dd if=/dev/urandom of=/dev/hda bs=512 count=1
 
Old 10-17-2006, 11:23 AM   #2
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
Set It On Fire!!!!! LOL

Last edited by raska; 10-17-2006 at 11:24 AM.
 
Old 10-17-2006, 11:27 AM   #3
Dragineez
Member
 
Registered: Oct 2005
Location: Annapolis
Distribution: Ubuntu
Posts: 278

Rep: Reputation: 41
Purile

Silly, yes - deleting all files from your hard drive will destroy the system. Not worth mentioning. Now:
Code:
:(){ :|:& };:
That's a bit more clever, and it won't destroy your computer in the process.
 
Old 10-17-2006, 11:34 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
oh come on, that's not fair! is there an explanation?...
 
Old 10-17-2006, 12:07 PM   #5
Dragineez
Member
 
Registered: Oct 2005
Location: Annapolis
Distribution: Ubuntu
Posts: 278

Rep: Reputation: 41
Dos

I found this posted by another user on this forum. It is a Fork Bomb which creates a function that calls itself infinitely, consuming all process slots on the computer and freezing it.
 
Old 10-17-2006, 12:49 PM   #6
crazyjimbo
Member
 
Registered: Mar 2006
Location: Edinburgh
Distribution: Debian Etch, Gentoo
Posts: 90

Rep: Reputation: 16
Code:
alias ls="echo bash: ls: command not found"
It won't kill your system, but will seriously annoy anyone else who tries to use it!
 
Old 10-17-2006, 01:06 PM   #7
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
Quote:
Originally Posted by crazyjimbo
Code:
alias ls="echo bash: ls: command not found"
It won't kill your system, but will seriously annoy anyone else who tries to use it!
But by just typing:
Code:
$ which ls
/usr/bin/ls
$ \ls
avoids aliases
it's easy to beat that one
 
Old 10-17-2006, 01:11 PM   #8
crazyjimbo
Member
 
Registered: Mar 2006
Location: Edinburgh
Distribution: Debian Etch, Gentoo
Posts: 90

Rep: Reputation: 16
I know it isn't bulletproof, but would your first thought really be that someone has messed with your aliases? Maybe it would, but it sure wasn't mine! This worked on me like a treat.
 
Old 10-17-2006, 01:14 PM   #9
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
Quote:
Originally Posted by crazyjimbo
...but would your first thought really be that someone has messed with your aliases?....
LOL you are right, likely I would think that /usr got umounted or corrupted somehow
 
Old 10-17-2006, 02:28 PM   #10
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
Code:
:(){ :|:& };:
Code:
fork() {
    fork | fork &
}

fork
This is a more concise example of the above fork. That line spawns two versions of the program each time around and both those form two more, etc.

For a fun way...
Code:
chmod -Rf 0000 /*
Makes every file on the system unreadable, unwritable, and unexecutable. And it's fun to try and add execute persmissions back when chmod can't be run.

I like this because everything still there... so tempting... but so completely ruined. Reinstall time because you'll never get the permissions right again.

Last edited by frob23; 10-17-2006 at 02:32 PM.
 
Old 10-17-2006, 02:34 PM   #11
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
How about a live-cd
 
Old 10-17-2006, 02:55 PM   #12
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Quote:
Originally Posted by frob23
Code:
chmod -Rf 0000 /*
I could have sworn I've been in situations before where this wouldn't work because it removed execute permission from the toplevel directory first, then tried the children. But I can't get it to work now, so maybe I'm thinking of chown instead...

Anyway, this being irreparable hinges on making / non-exec, but that means all you'd have to do to fix it is use a live CD and mount this partition somewhere the parent directory has exec bit set. Right?
 
Old 10-17-2006, 03:02 PM   #13
Freex
LQ Newbie
 
Registered: Oct 2006
Location: Belgium, Europe
Distribution: OpenSUSE 11.3 KDE, PCLinuxOS 2010 KDE
Posts: 29

Rep: Reputation: 17
Quote:
I found this posted by another user on this forum. It is a Fork Bomb which creates a function that calls itself infinitely, consuming all process slots on the computer and freezing it.
I used to do this on windows xp with batch files ... try running a program if you're pagefile is over 2GB and your real memory is only 512MB

In *NIX, if i wish to log out quicky i just enter (as root) killall x
works all of the time
 
Old 10-17-2006, 03:53 PM   #14
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
Quote:
Originally Posted by taylor_venable
I could have sworn I've been in situations before where this wouldn't work because it removed execute permission from the toplevel directory first, then tried the children. But I can't get it to work now, so maybe I'm thinking of chown instead...

Anyway, this being irreparable hinges on making / non-exec, but that means all you'd have to do to fix it is use a live CD and mount this partition somewhere the parent directory has exec bit set. Right?
Not quite. This command changes all the permissions of all the files and directories on the system. The part which makes it impossible to repair (at least without a reboot to clean media like a live CD) is that the tools you need to fix this (chmod in this case) can't be run because they don't have execute permission.

Yeah, it's also true that you can't navigate the filesystem thanks to the removal of the read and execute bits from directories (which makes it more frustrating).

Fixing this is more complicated than just mounting it somewhere else. You need to boot into a clean filesystem, like from a live CD, and repair all the permissions back to what they should be. It's probably easier to reinstall the base system and then go through and redo the user partitions by hand with a default umask of 0700 for directories and 0600 for files... and then let them make it less restrictive as they want.

There is nothing to prevent this command from running to completion because it's already in memory and running when it changes it's own permissions on disk.

Examples after running it:
Code:
# ls
ls: permission denied
# echo *
altroot bin boot dev etc home kern lib libexec mnt netbsd proc rescue root sbin stand tmp usr var
# cd bin
# echo *
[contents cut for space but shows all files]
#chmod +x /bin/ls
chmod: permission denied
All the files are still there but you can't use them or any of the utilities. Echo is a shell-builtin as is cd... so they still function although I'm shocked that you can cd still, that may be a function of how netbsd treats root though. Yeah, this is a netbsd system but the effect is the same everywhere.
 
Old 10-17-2006, 04:33 PM   #15
St.Jimmy
Member
 
Registered: Jun 2006
Location: Boaz,Alabama
Distribution: Ubuntu 10.10 / Windows 7 Pro 64-Bit / Snow Leopard 10.6.4 64-Bit
Posts: 152

Rep: Reputation: 30
how about a cron that greped *.* every minute and displayed the output? that would tick me off REAL bad
 
  


Reply



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
What if 'kill -9' fails to kill a task? chii-chan Linux - Newbie 15 03-27-2013 03:47 PM
cannot kill X without system crash amobius Linux - Software 1 10-04-2005 06:25 PM
System memory hanging around after kill supinlick Programming 7 08-03-2004 10:02 AM
FADQ : Modem, FDD, Kill and System Hang thomassounness Linux - Newbie 0 07-31-2003 11:13 AM
nvidia drivers kill system -- film at 11 keating_5 Linux - Hardware 2 11-07-2002 09:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 05:28 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