@@ -22,6 +22,9 @@ def initialize(info = {})
22
22
OptBool . new ( 'VERBOSE' , [ true , "Whether to print output for all attempts" , true ] ) ,
23
23
OptBool . new ( 'BLANK_PASSWORDS' , [ false , "Try blank passwords for all users" , true ] ) ,
24
24
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 ] ) ,
25
28
OptBool . new ( 'STOP_ON_SUCCESS' , [ true , "Stop guessing when a credential works for a host" , false ] ) ,
26
29
] , Auxiliary ::AuthBrute )
27
30
@@ -184,6 +187,23 @@ def build_credentials_array
184
187
if datastore [ 'BLANK_PASSWORDS' ]
185
188
credentials = gen_blank_passwords ( users , credentials )
186
189
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
187
207
credentials . concat ( combine_users_and_passwords ( users , passwords ) )
188
208
credentials . uniq!
189
209
credentials = just_uniq_users ( credentials ) if @strip_passwords
0 commit comments