Skip to content

Commit

Permalink
Land #11820, Display NOCVE reason cleanly in info command output
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartin-tech authored and msjenkins-r7 committed May 14, 2019
1 parent 5d28c26 commit aa90ce9
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/msf/base/serializer/readable_text.rb
Expand Up @@ -555,19 +555,8 @@ def self.dump_references(mod, indent = '')
if (mod.respond_to?(:references) && mod.references && mod.references.length > 0)
output << "References:\n"

cve_collection = mod.references.select { |r| r.ctx_id.match(/^cve$/i) }
if cve_collection.empty?
output << "#{indent}CVE: Not available\n"
end

mod.references.each do |ref|
case ref.ctx_id
when 'CVE', 'cve'
if !cve_collection.empty? && ref.ctx_val.blank?
output << "#{indent}CVE: Not available\n"
else
output << indent + ref.to_s + "\n"
end
when 'LOGO', 'SOUNDTRACK'
output << indent + ref.to_s + "\n"
Rex::Compat.open_browser(ref.ctx_val) if Rex::Compat.getenv('FUEL_THE_HYPE_MACHINE')
Expand Down Expand Up @@ -598,7 +587,7 @@ def self.dump_notes(mod, indent = '')
output << "Also known as:\n"
val.each { |aka| output << "#{indent}#{aka}\n" }
when 'NOCVE'
output << "CVE not available:\n" \
output << "CVE not available for the following reason:\n" \
"#{indent}#{val}\n"
when 'RelatedModules'
output << "Related modules:\n"
Expand Down

0 comments on commit aa90ce9

Please sign in to comment.