changed some colors

This commit is contained in:
Christian Mehlmauer
2014-09-22 23:34:42 +02:00
parent b19696090f
commit 7f9e178f75
8 changed files with 83 additions and 67 deletions

View File

@@ -109,6 +109,22 @@ def blue(text)
colorize(text, 34)
end
def critical(text)
red(text)
end
def warning(text)
amber(text)
end
def info(text)
green(text)
end
def notice(text)
blue(text)
end
# our 1337 banner
def banner
puts '_______________________________________________________________'

View File

@@ -6,7 +6,7 @@ class Vulnerability
# output the vulnerability
def output(verbose = false)
puts
puts "#{red('[!]')} Title: #{title}"
puts "#{critical('[!]')} Title: #{title}"
references.each do |key, urls|
methodname = "url_#{key}"
urls.each do |u|
@@ -15,7 +15,7 @@ class Vulnerability
end
end
if !fixed_in.nil?
puts "#{blue('[i]')} Fixed in: #{fixed_in}"
puts "#{notice('[i]')} Fixed in: #{fixed_in}"
end
end
end

View File

@@ -6,19 +6,19 @@ class WpItem
# @return [ Void ]
def output(verbose = false)
puts
puts "#{green('[+]')} Name: #{self}" #this will also output the version number if detected
puts "#{info('[+]')} Name: #{self}" #this will also output the version number if detected
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 "#{red('[!]')} Directory listing is enabled: #{url}" if has_directory_listing?
puts "#{red('[!]')} An error_log file has been found: #{error_log_url}" if has_error_log?
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?
additional_output(verbose) if respond_to?(:additional_output)
if version.nil? && vulnerabilities.length > 0
puts
puts "#{amber('[+]')} We could not determine a version so all vulnerabilities are printed out"
puts "#{warning('[+]')} We could not determine a version so all vulnerabilities are printed out"
end
vulnerabilities.output

View File

@@ -5,7 +5,7 @@ class WpTimthumb < WpItem
def output(verbose = false)
puts
puts "#{green('[+]')} #{self}" #this will also output the version number if detected
puts "#{info('[+]')} #{self}" #this will also output the version number if detected
vulnerabilities.output
end

View File

@@ -103,19 +103,19 @@ class WpUser < WpItem
# @return [ Boolean ]
def valid_password?(response, password, redirect_url, options = {})
if response.code == 302 && response.headers_hash && response.headers_hash['Location'] == redirect_url
progression = "#{green('[SUCCESS]')} Login : #{login} Password : #{password}\n\n"
progression = "#{info('[SUCCESS]')} Login : #{login} Password : #{password}\n\n"
valid = true
elsif response.body =~ /login_error/i
verbose = "\n Incorrect login and/or password."
elsif response.timed_out?
progression = "#{red('ERROR:')} Request timed out."
progression = "#{critical('ERROR:')} Request timed out."
elsif response.code == 0
progression = "#{red('ERROR:')} No response from remote server. WAF/IPS?"
progression = "#{critical('ERROR:')} No response from remote server. WAF/IPS?"
elsif response.code.to_s =~ /^50/
progression = "#{red('ERROR:')} Server error, try reducing the number of threads."
progression = "#{critical('ERROR:')} Server error, try reducing the number of threads."
else
progression = "#{red('ERROR:')} We received an unknown response for #{password}..."
verbose = red(" Code: #{response.code}\n Body: #{response.body}\n")
progression = "#{critical('ERROR:')} We received an unknown response for #{password}..."
verbose = critical(" Code: #{response.code}\n Body: #{response.body}\n")
end
puts "\n " + progression if progression && options[:show_progression]

View File

@@ -5,12 +5,12 @@ class WpVersion < WpItem
def output(verbose = false)
puts
puts "#{green('[+]')} WordPress version #{self.number} identified from #{self.found_from}"
puts "#{info('[+]')} WordPress version #{self.number} identified from #{self.found_from}"
vulnerabilities = self.vulnerabilities
unless vulnerabilities.empty?
puts "#{red('[!]')} #{vulnerabilities.size} vulnerabilities identified from the version number"
puts "#{critical('[!]')} #{vulnerabilities.size} vulnerabilities identified from the version number"
vulnerabilities.output
end