Skip to content

Commit

Permalink
Warn when a DB option is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Sep 2, 2021
1 parent 5138e1c commit e2beff1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/msf/core/auxiliary/auth_brute.rb
Expand Up @@ -62,8 +62,16 @@ def build_credential_collection(opts)
user_as_pass: datastore['USER_AS_PASS'],
}.merge(opts))

cred_collection = prepend_db_usernames(cred_collection)
cred_collection = prepend_db_passwords(cred_collection)
if framework.db.active
cred_collection = prepend_db_usernames(cred_collection)
cred_collection = prepend_db_passwords(cred_collection)
else
ignored = %w{ DB_ALL_CREDS DB_ALL_PASS DB_ALL_USERS }.select { |option| datastore[option] }
ignored << 'DB_SKIP_EXISTING' unless datastore['DB_SKIP_EXISTING'].blank? || datastore['DB_SKIP_EXISTING'] == 'none'
unless ignored.empty?
print_warning("No active DB -- The following option#{ ignored.length == 1 ? '' : 's'} will be ignored: #{ ignored.join(', ') }")
end
end

# only define the filter if any filtering needs to take place
unless datastore['DB_SKIP_EXISTING'].blank? || datastore['DB_SKIP_EXISTING'] == 'none'
Expand Down

0 comments on commit e2beff1

Please sign in to comment.