nessus 0.1.0.beta.12 → 0.1.0.beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/nessus/client/report.rb +25 -44
- data/lib/nessus/version.rb +1 -1
- metadata +2 -2
data/lib/nessus/client/report.rb
CHANGED
@@ -166,62 +166,43 @@ module Nessus
|
|
166
166
|
end
|
167
167
|
|
168
168
|
def report_plugin_summary(report_findings)
|
169
|
-
|
169
|
+
hostname_to_report_items_arr = report_findings.map do |hostname, reports|
|
170
170
|
[
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
report['findings']['portdetails']['reportitem'].map do |report_item|
|
180
|
-
{
|
181
|
-
'plugin_id' => report_item['pluginid'],
|
182
|
-
'plugin_name' => report_item['pluginname'],
|
183
|
-
'severity' => report_item['severity']
|
184
|
-
}
|
185
|
-
end
|
186
|
-
end
|
187
|
-
}.flatten,
|
188
|
-
hostname
|
171
|
+
hostname,
|
172
|
+
reports.map do |report_item|
|
173
|
+
{
|
174
|
+
'pluginid' => report_item['pluginid'],
|
175
|
+
'pluginname' => report_item['pluginname'],
|
176
|
+
'severity' => report_item['severity']
|
177
|
+
}
|
178
|
+
end
|
189
179
|
]
|
190
180
|
end
|
191
|
-
ip_findings = Hash[ip_findings_arr]
|
192
181
|
|
193
|
-
|
182
|
+
hostname_to_report_items = Hash[hostname_to_report_items_arr]
|
183
|
+
|
184
|
+
pluginid_arr = hostname_to_report_items.values.flatten.uniq.sort_by { |report_item| report_item['pluginid'] }.map do |report_item|
|
194
185
|
[
|
195
|
-
|
186
|
+
report_item['pluginid'],
|
196
187
|
{
|
197
|
-
'hosts' =>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
'
|
203
|
-
'severity' =>
|
188
|
+
'hosts' => hostname_to_report_items.map { |hostname, reports|
|
189
|
+
if reports.uniq.map { |other_report_item| other_report_item['pluginid'] }.include? report_item['pluginid']
|
190
|
+
hostname
|
191
|
+
end
|
192
|
+
}.compact.sort,
|
193
|
+
'pluginname' => report_item['pluginname'],
|
194
|
+
'severity' => report_item['severity']
|
204
195
|
}
|
205
196
|
]
|
206
197
|
end
|
207
|
-
|
208
|
-
|
198
|
+
|
199
|
+
pluginid_to_hostnames = Hash[pluginid_arr]
|
209
200
|
end
|
210
201
|
|
211
202
|
def report_item(report_findings, host, plugin_id)
|
212
|
-
report_findings[
|
213
|
-
|
214
|
-
|
215
|
-
report['findings']['portdetails']['reportitem']
|
216
|
-
end
|
217
|
-
else
|
218
|
-
report['findings']['portdetails']['reportitem'].find_all do |report_item|
|
219
|
-
if report_item['pluginid'].eql? plugin_id
|
220
|
-
report_item
|
221
|
-
end
|
222
|
-
end
|
223
|
-
end
|
224
|
-
}.flatten.compact
|
203
|
+
report_findings[hostname].find_all do |report_item|
|
204
|
+
report_item['pluginid'].eql? plugin_id
|
205
|
+
end
|
225
206
|
end
|
226
207
|
|
227
208
|
def report_parse(report)
|
data/lib/nessus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nessus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.beta.
|
4
|
+
version: 0.1.0.beta.13
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-12-
|
13
|
+
date: 2013-12-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|