diff --git a/lib/msf/ui/console/command_dispatcher/db.rb b/lib/msf/ui/console/command_dispatcher/db.rb index 6512e0674e..901a84380e 100644 --- a/lib/msf/ui/console/command_dispatcher/db.rb +++ b/lib/msf/ui/console/command_dispatcher/db.rb @@ -888,12 +888,12 @@ class Db query.find_each do |core| # Exclude non-blank username creds if that's what we're after - if user && user.empty? && !(core.public && core.public.username.blank?) + if user == "" && !(core.public && core.public.username.blank?) next end # Exclude non-blank password creds if that's what we're after - if pass && pass.empty? && !(core.private && core.private.data.blank?) + if pass == "" && !(core.private && core.private.data.blank?) next end diff --git a/spec/lib/msf/ui/console/command_dispatcher/db_spec.rb b/spec/lib/msf/ui/console/command_dispatcher/db_spec.rb index 7ecefe78d1..30efd61906 100644 --- a/spec/lib/msf/ui/console/command_dispatcher/db_spec.rb +++ b/spec/lib/msf/ui/console/command_dispatcher/db_spec.rb @@ -145,7 +145,7 @@ describe Msf::Ui::Console::CommandDispatcher::Db do context "and when the username is blank" do it "should show a user that matches the given expression" do - db.cmd_creds("-u", blank_username ) + db.cmd_creds("-u", blank_username) @output.should =~ [ "Credentials", "===========", @@ -158,7 +158,7 @@ describe Msf::Ui::Console::CommandDispatcher::Db do end context "and when the password is blank" do it "should show a user that matches the given expression" do - db.cmd_creds("-P", blank_password ) + db.cmd_creds("-P", blank_password) @output.should =~ [ "Credentials", "===========",