Skip to content

Commit a71be33

Browse files
committed
Adjusting status message to be based on time
Previously the status message timing was determined by the number of pairs left to process. I have adjusted the code to rely on Time.now in order to consistently print a message out every 60 seconds.
1 parent ace9e79 commit a71be33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/msf/core/auxiliary/auth_brute.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ def combine_users_and_passwords(user_array,pass_array)
331331

332332
creds = [ [], [], [], [] ] # userpass, pass, user, rest
333333
remaining_pairs = combined_array.length # counter for our occasional output
334+
interval = 60 # seconds between each remaining pair message reported to user
335+
next_message_time = Time.now + interval # initial timing interval for user message
334336
# Move datastore['USERNAME'] and datastore['PASSWORD'] to the front of the list.
335337
# Note that we cannot tell the user intention if USERNAME or PASSWORD is blank --
336338
# maybe (and it's often) they wanted a blank. One more credential won't kill
@@ -345,11 +347,12 @@ def combine_users_and_passwords(user_array,pass_array)
345347
else
346348
creds[3] << pair
347349
end
348-
if remaining_pairs % 500000 == 0
350+
if Time.now > next_message_time
349351
print_brute(
350352
:level => :vstatus,
351353
:msg => "Pair list is still building with #{remaining_pairs} pairs left to process"
352354
)
355+
next_message_time = Time.now + interval
353356
end
354357
remaining_pairs -= 1
355358
end

0 commit comments

Comments
 (0)