verbose output
This commit is contained in:
@@ -35,4 +35,4 @@ else
|
|||||||
puts
|
puts
|
||||||
puts "#{errors} failed! #{examples} run, #{pending} pending"
|
puts "#{errors} failed! #{examples} run, #{pending} pending"
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -177,3 +177,10 @@ end
|
|||||||
def count_file_lines(file)
|
def count_file_lines(file)
|
||||||
`wc -l #{file.shellescape}`.split[0].to_i
|
`wc -l #{file.shellescape}`.split[0].to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Truncates a string to a specific length and adds ... at the end
|
||||||
|
def truncate(input, size, trailing = '...')
|
||||||
|
padded_length = size - trailing.length - 2 # ... + space + index 0
|
||||||
|
return input if input.nil? or size <= trailing.length or size <= 0 or input.length <= size
|
||||||
|
return "#{input[0...padded_length]}#{trailing}"
|
||||||
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Vulnerability
|
|||||||
module Output
|
module Output
|
||||||
|
|
||||||
# output the vulnerability
|
# output the vulnerability
|
||||||
def output
|
def output(verbose = false)
|
||||||
puts ' |'
|
puts ' |'
|
||||||
puts ' | ' + red("* Title: #{title}")
|
puts ' | ' + red("* Title: #{title}")
|
||||||
references.each do |key, urls|
|
references.each do |key, urls|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class WpItem
|
|||||||
module Output
|
module Output
|
||||||
|
|
||||||
# @return [ Void ]
|
# @return [ Void ]
|
||||||
def output
|
def output(verbose = false)
|
||||||
puts
|
puts
|
||||||
puts " | Name: #{self}" #this will also output the version number if detected
|
puts " | Name: #{self}" #this will also output the version number if detected
|
||||||
puts " | Location: #{url}"
|
puts " | Location: #{url}"
|
||||||
@@ -14,7 +14,7 @@ class WpItem
|
|||||||
puts " | Changelog: #{changelog_url}" if has_changelog?
|
puts " | Changelog: #{changelog_url}" if has_changelog?
|
||||||
|
|
||||||
if respond_to?(:additional_output)
|
if respond_to?(:additional_output)
|
||||||
additional_output
|
additional_output(verbose)
|
||||||
end
|
end
|
||||||
|
|
||||||
vulnerabilities.output
|
vulnerabilities.output
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ class WpTheme < WpItem
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,17 +4,19 @@ class WpTheme
|
|||||||
module Output
|
module Output
|
||||||
|
|
||||||
# @return [ Void ]
|
# @return [ Void ]
|
||||||
def additional_output
|
def additional_output(verbose = false)
|
||||||
puts " | Style URL: #{style_url}"
|
puts " | Style URL: #{style_url}"
|
||||||
puts " | Theme Name: #@theme_name" if @theme_name
|
puts " | Theme Name: #@theme_name" if @theme_name
|
||||||
puts " | Theme URI: #@theme_uri" if @theme_uri
|
puts " | Theme URI: #@theme_uri" if @theme_uri
|
||||||
puts " | Description: #@theme_description" if @theme_description
|
theme_desc = verbose ? @theme_description : truncate(@theme_description, 100)
|
||||||
|
puts " | Description: #{theme_desc}"
|
||||||
puts " | Author: #@theme_author" if @theme_author
|
puts " | Author: #@theme_author" if @theme_author
|
||||||
puts " | Author URI: #@theme_author_uri" if @theme_author_uri
|
puts " | Author URI: #@theme_author_uri" if @theme_author_uri
|
||||||
puts " | Template: #@theme_template" if @theme_template
|
puts " | Template: #@theme_template" if @theme_template and verbose
|
||||||
puts " | License: #@theme_license" if @theme_license_uri
|
puts " | License: #@theme_license" if @theme_license and verbose
|
||||||
puts " | Tags: #@theme_tags" if @theme_tags
|
puts " | License URI: #@theme_license_uri" if @theme_license_uri and verbose
|
||||||
puts " | Text Domain: #@theme_text_domain" if @theme_text_domain
|
puts " | Tags: #@theme_tags" if @theme_tags and verbose
|
||||||
|
puts " | Text Domain: #@theme_text_domain" if @theme_text_domain and verbose
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
class WpTimthumb < WpItem
|
class WpTimthumb < WpItem
|
||||||
module Output
|
module Output
|
||||||
|
|
||||||
def output
|
def output(verbose = false)
|
||||||
puts ' | ' + red('[!]') + " #{self}"
|
puts ' | ' + red('[!]') + " #{self}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
class WpVersion < WpItem
|
class WpVersion < WpItem
|
||||||
module Output
|
module Output
|
||||||
|
|
||||||
def output
|
def output(verbose = false)
|
||||||
puts green('[+]') + " WordPress version #{self.number} identified from #{self.found_from}"
|
puts green('[+]') + " WordPress version #{self.number} identified from #{self.found_from}"
|
||||||
|
|
||||||
vulnerabilities = self.vulnerabilities
|
vulnerabilities = self.vulnerabilities
|
||||||
|
|||||||
14
wpscan.rb
14
wpscan.rb
@@ -186,21 +186,21 @@ def main
|
|||||||
}
|
}
|
||||||
|
|
||||||
if wp_version = wp_target.version(WP_VERSIONS_FILE)
|
if wp_version = wp_target.version(WP_VERSIONS_FILE)
|
||||||
wp_version.output
|
wp_version.output(wpscan_options.verbose)
|
||||||
end
|
end
|
||||||
|
|
||||||
if wp_theme = wp_target.theme
|
if wp_theme = wp_target.theme
|
||||||
puts
|
puts
|
||||||
# Theme version is handled in #to_s
|
# Theme version is handled in #to_s
|
||||||
puts green('[+]') + " WordPress theme in use: #{wp_theme}"
|
puts green('[+]') + " WordPress theme in use: #{wp_theme}"
|
||||||
wp_theme.output
|
wp_theme.output(wpscan_options.verbose)
|
||||||
|
|
||||||
# Check for parent Themes
|
# Check for parent Themes
|
||||||
while wp_theme.is_child_theme?
|
while wp_theme.is_child_theme?
|
||||||
parent = wp_theme.get_parent_theme
|
parent = wp_theme.get_parent_theme
|
||||||
puts
|
puts
|
||||||
puts green('[+]') + " Detected parent theme: #{parent}"
|
puts green('[+]') + " Detected parent theme: #{parent}"
|
||||||
parent.output
|
parent.output(wpscan_options.verbose)
|
||||||
wp_theme = parent
|
wp_theme = parent
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ def main
|
|||||||
if !wp_plugins.empty?
|
if !wp_plugins.empty?
|
||||||
puts " | #{wp_plugins.size} plugins found:"
|
puts " | #{wp_plugins.size} plugins found:"
|
||||||
|
|
||||||
wp_plugins.output
|
wp_plugins.output(wpscan_options.verbose)
|
||||||
else
|
else
|
||||||
puts 'No plugins found'
|
puts 'No plugins found'
|
||||||
end
|
end
|
||||||
@@ -236,7 +236,7 @@ def main
|
|||||||
if !wp_plugins.empty?
|
if !wp_plugins.empty?
|
||||||
puts green('[+]') + " We found #{wp_plugins.size} plugins:"
|
puts green('[+]') + " We found #{wp_plugins.size} plugins:"
|
||||||
|
|
||||||
wp_plugins.output
|
wp_plugins.output(wpscan_options.verbose)
|
||||||
else
|
else
|
||||||
puts 'No plugins found'
|
puts 'No plugins found'
|
||||||
end
|
end
|
||||||
@@ -258,7 +258,7 @@ def main
|
|||||||
if !wp_themes.empty?
|
if !wp_themes.empty?
|
||||||
puts green('[+]') + " We found #{wp_themes.size} themes:"
|
puts green('[+]') + " We found #{wp_themes.size} themes:"
|
||||||
|
|
||||||
wp_themes.output
|
wp_themes.output(wpscan_options.verbose)
|
||||||
else
|
else
|
||||||
puts 'No themes found'
|
puts 'No themes found'
|
||||||
end
|
end
|
||||||
@@ -280,7 +280,7 @@ def main
|
|||||||
puts green('[+]') + " We found #{wp_timthumbs.size} timthumb file/s:"
|
puts green('[+]') + " We found #{wp_timthumbs.size} timthumb file/s:"
|
||||||
puts
|
puts
|
||||||
|
|
||||||
wp_timthumbs.output
|
wp_timthumbs.output(wpscan_options.verbose)
|
||||||
|
|
||||||
puts
|
puts
|
||||||
puts red(' * Reference: http://www.exploit-db.com/exploits/17602/')
|
puts red(' * Reference: http://www.exploit-db.com/exploits/17602/')
|
||||||
|
|||||||
Reference in New Issue
Block a user