Browse Source

Fix #6085, NoMethodError in vim_soap.rb

Fix #6085
wchen-r7 4 years ago
parent
commit
977b3449b7
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      lib/msf/core/exploit/vim_soap.rb

+ 2
- 2
lib/msf/core/exploit/vim_soap.rb View File

@@ -185,8 +185,8 @@ module Exploit::Remote::VIMSoap
185 185
       'headers' => { 'SOAPAction' => @soap_action}
186 186
     }, 25)
187 187
     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']}"
190 190
     if res.headers['Set-Cookie']
191 191
       @vim_cookie = res.headers['Set-Cookie']
192 192
       return true

Loading…
Cancel
Save