34 lines
844 B
Ruby
34 lines
844 B
Ruby
# encoding: UTF-8
|
|
|
|
class Vulnerability
|
|
module Output
|
|
|
|
# output the 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
|
|
|
|
# @return [ String ] The url to the metasploit module page
|
|
def self.metasploit_module_url(module_path)
|
|
# remove leading slash
|
|
module_path = module_path.sub(/^\//, '')
|
|
"http://www.metasploit.com/modules/#{module_path}"
|
|
end
|
|
|
|
def self.cve_url(cve)
|
|
"http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cve}"
|
|
end
|
|
|
|
end
|
|
end
|