Gah screwed up that commit, accidentally chunked out the rescues.
This commit is contained in:
parent
6b539036c9
commit
e0f11992af
|
@ -60,6 +60,7 @@ module Exploit::Remote::VIMSoap
|
|||
|
||||
|
||||
def vim_get_session_list
|
||||
vim_setup_references
|
||||
soap_req =
|
||||
%Q|<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<env:Body>
|
||||
|
@ -78,15 +79,23 @@ module Exploit::Remote::VIMSoap
|
|||
</env:Body>
|
||||
</env:Envelope>|
|
||||
|
||||
res = send_request_cgi({
|
||||
'uri' => '/sdk',
|
||||
'method' => 'POST',
|
||||
'agent' => 'VMware VI Client',
|
||||
'cookie' => @vim_cookie,
|
||||
'data' => soap_req,
|
||||
'headers' => { 'SOAPAction' => @soap_action}
|
||||
}, 25)
|
||||
print_status res.body
|
||||
res = send_request_cgi({
|
||||
'uri' => '/sdk',
|
||||
'method' => 'POST',
|
||||
'agent' => 'VMware VI Client',
|
||||
'cookie' => @vim_cookie,
|
||||
'data' => soap_req,
|
||||
'headers' => { 'SOAPAction' => @soap_action}
|
||||
}, 25)
|
||||
return :noresponse unless res
|
||||
if res.body.include? "NotAuthenticatedFault"
|
||||
return :expired
|
||||
elsif res.body.include? "<faultstring>"
|
||||
return :error
|
||||
end
|
||||
session_list = []
|
||||
session_list << Hash.from_xml(res.body)['Envelope']['Body']['RetrievePropertiesResponse']['returnval']['propSet']['val']
|
||||
return session_list.flatten.compact
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,13 @@ class Metasploit3 < Msf::Auxiliary
|
|||
else
|
||||
vprint_error("http://#{ip}:#{rport} - No response")
|
||||
end
|
||||
|
||||
rescue ::Rex::ConnectionError => e
|
||||
vprint_error("http://#{ip}:#{rport}#{datastore['URI']} - #{e}")
|
||||
return false
|
||||
rescue
|
||||
vprint_error("Skipping #{ip} due to error - #{e}")
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue