From f9daabcee3aed4f5a962d5025e126daa3a300134 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Tue, 10 Jul 2018 17:23:07 +0000 Subject: [PATCH 1/4] Add support for SOUNDTRACK and LOGO to module refs --- lib/msf/core/module/reference.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/msf/core/module/reference.rb b/lib/msf/core/module/reference.rb index 906b111fa8..cc919e1d0c 100644 --- a/lib/msf/core/module/reference.rb +++ b/lib/msf/core/module/reference.rb @@ -115,6 +115,10 @@ class Msf::Module::SiteReference < Msf::Module::Reference self.site = "https://packetstormsecurity.com/files/#{in_ctx_val}" elsif in_ctx_id == 'URL' self.site = in_ctx_val.to_s + elsif in_ctx_id == 'SOUNDTRACK' + self.site = "Soundtrack: #{in_ctx_val}" + elsif in_ctx_id == 'LOGO' + self.site = "Logo: #{in_ctx_val}" elsif in_ctx_id == 'AKA' self.site = "Also known as: #{in_ctx_val}" else From 147f59836a230cdf30ff4a5cc949a3c8fc409306 Mon Sep 17 00:00:00 2001 From: William Vu Date: Thu, 12 Jul 2018 11:34:09 -0500 Subject: [PATCH 2/4] Fuel the hype machine --- lib/msf/base/serializer/readable_text.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/msf/base/serializer/readable_text.rb b/lib/msf/base/serializer/readable_text.rb index c8b32d31f7..f5f202ca17 100644 --- a/lib/msf/base/serializer/readable_text.rb +++ b/lib/msf/base/serializer/readable_text.rb @@ -499,9 +499,12 @@ class ReadableText if (mod.respond_to?(:references) && mod.references && mod.references.length > 0) output << "References:\n" - mod.references.each { |ref| + mod.references.each do |ref| + if ENV['FUEL_THE_HYPE_MACHINE'] && %w{LOGO SOUNDTRACK}.include?(ref.ctx_id) + Rex::Compat.open_browser(ref.ctx_val) + end output << indent + ref.to_s + "\n" - } + end output << "\n" end From bf53896aa7530d57fd32e1eba3e17c4716d0a29a Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sat, 14 Jul 2018 06:24:04 +1000 Subject: [PATCH 3/4] Rex::Compat.getenv --- lib/msf/base/serializer/readable_text.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msf/base/serializer/readable_text.rb b/lib/msf/base/serializer/readable_text.rb index 8bb6bdb05a..daef566ce2 100644 --- a/lib/msf/base/serializer/readable_text.rb +++ b/lib/msf/base/serializer/readable_text.rb @@ -501,7 +501,7 @@ class ReadableText output << "References:\n" mod.references.each do |ref| - if ENV['FUEL_THE_HYPE_MACHINE'] && %w{LOGO SOUNDTRACK}.include?(ref.ctx_id) + if Rex::Compat.getenv('FUEL_THE_HYPE_MACHINE') && %w[LOGO SOUNDTRACK].include?(ref.ctx_id) Rex::Compat.open_browser(ref.ctx_val) end output << indent + ref.to_s + "\n" From 07203dccc6e4290cd3a999cfbe5a36e31966468d Mon Sep 17 00:00:00 2001 From: William Vu Date: Tue, 17 Jul 2018 19:10:30 -0500 Subject: [PATCH 4/4] Clean up some things --- lib/msf/base/serializer/readable_text.rb | 4 ++-- lib/msf/core/module/reference.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/msf/base/serializer/readable_text.rb b/lib/msf/base/serializer/readable_text.rb index daef566ce2..cb6e2299c6 100644 --- a/lib/msf/base/serializer/readable_text.rb +++ b/lib/msf/base/serializer/readable_text.rb @@ -512,7 +512,7 @@ class ReadableText output << "#{indent}CVE: Not available\n" end - mod.references.each { |ref| + mod.references.each do |ref| case ref.ctx_id when 'CVE', 'cve' if !cve_collection.empty? && ref.ctx_val.blank? @@ -523,7 +523,7 @@ class ReadableText else output << indent + ref.to_s + "\n" end - } + end output << "\n" end diff --git a/lib/msf/core/module/reference.rb b/lib/msf/core/module/reference.rb index cc919e1d0c..a7351c164b 100644 --- a/lib/msf/core/module/reference.rb +++ b/lib/msf/core/module/reference.rb @@ -115,10 +115,10 @@ class Msf::Module::SiteReference < Msf::Module::Reference self.site = "https://packetstormsecurity.com/files/#{in_ctx_val}" elsif in_ctx_id == 'URL' self.site = in_ctx_val.to_s - elsif in_ctx_id == 'SOUNDTRACK' - self.site = "Soundtrack: #{in_ctx_val}" elsif in_ctx_id == 'LOGO' self.site = "Logo: #{in_ctx_val}" + elsif in_ctx_id == 'SOUNDTRACK' + self.site = "Soundtrack: #{in_ctx_val}" elsif in_ctx_id == 'AKA' self.site = "Also known as: #{in_ctx_val}" else