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 creds = [ [], [], [], [] ] # userpass, pass, user, rest
remaining_pairs = combined_array.length # counter for our occasional output 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. # 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 -- # 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 # maybe (and it's often) they wanted a blank. One more credential won't kill
@ -345,11 +347,12 @@ module Auxiliary::AuthBrute
else else
creds[3] << pair creds[3] << pair
end end
if remaining_pairs % 500000 == 0 if Time.now > next_message_time
print_brute( print_brute(
:level => :vstatus, :level => :vstatus,
:msg => "Pair list is still building with #{remaining_pairs} pairs left to process" :msg => "Pair list is still building with #{remaining_pairs} pairs left to process"
) )
next_message_time = Time.now + interval
end end
remaining_pairs -= 1 remaining_pairs -= 1
end end