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

# Title : linux/x86 _exit(1); 7 bytes
# Published : 2005-11-09
# Author : Charles Stevenson
# Previous Title : linux/x86 dup2(0,0); dup2(0,1); dup2(0,2); 15 bytes
# Next Title : linux/x86 if(read(fd,buf,512)<=2) _exit(1) else buf(); 29 bytes


/* exit-core.c by Charles Stevenson <core@bokeoa.com> 
 *
 * I made this as a chunk you can paste in to make modular remote
 * exploits.  I use it when I need a process to exit cleanly.
 */
char hellcode[] = /*  _exit(1); linux/x86 by core */
// 7 bytes _exit(1) ... 'cause we're nice >:) by core
"x31xc0"              // xor  %eax,%eax
"x40"                  // inc  %eax
"x89xc3"              // mov  %eax,%ebx
"xcdx80"              // int  $0x80
;

int main(void)
{
  void (*shell)() = (void *)&hellcode;
  printf("%d byte _exit(1); linux/x86 by coren",
         strlen(hellcode));
  shell();
  return 0;
}

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