From 5b74f738efbe458e494f33351485907c16cac85b Mon Sep 17 00:00:00 2001 From: Rachael Korinek Date: Tue, 24 Dec 2019 12:43:27 -0600 Subject: [PATCH 1/3] Update tag parsing to remove formatting tags --- CHANGELOG.md | 6 +++++- lib/dradis/plugins/nexpose/gem_version.rb | 2 +- lib/nexpose/vulnerability.rb | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78667a6..2e0c45f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## Dradis Framework 3.15 (XXX, 2019) ## +## Dradis Framework 3.16 (XXXX, 2020) ## + +* Update tag parsing to remove formatting tags + +## Dradis Framework 3.15 (December, 2019) ## * Wrap ciphers in code blocks diff --git a/lib/dradis/plugins/nexpose/gem_version.rb b/lib/dradis/plugins/nexpose/gem_version.rb index a2b68d8..1fc86bc 100644 --- a/lib/dradis/plugins/nexpose/gem_version.rb +++ b/lib/dradis/plugins/nexpose/gem_version.rb @@ -9,7 +9,7 @@ def self.gem_version module VERSION MAJOR = 3 MINOR = 15 - TINY = 0 + TINY = 1 PRE = 'rc1' STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") diff --git a/lib/nexpose/vulnerability.rb b/lib/nexpose/vulnerability.rb index 4915bbf..999e895 100644 --- a/lib/nexpose/vulnerability.rb +++ b/lib/nexpose/vulnerability.rb @@ -112,12 +112,15 @@ def add_bc_to_ssl_cipher_list(source) def cleanup_html(source) result = source.to_s result.gsub!(/(.*?)<\/ContainerBlockElement>/m){|m| "#{ $1 }"} - result.gsub!(/(.*?)<\/Paragraph>/m){|m| "\nbc. #{ $1 }\n\n"} + result.gsub!(/\s*(.*?)<\/Paragraph>/im){|m| "\nbc. #{ $1 }\n\n"} result.gsub!(/(.*?)<\/Paragraph>/m){|m| "#{ $1 }\n"} result.gsub!(//, '') result.gsub!(/<\/Paragraph>/, '') result.gsub!(/(.*?)<\/UnorderedList>/m){|m| "#{ $1 }"} - result.gsub!(/(.*?)<\/ListItem>/m){|m| "#{ $1 }\n"} + result.gsub!(/|<\/UnorderedList>/){"#{ $1 }"} + result.gsub!(/(.*?)<\/OrderedList>/m){|m| "#{ $1 }"} + result.gsub!(/(.*?)<\/ListItem>/m){|m| "* #{ $1 }\n"} + result.gsub!(/|<\/ListItem>/i) {"#{ $1 }\n"} result.gsub!(/ /, '') result.gsub!(/\t\t/, '') result.gsub!(//i) { "\"#{$1.strip}\":#{$2.strip} " } From 94272a399d9ec502dbc50c9c94fcd36beaf1f2ad Mon Sep 17 00:00:00 2001 From: Brian Pearce Date: Tue, 7 Jan 2020 13:31:28 +0100 Subject: [PATCH 2/3] Revert version number No release will be built until 3.16 so we won't need to change the active version number. --- CHANGELOG.md | 2 +- lib/dradis/plugins/nexpose/gem_version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9122f..39180dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## Dradis Framework 3.16 (XXXX, 2020) ## -* Update tag parsing to remove formatting tags +* Update tag parsing to remove formatting tags ## Dradis Framework 3.15 (November, 2019) ## diff --git a/lib/dradis/plugins/nexpose/gem_version.rb b/lib/dradis/plugins/nexpose/gem_version.rb index 10f2481..d3f0352 100644 --- a/lib/dradis/plugins/nexpose/gem_version.rb +++ b/lib/dradis/plugins/nexpose/gem_version.rb @@ -9,7 +9,7 @@ def self.gem_version module VERSION MAJOR = 3 MINOR = 15 - TINY = 1 + TINY = 0 PRE = nil STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") From d848ab4c85c363a8ce1bdcd6cac458fb553a71bc Mon Sep 17 00:00:00 2001 From: Rachael Korinek Date: Tue, 7 Jan 2020 16:27:35 -0600 Subject: [PATCH 3/3] Update how we deal with lists to create proper bullets --- lib/nexpose/vulnerability.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/nexpose/vulnerability.rb b/lib/nexpose/vulnerability.rb index 999e895..6498ca3 100644 --- a/lib/nexpose/vulnerability.rb +++ b/lib/nexpose/vulnerability.rb @@ -111,18 +111,21 @@ def add_bc_to_ssl_cipher_list(source) def cleanup_html(source) result = source.to_s - result.gsub!(/(.*?)<\/ContainerBlockElement>/m){|m| "#{ $1 }"} result.gsub!(/\s*(.*?)<\/Paragraph>/im){|m| "\nbc. #{ $1 }\n\n"} - result.gsub!(/(.*?)<\/Paragraph>/m){|m| "#{ $1 }\n"} + result.gsub!(/(.*?)<\/Paragraph>/m){|m| "#{ $1 }"} result.gsub!(//, '') result.gsub!(/<\/Paragraph>/, '') - result.gsub!(/(.*?)<\/UnorderedList>/m){|m| "#{ $1 }"} - result.gsub!(/|<\/UnorderedList>/){"#{ $1 }"} - result.gsub!(/(.*?)<\/OrderedList>/m){|m| "#{ $1 }"} - result.gsub!(/(.*?)<\/ListItem>/m){|m| "* #{ $1 }\n"} - result.gsub!(/|<\/ListItem>/i) {"#{ $1 }\n"} result.gsub!(/ /, '') result.gsub!(/\t\t/, '') + + result.gsub!(/\s(.*?)<\/ContainerBlockElement>/m){|m| "#{ $1 }"} + result.gsub!(/\s(.*?)<\/UnorderedList>/m){|m| "#{ $1 }"} + result.gsub!(/\s|<\/UnorderedList>/){"#{ $1 }"} + result.gsub!(/\s(.*?)<\/OrderedList>/m){|m| "#{ $1 }"} + result.gsub!(/\s(.*?)<\/ListItem>/){"* #{ $1 }\n"} + result.gsub!(/\s\n\s(.*?)/){"* #{ $1 }\n"} + result.gsub!(/\s/i) {"* #{ $1 }\n"} + result.gsub!(/<\/ListItem>/i) {"#{ $1 }\n"} result.gsub!(//i) { "\"#{$1.strip}\":#{$2.strip} " } result.gsub!(//i) { "\"#{$2.strip}\":#{$1.strip} " } result.gsub!(/(.*?)<\/URLLink>/m) {|m| "\"#{$4.strip}\":#{$2.strip} " }