Uses an enumerator to read wordlist during pwd attack. Fixes #1518

This commit is contained in:
erwanlr
2020-07-16 14:39:09 +02:00
parent ff574b046c
commit f65532e347
5 changed files with 7 additions and 17 deletions

View File

@@ -41,7 +41,7 @@ module WPScan
msg: "Performing password attack on #{attacker.titleize} against #{users.size} user/s")
end
attacker.attack(users, passwords(ParsedCli.passwords), attack_opts) do |user|
attacker.attack(users, ParsedCli.passwords, attack_opts) do |user|
found << user
attacker.progress_bar.log("[SUCCESS] - #{user.username} / #{user.password}")
@@ -122,15 +122,6 @@ module WPScan
acc << Model::User.new(elem.chomp)
end
end
# @param [ String ] wordlist_path
#
# @return [ Array<String> ]
def passwords(wordlist_path)
@passwords ||= File.open(wordlist_path).reduce([]) do |acc, elem|
acc << elem.chomp
end
end
end
end
end