Tabs replaced by spaces !
The presence of tabs can be checked with 'rubocop --only Tab --format files'
This commit is contained in:
@@ -5,7 +5,7 @@ require 'vulnerability/urls'
|
||||
|
||||
class Vulnerability
|
||||
include Vulnerability::Output
|
||||
include Vulnerability::Urls
|
||||
include Vulnerability::Urls
|
||||
|
||||
attr_accessor :title, :references, :type, :fixed_in
|
||||
|
||||
@@ -41,16 +41,16 @@ class Vulnerability
|
||||
#
|
||||
# @return [ Vulnerability ]
|
||||
def self.load_from_xml_node(xml_node)
|
||||
references = {}
|
||||
refs = xml_node.search('references')
|
||||
if refs
|
||||
references[:url] = refs.search('url').map(&:text)
|
||||
references[:cve] = refs.search('cve').map(&:text)
|
||||
references[:secunia] = refs.search('secunia').map(&:text)
|
||||
references[:osvdb] = refs.search('osvdb').map(&:text)
|
||||
references[:metasploit] = refs.search('metasploit').map(&:text)
|
||||
references[:exploitdb] = refs.search('exploitdb').map(&:text)
|
||||
end
|
||||
references = {}
|
||||
refs = xml_node.search('references')
|
||||
if refs
|
||||
references[:url] = refs.search('url').map(&:text)
|
||||
references[:cve] = refs.search('cve').map(&:text)
|
||||
references[:secunia] = refs.search('secunia').map(&:text)
|
||||
references[:osvdb] = refs.search('osvdb').map(&:text)
|
||||
references[:metasploit] = refs.search('metasploit').map(&:text)
|
||||
references[:exploitdb] = refs.search('exploitdb').map(&:text)
|
||||
end
|
||||
new(
|
||||
xml_node.search('title').text,
|
||||
xml_node.search('type').text,
|
||||
|
||||
@@ -8,12 +8,12 @@ class Vulnerability
|
||||
puts ' |'
|
||||
puts ' | ' + red("* Title: #{title}")
|
||||
references.each do |key, urls|
|
||||
methodname = "url_#{key}"
|
||||
urls.each do |u|
|
||||
url = send(methodname, u)
|
||||
puts ' | ' + red("* Reference: #{url}") if url
|
||||
end
|
||||
end
|
||||
methodname = "url_#{key}"
|
||||
urls.each do |u|
|
||||
url = send(methodname, u)
|
||||
puts ' | ' + red("* Reference: #{url}") if url
|
||||
end
|
||||
end
|
||||
if !fixed_in.empty?
|
||||
puts " | * Fixed in: #{fixed_in}"
|
||||
end
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
class Vulnerability
|
||||
module Urls
|
||||
# @return [ String ] The url to the metasploit module page
|
||||
def url_metasploit(module_path)
|
||||
# remove leading slash
|
||||
module_path = module_path.sub(/^\//, '')
|
||||
"http://www.metasploit.com/modules/#{module_path}"
|
||||
end
|
||||
module Urls
|
||||
# @return [ String ] The url to the metasploit module page
|
||||
def url_metasploit(module_path)
|
||||
# remove leading slash
|
||||
module_path = module_path.sub(/^\//, '')
|
||||
"http://www.metasploit.com/modules/#{module_path}"
|
||||
end
|
||||
|
||||
def url_url(url)
|
||||
url
|
||||
end
|
||||
def url_url(url)
|
||||
url
|
||||
end
|
||||
|
||||
def url_cve(cve)
|
||||
"http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cve}"
|
||||
end
|
||||
def url_cve(cve)
|
||||
"http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cve}"
|
||||
end
|
||||
|
||||
def url_osvdb(id)
|
||||
"http://osvdb.org/#{id}"
|
||||
end
|
||||
def url_osvdb(id)
|
||||
"http://osvdb.org/#{id}"
|
||||
end
|
||||
|
||||
def url_secunia(id)
|
||||
"http://secunia.com/advisories/#{id}"
|
||||
end
|
||||
def url_secunia(id)
|
||||
"http://secunia.com/advisories/#{id}"
|
||||
end
|
||||
|
||||
def url_exploitdb(id)
|
||||
"http://www.exploit-db.com/exploits/#{id}/"
|
||||
end
|
||||
def url_exploitdb(id)
|
||||
"http://www.exploit-db.com/exploits/#{id}/"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -13,9 +13,9 @@ class WpItem
|
||||
puts " | Readme: #{readme_url}" if has_readme?
|
||||
puts " | Changelog: #{changelog_url}" if has_changelog?
|
||||
|
||||
if respond_to?(:additional_output)
|
||||
additional_output(verbose)
|
||||
end
|
||||
if respond_to?(:additional_output)
|
||||
additional_output(verbose)
|
||||
end
|
||||
|
||||
vulnerabilities.output
|
||||
|
||||
|
||||
@@ -22,5 +22,5 @@ class VersionCompare
|
||||
raise
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -36,10 +36,10 @@ class CheckerSpelling < Plugin
|
||||
|
||||
file.close
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
puts
|
||||
puts "[+] Found #{mistakes} spelling mistakes"
|
||||
puts
|
||||
puts "[+] Found #{mistakes} spelling mistakes"
|
||||
|
||||
mistakes
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user