Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tag parsing to remove formatting tags #22

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Dradis Framework 3.16 (XXXX, 2020) ##

* Update tag parsing to remove formatting tags

## Dradis Framework 3.15 (November, 2019) ##

* Wrap ciphers in code blocks
Expand Down
7 changes: 5 additions & 2 deletions lib/nexpose/vulnerability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,15 @@ def add_bc_to_ssl_cipher_list(source)
def cleanup_html(source)
result = source.to_s
result.gsub!(/<ContainerBlockElement>(.*?)<\/ContainerBlockElement>/m){|m| "#{ $1 }"}
result.gsub!(/<Paragraph preformat=\"true\">(.*?)<\/Paragraph>/m){|m| "\nbc. #{ $1 }\n\n"}
result.gsub!(/<Paragraph preformat=\"true\">\s*(.*?)<\/Paragraph>/im){|m| "\nbc. #{ $1 }\n\n"}
rachkor marked this conversation as resolved.
Show resolved Hide resolved
result.gsub!(/<Paragraph>(.*?)<\/Paragraph>/m){|m| "#{ $1 }\n"}
result.gsub!(/<Paragraph>/, '')
result.gsub!(/<\/Paragraph>/, '')
result.gsub!(/<UnorderedList>(.*?)<\/UnorderedList>/m){|m| "#{ $1 }"}
result.gsub!(/<ListItem>(.*?)<\/ListItem>/m){|m| "#{ $1 }\n"}
result.gsub!(/<UnorderedList>|<\/UnorderedList>/){"#{ $1 }"}
result.gsub!(/<OrderedList>(.*?)<\/OrderedList>/m){|m| "#{ $1 }"}
result.gsub!(/<ListItem>(.*?)<\/ListItem>/m){|m| "* #{ $1 }\n"}
rachkor marked this conversation as resolved.
Show resolved Hide resolved
result.gsub!(/<ListItem>|<\/ListItem>/i) {"#{ $1 }\n"}
result.gsub!(/ /, '')
result.gsub!(/\t\t/, '')
result.gsub!(/<URLLink LinkTitle=\"(.*?)\" LinkURL=\"(.*?)\"\/>/i) { "\"#{$1.strip}\":#{$2.strip} " }
Expand Down