Fix nil res when vprints
This commit is contained in:
parent
72cdd67cd0
commit
698e2eab68
|
@ -146,11 +146,11 @@ class Metasploit4 < Msf::Auxiliary
|
|||
|
||||
#Upload file
|
||||
res = do_put(path, data)
|
||||
vprint_status("Reply: #{res.code.to_s}")
|
||||
vprint_status("Reply: #{res.code.to_s}") if not res.nil?
|
||||
|
||||
#Check file
|
||||
if not res.nil? and file_exists(path, data)
|
||||
print_good("File uploaded: #{ip}:#{rport}#{path}")
|
||||
print_good("File uploaded: #{(ssl ? 'https' : 'http')}://#{ip}:#{rport}#{path}")
|
||||
report_vuln(
|
||||
:host => ip,
|
||||
:port => rport,
|
||||
|
@ -176,13 +176,13 @@ class Metasploit4 < Msf::Auxiliary
|
|||
|
||||
#Delete our file
|
||||
res = do_delete(path)
|
||||
vprint_status("Reply: #{res.code.to_s}")
|
||||
vprint_status("Reply: #{res.code.to_s}") if not res.nil?
|
||||
|
||||
#Check if DELETE was successful
|
||||
if res.nil? or file_exists(path, data)
|
||||
print_error("DELETE failed. File is still there.")
|
||||
else
|
||||
print_good("File deleted: #{ip}:#{rport}#{path}")
|
||||
print_good("File deleted: #{(ssl ? 'https' : 'http')}://#{ip}:#{rport}#{path}")
|
||||
report_vuln(
|
||||
:host => ip,
|
||||
:port => rport,
|
||||
|
|
Loading…
Reference in New Issue