prenus 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/prenus +1 -1
  2. data/lib/output/htmlout.rb +36 -12
  3. metadata +2 -2
data/bin/prenus CHANGED
@@ -19,7 +19,7 @@ require 'lib/input'
19
19
  require 'lib/gemcache/ruby-nessus/ruby-nessus'
20
20
 
21
21
  #Versioning and .. those things
22
- $verstring = "Version 0.0.9 - 1st of October, 2013 - Created by Christian \"xntrik\" Frichot.\n\n"
22
+ $verstring = "Version 0.0.10 - 1st of October, 2013 - Created by Christian \"xntrik\" Frichot.\n\n"
23
23
  $verstring += "Copyright 2013 Christian Frichot\n\n"
24
24
  $verstring += "See LICENSE.txt for more details\n"
25
25
 
@@ -88,12 +88,32 @@ class Htmlout < Baseout
88
88
  end
89
89
 
90
90
  pie_data = []
91
- pie_data << ['Low',low_total.to_i] if @options[:severity] <= 1
92
- pie_data << ['Medium',med_total.to_i] if @options[:severity] <= 2
93
- pie_data << ['High',high_total.to_i] if @options[:severity] <= 3
94
- pie_data << ['Critical',crit_total.to_i] if @options[:severity] <= 4
91
+ pie_data << ['Low',low_total.to_i,'green'] if @options[:severity] <= 1
92
+ pie_data << ['Medium',med_total.to_i,'orange'] if @options[:severity] <= 2
93
+ pie_data << ['High',high_total.to_i,'red'] if @options[:severity] <= 3
94
+ pie_data << ['Critical',crit_total.to_i,'purple'] if @options[:severity] <= 4
95
95
 
96
- pie_js(f,"pie_graph","Vuln Breakdown","Vuln Breakdown",pie_data,"document.location.href = 'vuln_overview.html';")
96
+ pie_js(f,"pie_graph","Unique Vulnerability Breakdown","Unique Vuln Breakdown",pie_data,"document.location.href = 'vuln_overview.html';")
97
+
98
+ crit_total = 0
99
+ high_total = 0
100
+ med_total = 0
101
+ low_total = 0
102
+
103
+ @hosts.each do |id,values|
104
+ crit_total += values[:crit].to_i
105
+ high_total += values[:high].to_i
106
+ med_total += values[:med].to_i
107
+ low_total += values[:low].to_i
108
+ end
109
+
110
+ pie_data = []
111
+ pie_data << ['Low',low_total.to_i,'green'] if @options[:severity] <= 1
112
+ pie_data << ['Medium',med_total.to_i,'orange'] if @options[:severity] <= 2
113
+ pie_data << ['High',high_total.to_i,'red'] if @options[:severity] <= 3
114
+ pie_data << ['Critical',crit_total.to_i,'purple'] if @options[:severity] <= 4
115
+
116
+ pie_js(f,"pie_graph2","Total Vunerability Breakdown","Total Vuln Breakdown",pie_data,"document.location = href= 'vuln_overview.html';")
97
117
 
98
118
  target_lookup = "var target_lookup = {"
99
119
  @hosts.each_with_index do |host,index|
@@ -111,7 +131,11 @@ class Htmlout < Baseout
111
131
 
112
132
  close_html_header(f)
113
133
 
114
- body = '<div id="pie_graph" style="min-width: 400px; height: 400px; margin: 0 auto"></div>'
134
+ body = '<div style="width: 800px; margin-left: auto; margin-right: auto; padding-top: 30px;">'
135
+ body += '<div id="pie_graph" style="min-width: 300px; height: 300px; margin: 0 auto; float: left"></div>'
136
+ body += '<div id="pie_graph2" style="min-width: 300px; height: 300px; margin: 0 auto; float: left"></div>'
137
+ body += '</div>'
138
+ body += '<div style="clear: both;"></div>'
115
139
  body += '<div id="bar_graph" style="min-width: 400px; height: 900px; margin: 0 auto"></div>'
116
140
 
117
141
  body += '<div id="allhosts"><h3>All Hosts</h3>'
@@ -264,13 +288,13 @@ class Htmlout < Baseout
264
288
  html_header(f,values[:ip])
265
289
 
266
290
  if values[:total_excl_info] == 0
267
- pie_js(f,"pie_graph","Criticality Breakdown","Criticality Breakdown",[['Informational ONLY',values[:info].to_i]])
291
+ pie_js(f,"pie_graph","Criticality Breakdown","Criticality Breakdown",[['Informational ONLY',values[:info].to_i,'blue']])
268
292
  else
269
293
  pie_data = []
270
- pie_data << ['Low',values[:low].to_i] if @options[:severity] <= 1
271
- pie_data << ['Medium',values[:med].to_i] if @options[:severity] <= 2
272
- pie_data << ['High',values[:high].to_i] if @options[:severity] <= 3
273
- pie_data << ['Critical',values[:crit].to_i] if @options[:severity] <= 4
294
+ pie_data << ['Low',values[:low].to_i,'green'] if @options[:severity] <= 1
295
+ pie_data << ['Medium',values[:med].to_i,'orange'] if @options[:severity] <= 2
296
+ pie_data << ['High',values[:high].to_i,'red'] if @options[:severity] <= 3
297
+ pie_data << ['Critical',values[:crit].to_i,'purple'] if @options[:severity] <= 4
274
298
  pie_js(f,"pie_graph","Criticality Breakdown","Criticality Breakdown",pie_data,"document.location.href = '#' + event.point.name;")
275
299
  end
276
300
 
@@ -744,7 +768,7 @@ class Htmlout < Baseout
744
768
  data: [
745
769
  eos
746
770
  series.each_with_index do |val,index|
747
- tmpline = "\t\t\t['" + val[0] + "'," + val[1].to_s + "]"
771
+ tmpline = "\t\t\t{name: '" + val[0] + "', y: " + val[1].to_s + ", color: '" + val[2] + "'}"
748
772
  tmpline += "," unless index == series.length - 1
749
773
  fp.puts tmpline
750
774
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prenus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-01 00:00:00.000000000 Z
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rainbow