warn the user to update his DB files

This commit is contained in:
Christian Mehlmauer
2015-05-01 11:29:03 +02:00
parent 0d806e6d74
commit 202180909c
4 changed files with 37 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ LOCAL_FILES_FILE = File.join(DATA_DIR, 'local_vulnerable_files.xml')
WP_VERSIONS_XSD = File.join(DATA_DIR, 'wp_versions.xsd')
LOCAL_FILES_XSD = File.join(DATA_DIR, 'local_vulnerable_files.xsd')
USER_AGENTS_FILE = File.join(DATA_DIR, 'user-agents.txt')
LAST_UPDATE_FILE = File.join(DATA_DIR, '.last_update')
WPSCAN_VERSION = '2.7'
@@ -78,6 +79,13 @@ def missing_db_file?
false
end
def update_required?
return true unless File.exist?(LAST_UPDATE_FILE)
content = File.read(LAST_UPDATE_FILE)
date = Time.parse(content) rescue Time.parse("2000-01-01")
return date < 5.days.ago
end
# Define colors
def colorize(text, color_code)
if $COLORSWITCH