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.
bug/bundler_fix
nstarke 2014-05-09 14:39:34 +00:00
parent ace9e797e1
commit a71be33091
1 changed files with 4 additions and 1 deletions

View File

@ -331,6 +331,8 @@ module Auxiliary::AuthBrute
creds = [ [], [], [], [] ] # userpass, pass, user, rest
remaining_pairs = combined_array.length # counter for our occasional output
interval = 60 # seconds between each remaining pair message reported to user
next_message_time = Time.now + interval # initial timing interval for user message
# Move datastore['USERNAME'] and datastore['PASSWORD'] to the front of the list.
# Note that we cannot tell the user intention if USERNAME or PASSWORD is blank --
# maybe (and it's often) they wanted a blank. One more credential won't kill
@ -345,11 +347,12 @@ module Auxiliary::AuthBrute
else
creds[3] << pair
end
if remaining_pairs % 500000 == 0
if Time.now > next_message_time
print_brute(
:level => :vstatus,
:msg => "Pair list is still building with #{remaining_pairs} pairs left to process"
)
next_message_time = Time.now + interval
end
remaining_pairs -= 1
end