Use less memory when brute forcing with a large wordlist

This commit is contained in:
erwanlr
2013-10-05 20:03:34 +01:00
parent 90ade58842
commit 474816762f
8 changed files with 55 additions and 121 deletions

View File

@@ -5,17 +5,12 @@ class WpUsers < WpItems
# Brute force each wp_user
#
# To avoid loading the wordlist each time in the wp_user instance
# It's loaded here, and given to the wp_user
#
# @param [ String, Array<String> ] wordlist
# @param [ String ] wordlist The path to the wordlist
# @param [ Hash ] options See WpUser::BruteForcable#brute_force
#
# @return [ void ]
def brute_force(wordlist, options = {})
passwords = WpUser::BruteForcable.passwords_from_wordlist(wordlist)
self.each { |wp_user| wp_user.brute_force(passwords, options) }
self.each { |wp_user| wp_user.brute_force(wordlist, options) }
end
end