LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-01-2011, 07:47 PM   #1
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
lsroot local exploit *Old Bug, but still Applied*


One of Indonesian Slackware Community mailing list member posted a link in our mailing list and it contains an old bug since 2004 and he asked to be tested on -Current since he is not using -Current.

I tested on -Current and yes it still applies on my machine (32 bit). Does it still applies on 64 bit system as well?

The code is in here.

I tried to run as normal user account and i turned into root for few seconds and then my computer hang and i had to turn it off by pressing the power button
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-01-2011, 09:50 PM   #2
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
I had a look at the code, it seems it "simply" creates a shared library named "own.so" which export

Code:
int getuid() { return 0; }
int geteuid() { return 0; }
int getgid() { return 0; }
int getegid() { return 0; }
It's like if it was masking standard system API call forcing a "super user" state... I haven't checked too long...

What I don't understand is that the generated source file is appended with /bin/sh... Dunno if it's really part of the exploit, I would expect gcc to stop on the \0 prefix (as a normal c string)...
 
Old 04-01-2011, 09:52 PM   #3
disturbed1
Senior Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,133
Blog Entries: 6

Rep: Reputation: 224Reputation: 224Reputation: 224
Why would you post this?

That's an old trick for gullible people. It's not a bug, the program does not run as root, it's just a fork bomb.

Amazes me how some people would download, and execute untrusted, unverified code. Acts like this is why other operating systems are a haven for virus, spyware, and malware.
 
Old 04-01-2011, 10:01 PM   #4
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
Yes, this is old... And - sorry to say - silly...
If it were really an exploit, why hide it this much?
I would never trust this the way it is.

But it is not an exploit, you won't get any root access with this...
 
Old 04-01-2011, 10:13 PM   #5
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
Yeah that's what I suspected... I just watch the code (I don't run blindly this kind of shit), and was wondering where the exploit was, as I couldn't understand how this could effectively give any access to anything...

Anyway, "any" executable could be some exploit if you don't trust the source... The best protection against this kind of stuff is not to launch anything you don't know AND trust... As always, the biggest security weakness is the user in front of the machine

And as disturbed1 and Neils said, if it was intended to be an exploit it's quite a cheap stuff or an epic fail for a hacker wannabe...
 
Old 04-01-2011, 10:28 PM   #6
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
Yeah, this is "an old trick in the book"...
By preloading the fabricated shared-object (own.so) it replaces the normal system calls to "getuid", "getgid" with a simple "0" - where "0" normally means root.
So the shell that is called asks the UID of the user and receives "0" in return. That's why it displays "root".

But any further system calls will fail, as the user is not really root after all.

Like I said: old and silly...

Willy: Sorry to say, but who sent this is either, eh, a "noob" or has bad intentions...

A real exploit would not be hidden in a silly way and would show how it was done.
And please, don't ever run scripts like this without knowing exactly what you're doing. The next one might contain code to wipe your root partition...
 
2 members found this post helpful.
Old 04-02-2011, 03:17 AM   #7
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Original Poster
Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
i think he also didn't know about this either, that's why he posted this
 
Old 04-02-2011, 03:48 AM   #8
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
While we're on topic here, a good way to protect yourself against fork bombs is to do the following:

Code:
cat >/etc/profile.d/_ulimit.sh <<EOF
#!/bin/sh
ulimit -u 512
EOF

cat >/etc/profile.d/_ulimit.csh <<EOF
#!/bin/csh
limit maxproc 512
EOF

chmod +x /etc/profile.d/_ulimit.*
Systems running PAM use other methods, and this can also be set from /etc/limits but then it doesn't always work. Provided your bourne shells support the "ulimit" command, and that your C shell supports the "limit" command, this should restrict the impact of a fork bomb no matter how you log in to the system. I haven't tried with SSH, though.

Last edited by rg3; 04-02-2011 at 03:49 AM.
 
  


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
New Local Linux Kernel Root Exploit Published win32sux Linux - Security 2 12-23-2010 01:58 AM
Local Glibc shared library (.so) exploit jayjwa Linux - Security 3 04-09-2010 10:45 AM
LXer: Kernel Update to Fix Local Root Exploit LXer Syndicated Linux News 0 02-13-2008 06:10 PM
Linux Kernel 2.6 Local Root Exploit by vmsplice? Inuit-Uprising Slackware 9 02-13-2008 09:41 AM
i need PATCH that protect against local root exploit for kernel 2.2.19 Slackware veenrak Linux - Security 2 10-09-2002 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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