more reference tags, fixes issue #268

This commit is contained in:
Christian Mehlmauer
2013-08-24 11:16:39 +02:00
parent 115241f16c
commit a032b7c134
17 changed files with 3731 additions and 1418 deletions

View File

@@ -7,16 +7,28 @@ class Vulnerability
def output
puts ' |'
puts ' | ' + red("* Title: #{title}")
references.each do |r|
puts ' | ' + red("* Reference: #{r}")
end
cve.each do |c|
puts ' | ' + red("* CVE-#{c} - #{Output.cve_url(c)}")
end
metasploit_modules.each do |m|
puts ' | ' + red("* Metasploit module: #{Output.metasploit_module_url(m)}")
end
end
references.each do |key, urls|
urls.each do |u|
case(key)
when :url
url = u
when :metasploit
url = Output.metasploit_module_url(u)
when :secunia
url = Output.secunia_url(u)
when :osvdb
url = Output.osvdb_url(u)
when :cve
url = Output.cve_url(u)
when :exploitdb
url = Output.exploitdb_url(u)
else
url = u
end
puts ' | ' + red("* Reference: #{url}") if url
end
end
end
# @return [ String ] The url to the metasploit module page
def self.metasploit_module_url(module_path)
@@ -27,7 +39,19 @@ class Vulnerability
def self.cve_url(cve)
"http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cve}"
end
end
def self.osvdb_url(id)
"http://osvdb.org/#{id}"
end
def self.secunia_url(id)
"http://secunia.com/advisories/#{id}"
end
def self.exploitdb_url(id)
"http://www.exploit-db.com/exploits/#{id}/"
end
end
end