Better version output #862

This commit is contained in:
ethicalhack3r
2015-09-08 17:24:10 +02:00
parent aa464b476c
commit a4a14c7e63
3 changed files with 24 additions and 2 deletions

View File

@@ -10,6 +10,11 @@ class WpItem
!readme_url.nil?
end
# @return [ Boolean ]
def outdated?(installed_version, latest_version)
installed_version < latest_version
end
# @return [ String,nil ] The url to the readme file, nil if not found
def readme_url
# See https://github.com/wpscanteam/wpscan/pull/737#issuecomment-66375445

View File

@@ -7,12 +7,13 @@ class WpItem
def output(verbose = false)
puts
puts info("Name: #{self}") #this will also output the version number if detected
puts " | Latest version: #{latest_version}" if latest_version
puts " | Latest version: #{latest_version} (up to date)" if latest_version && !outdated?(version, latest_version)
puts " | Last updated: #{last_updated}" if last_updated
puts " | Location: #{url}"
#puts " | WordPress: #{wordpress_url}" if wordpress_org_item?
puts " | Readme: #{readme_url}" if has_readme?
puts " | Changelog: #{changelog_url}" if has_changelog?
puts warning("The version is out of date, the latest version is #{latest_version}") if latest_version && outdated?(version, latest_version)
puts warning("Directory listing is enabled: #{url}") if has_directory_listing?
puts warning("An error_log file has been found: #{error_log_url}") if has_error_log?