Gah screwed up that commit, accidentally chunked out the rescues.

This commit is contained in:
David Maloney 2012-02-15 02:12:06 -06:00
parent 6b539036c9
commit e0f11992af
2 changed files with 25 additions and 10 deletions

View File

@ -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

View File

@ -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