added an unless to wrap around the print and report_creds func for nas module to only execute if ftpuser and ftppass is non-blank

bug/bundler_fix
Tyler Bennett 2016-02-24 13:53:30 -05:00
parent 16d7b2e6ff
commit ff3a554b4d
1 changed files with 13 additions and 11 deletions

View File

@ -167,17 +167,19 @@ class Metasploit3 < Msf::Auxiliary
if /[\x00]{16,}(?<ftpuser>[[:print:]]+)[\x00]{16,}(?<ftppass>[[:print:]]+)/ =~ data
ftpuser.strip!
ftppass.strip!
print_good("#{peer} -- NAS Server: #{server}")
print_good("#{peer} -- NAS Port: #{port}")
print_good("#{peer} -- FTP User: #{ftpuser}") unless ftpuser.blank?
print_good("#{peer} -- FTP Pass: #{ftppass}") unless ftppass.blank?
report_creds(
host: server,
port: port,
user: ftpuser,
pass: ftppass,
type: "FTP",
active: true)
unless ftpuser.blank? || ftppass.blank?
print_good("#{peer} -- NAS Server: #{server}")
print_good("#{peer} -- NAS Port: #{port}")
print_good("#{peer} -- FTP User: #{ftpuser}")
print_good("#{peer} -- FTP Pass: #{ftppass}")
report_creds(
host: server,
port: port,
user: ftpuser,
pass: ftppass,
type: "FTP",
active: true)
end
end
end