Ensure that brute forcing results are output even if an error occurs or the user exits
This commit is contained in:
12
wpscan.rb
12
wpscan.rb
@@ -296,11 +296,16 @@ def main
|
|||||||
if bruteforce
|
if bruteforce
|
||||||
puts green('[+]') + ' Starting the password brute forcer'
|
puts green('[+]') + ' Starting the password brute forcer'
|
||||||
|
|
||||||
wp_users.brute_force(wpscan_options.wordlist,
|
begin
|
||||||
|
wp_users.brute_force(
|
||||||
|
wpscan_options.wordlist,
|
||||||
show_progression: true,
|
show_progression: true,
|
||||||
verbose: wpscan_options.verbose)
|
verbose: wpscan_options.verbose
|
||||||
|
)
|
||||||
|
ensure
|
||||||
puts
|
puts
|
||||||
wp_users.output(show_password: true, margin_left: ' ' * 2)
|
wp_users.output(show_password: true, margin_left: ' ' * 2)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
puts 'Brute forcing aborted'
|
puts 'Brute forcing aborted'
|
||||||
end
|
end
|
||||||
@@ -312,6 +317,9 @@ def main
|
|||||||
elapsed = stop_time - start_time
|
elapsed = stop_time - start_time
|
||||||
puts green("[+] Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}")
|
puts green("[+] Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}")
|
||||||
exit(0) # must exit!
|
exit(0) # must exit!
|
||||||
|
|
||||||
|
rescue SystemExit, Interrupt
|
||||||
|
puts 'Exiting!'
|
||||||
rescue => e
|
rescue => e
|
||||||
if e.backtrace[0] =~ /main/
|
if e.backtrace[0] =~ /main/
|
||||||
puts red(e.message)
|
puts red(e.message)
|
||||||
|
|||||||
Reference in New Issue
Block a user