Initial style cleanup
parent
eae2d6c89d
commit
85e5b0abe9
|
@ -78,16 +78,18 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
'username' => datastore['USERNAME'],
|
||||
'password' => datastore['PASSWORD']
|
||||
})
|
||||
if res and res.code == 200
|
||||
if res && res.code == 200
|
||||
return res
|
||||
else
|
||||
if res and res.code == 401
|
||||
elsif res
|
||||
if res.code == 401
|
||||
print_error('401 Unauthorized - Check credentials')
|
||||
else
|
||||
print_error("#{res.code} - Unknown error")
|
||||
end
|
||||
return false
|
||||
else
|
||||
vprint_error('No response')
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# cmd is valid tcl script
|
||||
|
@ -150,7 +152,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
end
|
||||
pay = xml.to_xml
|
||||
res = send_soap_request(pay)
|
||||
if res and res.code == 200 and res.body =~ /\/Common\/#{scriptname}/
|
||||
if res && res.code == 200 && res.body =~ /\/Common\/#{scriptname}/
|
||||
return true
|
||||
else
|
||||
return false
|
||||
|
@ -221,7 +223,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
end
|
||||
pay = xml.to_xml
|
||||
res = send_soap_request(pay)
|
||||
if res and res.code == 200 and res.body =~ /\/Common\/#{handler_name}/
|
||||
if res && res.code == 200 && res.body =~ /\/Common\/#{handler_name}/
|
||||
return true
|
||||
else
|
||||
return false
|
||||
|
@ -260,9 +262,9 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
'username' => datastore['USERNAME'],
|
||||
'password' => datastore['PASSWORD']
|
||||
})
|
||||
if res and res.code == 500 and res.body =~ /path is empty/
|
||||
if res && res.code == 500 && res.body =~ /path is empty/
|
||||
return Exploit::CheckCode::Appears
|
||||
elsif res and res.code == 401
|
||||
elsif res && res.code == 401
|
||||
print_error('401 Unauthorized')
|
||||
return Exploit::CheckCode::Unknown
|
||||
else
|
||||
|
@ -312,7 +314,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
|
||||
sleep(interval+2) # small delay, just to make sure
|
||||
print_status('Trying cleanup...')
|
||||
unless delete_handler(handler) and delete_script(script)
|
||||
unless delete_handler(handler) && delete_script(script)
|
||||
print_error('Error while cleaning up')
|
||||
else
|
||||
print_status('Cleanup finished with no errors')
|
||||
|
|
Loading…
Reference in New Issue