dradis-nexpose 3.8.0 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +13 -0
- data/lib/dradis/plugins/nexpose/formats/full.rb +4 -3
- data/lib/dradis/plugins/nexpose/gem_version.rb +1 -1
- data/lib/nexpose/node.rb +5 -4
- data/lib/nexpose/vulnerability.rb +51 -23
- data/templates/full_node.fields +1 -0
- data/templates/full_node.sample +1 -0
- data/templates/full_node.template +4 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82ca17fb1e1f67e0647d8d1340c37a8a93e376c7
|
4
|
+
data.tar.gz: 4380aeb556cf35d8ddefc2b5306dac66b3b63141
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 884ab9ece0604faa63ccc25e6dc2ea089908db16d42fedb52904051d0dc2d01cec9e79e4a951bd5bbd14a33f11add194cd0621cf4ce79aff3228990b8c446191
|
7
|
+
data.tar.gz: bc1e5fe3dd76bf02db753c1acdfda161e559368ee63e892a7206d3bbdd500a22687854d425fb13626de9fe3a7da25bf513be692da0e9fc72d64477be2ca52795
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## Dradis Framework 3.10 (XXX, 2018) ##
|
2
|
+
|
3
|
+
* Resolve duplicate content in nested `<Paragraph>` tags
|
4
|
+
* Import `<URLLink>` tags as textile links
|
5
|
+
* Import `<Paragraph preformat="true">` tags as code blocks
|
6
|
+
* Improve parsing of `<ListItem>` tags
|
7
|
+
* Import `vulnerability.tags` field as expected
|
8
|
+
* Create `hostname` and `os` Node properties (if present)
|
9
|
+
|
10
|
+
## Dradis Framework 3.9 (January, 2018) ##
|
11
|
+
|
12
|
+
* No changes.
|
13
|
+
|
1
14
|
## Dradis Framework 3.8 (September, 2017) ##
|
2
15
|
|
3
16
|
* No changes.
|
@@ -32,9 +32,11 @@ module Dradis::Plugins::Nexpose::Formats
|
|
32
32
|
content_service.create_note(node: host_node, text: note_text)
|
33
33
|
|
34
34
|
if host_node.respond_to?(:properties)
|
35
|
-
logger.info{ "\tAdding host properties
|
35
|
+
logger.info{ "\tAdding host properties to #{nexpose_node.address}"}
|
36
36
|
host_node.set_property(:ip, nexpose_node.address)
|
37
|
-
host_node.set_property(:
|
37
|
+
host_node.set_property(:hostname, nexpose_node.site_name)
|
38
|
+
host_node.set_property(:os, nexpose_node.software)
|
39
|
+
host_node.save
|
38
40
|
end
|
39
41
|
|
40
42
|
# inject this node's address into any vulnerabilities identified
|
@@ -114,7 +116,6 @@ module Dradis::Plugins::Nexpose::Formats
|
|
114
116
|
end
|
115
117
|
|
116
118
|
# Third, parse vulnerability definitions
|
117
|
-
definitions_node = content_service.create_node(label: 'Definitions')
|
118
119
|
logger.info{ "\tProcessing issue definitions:" }
|
119
120
|
|
120
121
|
doc.xpath('//VulnerabilityDefinitions/vulnerability').each do |xml_vulnerability|
|
data/lib/nexpose/node.rb
CHANGED
@@ -18,15 +18,15 @@ module Nexpose
|
|
18
18
|
def supported_tags
|
19
19
|
[
|
20
20
|
# attributes
|
21
|
-
:address, :
|
21
|
+
:address, :device_id, :hardware_address, :site_name, :status,
|
22
22
|
|
23
23
|
# simple tags
|
24
24
|
|
25
25
|
# multiple tags
|
26
|
-
:
|
26
|
+
:fingerprints, :names,
|
27
27
|
|
28
28
|
# compounded tags
|
29
|
-
:
|
29
|
+
:endpoints, :software, :tests
|
30
30
|
]
|
31
31
|
end
|
32
32
|
|
@@ -72,7 +72,8 @@ module Nexpose
|
|
72
72
|
# hyphenated-case is used for some attributes
|
73
73
|
translations_table = {
|
74
74
|
:device_id => 'device-id',
|
75
|
-
:hardware_address => 'hardware-address'
|
75
|
+
:hardware_address => 'hardware-address',
|
76
|
+
:site_name => 'site-name'
|
76
77
|
}
|
77
78
|
|
78
79
|
method_name = translations_table.fetch(method, method.to_s)
|
@@ -71,29 +71,17 @@ module Nexpose
|
|
71
71
|
|
72
72
|
# Then we try simple children tags: description, solution
|
73
73
|
tag = @xml.xpath("./#{method_name}/ContainerBlockElement").first
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
return
|
85
|
-
end
|
86
|
-
|
87
|
-
# Finally the enumerations: references, tags
|
88
|
-
if method_name == 'references'
|
89
|
-
references =
|
90
|
-
@xml.xpath("./references/reference").map do |entry|
|
91
|
-
{:source => entry['source'], :text => entry.text}
|
92
|
-
end
|
93
|
-
|
94
|
-
return references
|
95
|
-
elsif method == 'tags'
|
96
|
-
return @xml.xpath("./tags/tag").collect(&:text)
|
74
|
+
# Then we try the tags with nested content
|
75
|
+
nest = @xml.xpath("./#{method_name}").first
|
76
|
+
|
77
|
+
# We need to clean up tags that have HTML content in them
|
78
|
+
if tags_with_html_content.include?(method)
|
79
|
+
return cleanup_html(tag)
|
80
|
+
# And we need to clean up the tags with nested content in them
|
81
|
+
elsif tags_with_nested_content.include?(method)
|
82
|
+
return cleanup_nested(nest)
|
83
|
+
else
|
84
|
+
return tag
|
97
85
|
end
|
98
86
|
|
99
87
|
# Handle evidence creation
|
@@ -108,5 +96,45 @@ module Nexpose
|
|
108
96
|
|
109
97
|
nil
|
110
98
|
end
|
99
|
+
|
100
|
+
private
|
101
|
+
|
102
|
+
def cleanup_nested(source)
|
103
|
+
result = source.to_s
|
104
|
+
result.gsub!(/<references>/, '')
|
105
|
+
result.gsub!(/<\/references>/, '')
|
106
|
+
result.gsub!(/<reference source=\"(.*?)\">(.*?)<\/reference>/i) {"#{$1.strip}: #{$2.strip}\n"}
|
107
|
+
result.gsub!(/<tags>/, '')
|
108
|
+
result.gsub!(/<\/tags>/, '')
|
109
|
+
result.gsub!(/<tag>(.*?)<\/tag>/) {"#{$1}\n"}
|
110
|
+
result.gsub!(/ /, '')
|
111
|
+
result
|
112
|
+
end
|
113
|
+
|
114
|
+
def cleanup_html(source)
|
115
|
+
result = source.to_s
|
116
|
+
result.gsub!(/<ContainerBlockElement>(.*?)<\/ContainerBlockElement>/m){|m| "#{ $1 }"}
|
117
|
+
result.gsub!(/<Paragraph preformat=\"true\">(.*?)<\/Paragraph>/m){|m| "\nbc. #{ $1 }\n\n"}
|
118
|
+
result.gsub!(/<Paragraph>(.*?)<\/Paragraph>/m){|m| "#{ $1 }\n"}
|
119
|
+
result.gsub!(/<Paragraph>/, '')
|
120
|
+
result.gsub!(/<\/Paragraph>/, '')
|
121
|
+
result.gsub!(/<UnorderedList>(.*?)<\/UnorderedList>/m){|m| "#{ $1 }"}
|
122
|
+
result.gsub!(/<ListItem>(.*?)<\/ListItem>/m){|m| "#{ $1 }\n"}
|
123
|
+
result.gsub!(/ /, '')
|
124
|
+
result.gsub!(/<URLLink LinkTitle=\"(.*?)\" LinkURL=\"(.*?)\"\/>/i) { "\"#{$1.strip}\":#{$2.strip} " }
|
125
|
+
result.gsub!(/<URLLink LinkURL=\"(.*?)\" LinkTitle=\"(.*?)\"\/>/i) { "\"#{$2.strip}\":#{$1.strip} " }
|
126
|
+
result.gsub!(/<URLLink(.*)LinkURL=\"(.*?)\"(.*?)>(.*?)<\/URLLink>/m) {|m| "\"#{$4.strip}\":#{$2.strip} " }
|
127
|
+
|
128
|
+
result
|
129
|
+
end
|
130
|
+
|
131
|
+
def tags_with_html_content
|
132
|
+
[:description, :solution]
|
133
|
+
end
|
134
|
+
|
135
|
+
def tags_with_nested_content
|
136
|
+
[:references, :tags]
|
137
|
+
end
|
138
|
+
|
111
139
|
end
|
112
140
|
end
|
data/templates/full_node.fields
CHANGED
data/templates/full_node.sample
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dradis-nexpose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dradis-plugins
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
171
|
rubyforge_project:
|
172
|
-
rubygems_version: 2.6.
|
172
|
+
rubygems_version: 2.6.12
|
173
173
|
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: Nexpose add-on for the Dradis Framework.
|