Show database date when updating

This commit is contained in:
g0tmi1k
2018-05-09 13:12:27 +01:00
parent ad21d97d11
commit c2c8d63e75

View File

@@ -10,6 +10,7 @@ require File.join(__dir__, 'lib', 'wpscan', 'wpscan_helper')
def main def main
begin begin
wpscan_options = WpscanOptions.load_from_arguments wpscan_options = WpscanOptions.load_from_arguments
date = last_update
$log = wpscan_options.log $log = wpscan_options.log
@@ -74,8 +75,7 @@ def main
if wpscan_options.version if wpscan_options.version
puts "Current version: #{WPSCAN_VERSION}" puts "Current version: #{WPSCAN_VERSION}"
date = last_update puts "Last database update: #{date.strftime('%Y-%m-%d')}" unless date.nil?
puts "Last DB update: #{date.strftime('%Y-%m-%d')}" unless date.nil?
exit(0) exit(0)
end end
@@ -90,6 +90,7 @@ def main
if update_required? && !wpscan_options.batch && !wpscan_options.update if update_required? && !wpscan_options.batch && !wpscan_options.update
puts notice('It seems like you have not updated the database for some time.') puts notice('It seems like you have not updated the database for some time.')
print '[?] Do you want to update now? [Y]es [N]o [A]bort, default: [N]' print '[?] Do you want to update now? [Y]es [N]o [A]bort, default: [N]'
puts notice("Last database update: #{date.strftime('%Y-%m-%d')}") unless date.nil?
if (input = Readline.readline) =~ /^y/i if (input = Readline.readline) =~ /^y/i
wpscan_options.update = true wpscan_options.update = true
elsif input =~ /^a/i elsif input =~ /^a/i