Skip to content

Commit

Permalink
Add documentation and #filtered?
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Sep 2, 2021
1 parent dd86907 commit 01882da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/metasploit/framework/credential_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ def empty?
prepended_creds.empty? && !has_privates?
end

# Returns true when a filter is defined
#
# @return [Boolean]
def filtered?
!self.filter.nil?
end

# Returns true when there are any private values set
#
# @return [Boolean]
Expand Down
7 changes: 7 additions & 0 deletions lib/msf/core/auxiliary/auth_brute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ def initialize(info = {})
], Auxiliary::AuthBrute)
end

# Build a new CredentialCollection instance configured based on the datastore options. Any options passed in will take
# precedence over the datastore. Usernames and passwords will be prepended to the credential collection if their
# respective datastore options are configured appropriately. Finally the resulting CredentialCollection will be
# configured to perform any necessary filtering per the DB_SKIP_EXISTING option.
#
# @param [Hash] opts the options with which to build the CredentialCollection instance
# @return [Metasploit::Framework::CredentialCollection] the built CredentialCollection
def build_credential_collection(opts)
cred_collection = Metasploit::Framework::CredentialCollection.new({
blank_passwords: datastore['BLANK_PASSWORDS'],
Expand Down

0 comments on commit 01882da

Please sign in to comment.