Skip to content

Commit 27a540e

Browse files
committed
Land rapid7#1215, creds reuse for AuthBrute modules
2 parents dac9ac4 + 38fd8d4 commit 27a540e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/msf/core/auxiliary/auth_brute.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ def initialize(info = {})
2222
OptBool.new('VERBOSE', [ true, "Whether to print output for all attempts", true]),
2323
OptBool.new('BLANK_PASSWORDS', [ false, "Try blank passwords for all users", true]),
2424
OptBool.new('USER_AS_PASS', [ false, "Try the username as the password for all users", true]),
25+
OptBool.new('DB_ALL_CREDS', [false,"Try each user/password couple stored in the current database",true]),
26+
OptBool.new('DB_ALL_USERS', [false,"Add all users in the current database to the list",false]),
27+
OptBool.new('DB_ALL_PASS', [false,"Add all passwords in the current database to the list",false]),
2528
OptBool.new('STOP_ON_SUCCESS', [ true, "Stop guessing when a credential works for a host", false]),
2629
], Auxiliary::AuthBrute)
2730

@@ -184,6 +187,23 @@ def build_credentials_array
184187
if datastore['BLANK_PASSWORDS']
185188
credentials = gen_blank_passwords(users, credentials)
186189
end
190+
if framework.db.active
191+
if datastore['DB_ALL_CREDS']
192+
myworkspace.creds.each do |o|
193+
credentials << [o.user, o.pass] if o.ptype =~ /password/
194+
end
195+
end
196+
if datastore['DB_ALL_USERS']
197+
myworkspace.creds.each do |o|
198+
users << o.user
199+
end
200+
end
201+
if datastore['DB_ALL_PASS']
202+
myworkspace.creds.each do |o|
203+
passwords << o.pass if o.ptype =~ /password/
204+
end
205+
end
206+
end
187207
credentials.concat(combine_users_and_passwords(users, passwords))
188208
credentials.uniq!
189209
credentials = just_uniq_users(credentials) if @strip_passwords

0 commit comments

Comments
 (0)