Skip to content

Commit 8923252

Browse files
committed
Land rapid7#6259, NoMethodError in vim_soap.rb fix
We haven't been able to get the XML data that would cause the error, all we have is a backtrace. So "verification" is purely code reading. Thanks @wchen-r7 Fixes rapid7#6085 Merge remote-tracking branch 'origin/pr/6259'
2 parents bd9ebee + 977b344 commit 8923252

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/msf/core/exploit/vim_soap.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ def vim_get_session
185185
'headers' => { 'SOAPAction' => @soap_action}
186186
}, 25)
187187
return false unless res and res.code == 200
188-
@server_objects = Hash.from_xml(res.body)['Envelope']['Body']['RetrieveServiceContentResponse']['returnval']
189-
@soap_action = "urn:vim25/#{@server_objects['about']['apiVersion']}"
188+
@server_objects = (((Hash.from_xml(res.body)['Envelope'] || {})['Body'] || {})['RetrieveServiceContentResponse'] || {})['returnval']
189+
@soap_action = "urn:vim25/#{(@server_objects['about'] || {})['apiVersion']}"
190190
if res.headers['Set-Cookie']
191191
@vim_cookie = res.headers['Set-Cookie']
192192
return true

0 commit comments

Comments
 (0)