nessus 0.1.0.beta.11 → 0.1.0.beta.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -224,6 +224,38 @@ module Nessus
224
224
  }.flatten.compact
225
225
  end
226
226
 
227
+ def report_parse(report)
228
+ doc = Nokogiri::XML(report)
229
+ report_data = doc.css('ReportHost').map { |report_host|
230
+ {
231
+ report_host.attributes['name'].value => report_host.css('ReportItem').map { |report_item|
232
+ report_item.map { |key, attribute|
233
+ {
234
+ key.downcase => attribute
235
+ }
236
+ }.inject(:merge).merge({
237
+ 'data' => %w[
238
+ description fname
239
+ plugin_modification_date plugin_name
240
+ plugin_publication_date plugin_type
241
+ risk_factor script_version
242
+ solution synopsis
243
+ plugin_output
244
+ ].map { |report_subitem|
245
+ report_item.css(report_subitem).map { |node|
246
+ {
247
+ node.name => node.text
248
+ }
249
+ }
250
+ }.flatten.inject(:merge)
251
+ })
252
+ }
253
+ }
254
+ }.inject(:merge).sort_by { |k, v| k }
255
+
256
+ Hash[report_data]
257
+ end
258
+
227
259
  # @!endgroup
228
260
  end
229
261
  end
@@ -1,4 +1,4 @@
1
1
  module Nessus
2
2
  # The version of the Nessus.rb library
3
- VERSION = '0.1.0.beta.11'
3
+ VERSION = '0.1.0.beta.12'
4
4
  end
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.11
4
+ version: 0.1.0.beta.12
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-23 00:00:00.000000000 Z
13
+ date: 2013-12-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler