Better dynamic soap generation for all the vmware stuff
This commit is contained in:
parent
ddb43774c9
commit
36dc0fee50
File diff suppressed because it is too large
Load Diff
|
@ -40,10 +40,10 @@ class Metasploit3 < Msf::Auxiliary
|
|||
end
|
||||
|
||||
def run
|
||||
|
||||
if vim_do_login(datastore['USERNAME'], datastore['PASSWORD']) == :success
|
||||
vm_ref = vim_find_vm_by_name(datastore['VM'])
|
||||
if vm_ref
|
||||
case vm_ref
|
||||
when String
|
||||
return_state = vim_powerOFF_vm(vm_ref)
|
||||
case return_state
|
||||
when 'success'
|
||||
|
@ -53,7 +53,11 @@ class Metasploit3 < Msf::Auxiliary
|
|||
else
|
||||
print_error "The server returned an unexpected status #{return_state}"
|
||||
end
|
||||
else
|
||||
when :noresponse
|
||||
print_error "The request timed out"
|
||||
when :error
|
||||
print_error @vim_soap_error
|
||||
when nil
|
||||
print_error "Could not locate VM #{datastore['VM']}"
|
||||
end
|
||||
else
|
||||
|
|
|
@ -43,7 +43,8 @@ class Metasploit3 < Msf::Auxiliary
|
|||
|
||||
if vim_do_login(datastore['USERNAME'], datastore['PASSWORD']) == :success
|
||||
vm_ref = vim_find_vm_by_name(datastore['VM'])
|
||||
if vm_ref
|
||||
case vm_ref
|
||||
when String
|
||||
return_state = vim_powerON_vm(vm_ref)
|
||||
case return_state
|
||||
when 'success'
|
||||
|
@ -53,7 +54,11 @@ class Metasploit3 < Msf::Auxiliary
|
|||
else
|
||||
print_error "The server returned an unexpected status #{return_state}"
|
||||
end
|
||||
else
|
||||
when :noresponse
|
||||
print_error "The request timed out"
|
||||
when :error
|
||||
print_error @vim_soap_error
|
||||
when nil
|
||||
print_error "Could not locate VM #{datastore['VM']}"
|
||||
end
|
||||
else
|
||||
|
|
|
@ -45,7 +45,8 @@ class Metasploit3 < Msf::Auxiliary
|
|||
|
||||
if vim_do_login(datastore['USERNAME'], datastore['PASSWORD']) == :success
|
||||
vm_ref = vim_find_vm_by_name(datastore['VM'])
|
||||
if vm_ref
|
||||
case vm_ref
|
||||
when String
|
||||
result = vim_log_event_vm(vm_ref, datastore['MSG'])
|
||||
case result
|
||||
when :noresponse
|
||||
|
@ -57,8 +58,12 @@ class Metasploit3 < Msf::Auxiliary
|
|||
else
|
||||
print_good "User Event logged"
|
||||
end
|
||||
else
|
||||
print_error "Could not locate VM #{datastore['VM']}"
|
||||
when :noresponse
|
||||
print_error "Recieved no Response"
|
||||
when :expired
|
||||
print_error "The login session appears to have expired"
|
||||
when :error
|
||||
print_error @vim_soap_error
|
||||
end
|
||||
else
|
||||
print_error "Login Failure on #{datastore['RHOST']}"
|
||||
|
|
Loading…
Reference in New Issue