Skip to content

Commit

Permalink
Fix suggestions given by cgranleese-r7
Browse files Browse the repository at this point in the history
  • Loading branch information
nrathaus committed Apr 21, 2024
1 parent 8526938 commit 533a631
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/metasploit/framework/credential_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def add_public(public_str='')
additional_publics << public_str
end

# When password spraying is enabled, do first passwords then userames
# When password spraying is enabled, do first passwords then usernames
# i.e.
# username1:password1
# username2:password1
Expand All @@ -243,6 +243,8 @@ def add_public(public_str='')
# username2:password2
# username3:password2
# ...
# @yieldparam credential [Metasploit::Framework::Credential]
# @return [void]
def each_unfiltered_password_first
if user_file.present?
user_fd = File.open(user_file, 'r:binary')
Expand Down Expand Up @@ -270,7 +272,7 @@ def each_unfiltered_password_first
if user_fd
user_fd.each_line do |user_from_file|
user_from_file.chomp!
yield Metasploit::Framework::Credential.new(public: user_from_file, private: password, realm: realm, private_type: private_type(pass_from_file))
yield Metasploit::Framework::Credential.new(public: user_from_file, private: password, realm: realm, private_type: private_type(password))
end
user_fd.seek(0)
end
Expand Down Expand Up @@ -336,7 +338,7 @@ def each_unfiltered_password_first
user_fd.close if user_fd && !user_fd.closed?
end

# When password spraying is not enabled, do first usersnames then passwords
# When password spraying is not enabled, do first usernames then passwords
# i.e.
# username1:password1
# username1:password2
Expand All @@ -345,6 +347,8 @@ def each_unfiltered_password_first
# username2:password1
# username2:password2
# username2:password3
# @yieldparam credential [Metasploit::Framework::Credential]
# @return [void]
def each_unfiltered_username_first
if pass_file.present?
pass_fd = File.open(pass_file, 'r:binary')
Expand Down

0 comments on commit 533a631

Please sign in to comment.