diff --git a/lib/common/common_helper.rb b/lib/common/common_helper.rb index 658423b8..e57d0884 100644 --- a/lib/common/common_helper.rb +++ b/lib/common/common_helper.rb @@ -95,6 +95,7 @@ def last_update date end +# Was it 5 days ago? def update_required? date = last_update day_seconds = 24 * 60 * 60 diff --git a/lib/wpscan/wpscan_helper.rb b/lib/wpscan/wpscan_helper.rb index d007f948..aff83e65 100644 --- a/lib/wpscan/wpscan_helper.rb +++ b/lib/wpscan/wpscan_helper.rb @@ -49,7 +49,7 @@ def usage puts '-Use custom plugins directory ...' puts "ruby #{script_name} -u www.example.com --wp-plugins-dir wp-content/custom-plugins" puts - puts '-Update the DB ...' + puts '-Update the Database ...' puts "ruby #{script_name} --update" puts puts '-Debug output ...' diff --git a/wpscan.rb b/wpscan.rb index 87905311..463a6e6a 100755 --- a/wpscan.rb +++ b/wpscan.rb @@ -85,9 +85,10 @@ def main wpscan_options.to_h.merge(max_threads: wpscan_options.threads) ) - # check if db file needs upgrade and we are not running in batch mode - # also no need to check if the user supplied the --update switch + # Check if db file needs upgrade (older than 5 days) and we are not running in --batch mode + # Also no need to check if the user supplied the --update switch if update_required? && !wpscan_options.batch && !wpscan_options.update + puts puts notice('It seems like you have not updated the database for some time.') puts notice("Last database update: #{date.strftime('%Y-%m-%d')}") unless date.nil? print '[?] Do you want to update now? [Y]es [N]o [A]bort, default: [N] > ' @@ -98,7 +99,7 @@ def main exit(1) else if missing_db_file? - puts critical('You can not run a scan without any databases. Extract the data.zip file.') + puts critical('You can not run a scan without any databases. Manually extract the data.zip file.') exit(1) end end