Skip to content

Commit 977b344

Browse files
committed
Fix rapid7#6085, NoMethodError in vim_soap.rb
Fix rapid7#6085
1 parent 57304a3 commit 977b344

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)