risu 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5cd1e3ce6b95cafbd6932d61bf077fe216e4a60
4
- data.tar.gz: 6897e5ee7f28b2289f2fa9830522778f3996e5c5
3
+ metadata.gz: e68cad1b3c4a774e7910aac3401b6b55ffa5ab48
4
+ data.tar.gz: 42d63e62cc61a230495a6b3c1e69c9f6165e52cd
5
5
  SHA512:
6
- metadata.gz: 71f8a12245e3cf7378773cafc6d349b8aa0728902c35b0f130c1f7be54f4555d3ef9517855b429fb521a9dab444fbd9ea66d07e24af201e9ef5e4e591dd9b4bd
7
- data.tar.gz: 217fa0b9def0e3e267dd5ef0541d261df3f0bc32c6883be5168d8bba5b9a7103a05b6d4221c37e5201d940df928aea4fee8dd4a9054671d4f292db3bb0fac66d
6
+ metadata.gz: 7651b038bae3dbe3d27c82431a1125ff41b1309fe91ace6464d4c1e2794bbac0779b998a002e8487fd6a35ed40c792863b835aad5b565f8d6ebeb5df3e46651e
7
+ data.tar.gz: be5aa294863a70be65695e165db193185519ad263d8bc517a95df13cd047b198c56673845cf734516185ebfe42c69859e2da9c71d302cdb32f5b746bf89ccec4
data/Gemfile.ci CHANGED
@@ -1,7 +1,5 @@
1
1
  source :rubygems
2
- source "http://rubygems.org"
3
- source :rubyforge
4
- source "http://gems.rubyforge.org"
2
+ source "https://rubygems.org"
5
3
 
6
4
  gem "rails"
7
5
  gem "libxml-ruby"
data/NEWS.markdown CHANGED
@@ -1,7 +1,39 @@
1
1
  # News
2
2
 
3
+ #1.6.3 (October 01, 2013)
4
+ - Rails 4.0 compatibility, backwards rails compatibility doesn't exist. You will need to update any plugins using old Rails APIs
5
+ - Support for Ruby less than 1.9.3 also doesn't exist
6
+ - Schema
7
+ - Changed size of ServerPreferences.value to text instead of string. Pull Request from [alanjones]
8
+ - Changed size of HostProperties.value to text instead of string. Pull Request from [alanjones]
9
+ - Changed size of References.value to text instead of string. Pull Request from [alanjones]
10
+ - Models
11
+ - Policy Model
12
+ - Added policy_comments
13
+ - HostProperty Model
14
+ - Added patch-summary-total-cves
15
+ - Added patch-summary-cve-num-{HASH}
16
+ - Added patch-summary-cves-{HASH}
17
+ - Added patch-summary-txt-{HASH}
18
+ - Plugin Model
19
+ - Added script_version
20
+ - Added d2_elliot_name
21
+ - Added exploit_framework_d2_elliot
22
+ - Attachment Model ***NEW***
23
+ - New Model for attachment meta-data
24
+ - Please note this is just the hash of the attachment, the real attachment is not in the .nessus file.
25
+ - Templates
26
+ - Added initial malicious process detection template based on plugin #59275,
27
+ it is rough at the moment but good for viewing all the findings. It requires
28
+ that local checks were run, for the plugin to fire during the Nessus scan.
29
+ - Wiki
30
+ - New page for installing on [Kali Linux](https://github.com/arxopia/risu/wiki/Kali-Linux-Risu-Installation-Guide)
31
+ - Post Processing (Alpha Support)
32
+ - Started to develop a method for doing post processing on all the findings
33
+ - Initial RiskScore plugin to calculate a risk score for Plugins / Findings / Hosts
34
+
3
35
  #1.6.2 (March 13, 2013)
4
- - pci_compliance template - Correct a bug that prevented it from working. Reported by [jkordish]
36
+ - pci_compliance template - Corrected a bug that prevented it from working. Reported by [jkordish]
5
37
  - Added Report.extra to contain any extra risu.config yaml settings to be passed to a report
6
38
  - Check for nil before using it!
7
39
  - It will contain all tags in the report: section of the config file
@@ -47,11 +79,11 @@
47
79
  - os_windows_2k12
48
80
  - not_is_windows_2k12
49
81
  - Changed the wording `other_os_graph_text` to indicate that its just a percentage of the non windows computers
50
- - Added 'bios_uuid' Property
82
+ - Added 'bios_uuid' Property
51
83
  - Reference Model
52
- - Added cert-cc,
84
+ - Added cert-cc,
53
85
  - Added apple-sa
54
- - Added icsa
86
+ - Added icsa
55
87
  - Added msvr
56
88
  - Plugin Model
57
89
  - cvss_base_score is now a float in the schema, this change should be transparent
data/README.markdown CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Risu is [Nessus](http://www.nessus.org) parser, that converts the generated reports into a [ActiveRecord](http://api.rubyonrails.org/classes/ActiveRecord/Base.html) database, this allows for easy report generation and vulnerability verification.
4
4
 
5
- Version **1.6.2** is the current release.
5
+ Version **1.6.3** is the current release.
6
6
 
7
7
  ## Requirements
8
8
 
@@ -55,7 +55,7 @@ Any database that ActiveRecord supports should work. Risu has been tested with [
55
55
 
56
56
 
57
57
  # Viewing Data
58
- The data can be viewed with a query browser available for your database. A Rails front end will be available in the **future**.
58
+ The data can be viewed with a query browser available for your database.
59
59
 
60
60
  ## Generating Reports
61
61
  To generate a report please execute the following after the the data is parsed into the database.
data/Rakefile CHANGED
@@ -26,7 +26,6 @@
26
26
 
27
27
  $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
28
28
 
29
- require 'rubygems'
30
29
  require "risu"
31
30
  require 'rake'
32
31
  require 'rake/testtask'
data/bin/risu CHANGED
@@ -31,7 +31,6 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '/../lib'))
31
31
  $stdout.sync = true
32
32
  $stderr.sync = true
33
33
 
34
- require 'rubygems'
35
34
  require 'risu'
36
35
 
37
36
  app = Risu::CLI::Application.new
data/lib/risu.rb CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  module Risu
28
28
  APP_NAME = "risu"
29
- VERSION = "1.6.2"
29
+ VERSION = "1.6.3"
30
30
  GRAPH_WIDTH = 750
31
31
  EMAIL = "risu@arxopia.com"
32
32
  CONFIG_FILE = "./risu.cfg"
@@ -56,6 +56,7 @@ require 'risu/cli'
56
56
  require 'risu/exceptions'
57
57
  require 'risu/models'
58
58
  require 'risu/parsers'
59
+ require 'risu/parsers/nessus/postprocess'
59
60
  require 'risu/renderers'
60
61
 
61
62
  include Risu::Models
@@ -34,7 +34,7 @@ module Risu
34
34
  def self.up
35
35
  create_table :policies do |t|
36
36
  t.string :name
37
- t.string :comments
37
+ t.text :comments
38
38
  t.string :owner
39
39
  t.string :visibility
40
40
  end
@@ -42,7 +42,7 @@ module Risu
42
42
  create_table :server_preferences do |t|
43
43
  t.integer :policy_id
44
44
  t.string :name
45
- t.string :value
45
+ t.text :value, limit: 4294967295
46
46
  end
47
47
 
48
48
  create_table :plugins_preferences do |t|
@@ -78,18 +78,20 @@ module Risu
78
78
  t.string :fqdn
79
79
  t.string :netbios
80
80
  t.text :notes
81
+ t.integer :risk_score
81
82
  end
82
83
 
83
84
  create_table :host_properties do |t|
84
85
  t.integer :host_id
85
86
  t.string :name
86
- t.string :value
87
+ t.text :value, limit: 4294967295
87
88
  end
88
89
 
89
90
  create_table :items do |t|
90
91
  t.integer :host_id
91
92
  t.integer :plugin_id
92
- t.text :plugin_output
93
+ t.integer :attachment_id
94
+ t.text :plugin_output, limit: 4294967295
93
95
  t.integer :port
94
96
  t.string :svc_name
95
97
  t.string :protocol
@@ -104,6 +106,8 @@ module Risu
104
106
  t.string :cm_compliance_check_name
105
107
  t.string :cm_compliance_result
106
108
  t.string :cm_compliance_output
109
+ t.integer :real_severity
110
+ t.integer :risk_score
107
111
  end
108
112
 
109
113
  create_table :plugins do |t|
@@ -134,6 +138,11 @@ module Risu
134
138
  t.string :stig_severity
135
139
  t.string :fname
136
140
  t.string :always_run
141
+ t.string :script_version
142
+ t.string :d2_elliot_name
143
+ t.string :exploit_framework_d2_elliot
144
+ t.boolean :rollup
145
+ t.integer :risk_score
137
146
  end
138
147
 
139
148
  create_table :individual_plugin_selections do |t|
@@ -147,7 +156,15 @@ module Risu
147
156
  create_table :references do |t|
148
157
  t.integer :plugin_id
149
158
  t.string :reference_name
150
- t.string :value
159
+ t.text :value
160
+ end
161
+
162
+ create_table :attachments do |t|
163
+ t.integer :item_id
164
+ t.string :name
165
+ t.string :type
166
+ t.string :ahash
167
+ t.text :value
151
168
  end
152
169
 
153
170
  create_table :versions do |t|
@@ -166,23 +183,23 @@ module Risu
166
183
  t.string :value
167
184
  end
168
185
 
169
- #Index's for speed increases
186
+ #Index's for speed increases, possibly have these apply after parsing @todo
170
187
  add_index :items, :host_id
171
188
  add_index :items, :plugin_id
172
189
  add_index :references, :plugin_id
173
190
 
174
191
  #Default data for service descriptions
175
192
  #@todo Unused ATM, might be better to use a yaml file tho..
176
- ServiceDescription.create :name => "www", :description => ""
177
- ServiceDescription.create :name => "cifs", :description => ""
178
- ServiceDescription.create :name => "smb", :description => ""
179
- ServiceDescription.create :name => "netbios-ns", :description => ""
180
- ServiceDescription.create :name => "snmp", :description => ""
181
- ServiceDescription.create :name => "ftp", :description => ""
182
- ServiceDescription.create :name => "epmap", :description => ""
183
- ServiceDescription.create :name => "ntp", :description => ""
184
- ServiceDescription.create :name => "dce-rpc", :description => ""
185
- ServiceDescription.create :name => "telnet", :description => ""
193
+ # ServiceDescription.create :name => "www", :description => ""
194
+ # ServiceDescription.create :name => "cifs", :description => ""
195
+ # ServiceDescription.create :name => "smb", :description => ""
196
+ # ServiceDescription.create :name => "netbios-ns", :description => ""
197
+ # ServiceDescription.create :name => "snmp", :description => ""
198
+ # ServiceDescription.create :name => "ftp", :description => ""
199
+ # ServiceDescription.create :name => "epmap", :description => ""
200
+ # ServiceDescription.create :name => "ntp", :description => ""
201
+ # ServiceDescription.create :name => "dce-rpc", :description => ""
202
+ # ServiceDescription.create :name => "telnet", :description => ""
186
203
  end
187
204
 
188
205
  # Deletes all of the database tables created
@@ -202,6 +219,7 @@ module Risu
202
219
  drop_table :service_descriptions
203
220
  drop_table :patches
204
221
  drop_table :host_properties
222
+ drop_table :attachments
205
223
  end
206
224
  end
207
225
  end
@@ -65,6 +65,8 @@ module Risu
65
65
  end
66
66
  rescue => e
67
67
  puts "[!] Invalid template path"
68
+ #puts e.inspect
69
+ #puts e.backtrace
68
70
  end
69
71
  end
70
72
 
@@ -41,6 +41,7 @@ module Risu
41
41
 
42
42
  @options[:debug] = false
43
43
  @options[:list_templates] = false
44
+ @options[:rollup] = false
44
45
 
45
46
  @template_manager = Risu::Base::TemplateManager.new "risu/templates"
46
47
  end
@@ -224,6 +225,13 @@ module Risu
224
225
  opts = OptionParser.new do |opt|
225
226
  opt.banner = "#{APP_NAME} v#{VERSION}\nJacob Hammack\nhttp://www.arxopia.com\n\n"
226
227
  opt.banner << "Usage: #{APP_NAME} [options] [files_to_parse]"
228
+ opt.separator('')
229
+ opt.separator("Parse Options")
230
+
231
+ opt.on('--post-process', 'Preform post processing on the data') do |option|
232
+ @options[:post_process] = option
233
+ end
234
+
227
235
  opt.separator('')
228
236
  opt.separator("Reporting Options")
229
237
 
@@ -411,36 +419,57 @@ module Risu
411
419
  end
412
420
  end
413
421
 
422
+ # Preforms PostProcessing on the dataset
423
+ #
424
+ def process_post_processing
425
+ if @options[:post_process] != false
426
+
427
+ puts "[*] Preforming Post Processing"
428
+
429
+ #Calculate all RiskScores
430
+ puts "\t[*] Calculating RiskScore for all vulnerabilities"
431
+ score = Risu::Parsers::Nessus::PostProcess::RiskScore.new
432
+ score.run()
433
+
434
+ #Clean up java patches
435
+ #puts "\t[*] Rolling up Oracle Java vulnerabilities"
436
+ #java = Risu::Parsers::Nessus::PostProcess::Java.new
437
+ #java.run()
438
+ end
439
+ end
440
+
414
441
  # Handles the parsing of a single file
415
442
  #
416
443
  # @param file The to parse
417
444
  def parse_file file
418
445
  begin
419
- puts "[*] Parsing #{file}..."
420
- tstart = Time.new
446
+ puts "[*] Parsing #{file}..."
447
+ tstart = Time.new
421
448
 
422
- if File.exists?(file) == false
423
- raise Risu::Exceptions::InvalidDocument, "[!] Document does not exist - #{file}"
424
- end
449
+ if File.exists?(file) == false
450
+ raise Risu::Exceptions::InvalidDocument, "[!] Document does not exist - #{file}"
451
+ end
425
452
 
426
- nessus_doc = Risu::Parsers::Nessus::NessusDocument.new file
427
- nexpose_doc = Risu::Parsers::Nexpose::NexposeDocument.new file
453
+ nessus_doc = Risu::Parsers::Nessus::NessusDocument.new file
454
+ nexpose_doc = Risu::Parsers::Nexpose::NexposeDocument.new file
428
455
 
429
- if nessus_doc.valid? == true
430
- nessus_doc.parse
456
+ if nessus_doc.valid? == true
457
+ nessus_doc.parse
431
458
 
432
- puts "[*] Fixing IP Address field"
433
- nessus_doc.fix_ips
434
- elsif nexpose_doc.valid? == true
435
- nexpose_doc.parse
459
+ puts "[*] Fixing IP Address field"
460
+ nessus_doc.fix_ips
461
+ elsif nexpose_doc.valid? == true
462
+ nexpose_doc.parse
436
463
 
437
- puts "[*] Fixing IP Address field"
438
- nexpose_doc.fix_ips
439
- else
440
- raise Risu::Exceptions::InvalidDocument, "[!] Invalid Document - #{file}"
441
- end
464
+ puts "[*] Fixing IP Address field"
465
+ nexpose_doc.fix_ips
466
+ else
467
+ raise Risu::Exceptions::InvalidDocument, "[!] Invalid Document - #{file}"
468
+ end
469
+
470
+ process_post_processing()
442
471
 
443
- printf "[*] Finished parsing %s. Parse took %.02f seconds\n", file, Time.now - tstart
472
+ printf "[*] Finished parsing %s. Parse took %.02f seconds\n", file, Time.now - tstart
444
473
  rescue Interrupt => i
445
474
  puts "[!] Parse canceled!"
446
475
  exit(1)
data/lib/risu/models.rb CHANGED
@@ -43,3 +43,4 @@ require 'risu/models/version'
43
43
  require 'risu/models/servicedescription'
44
44
  require 'risu/models/patch'
45
45
  require 'risu/models/hostproperty'
46
+ require 'risu/models/attachment'
@@ -0,0 +1,36 @@
1
+ # Copyright (c) 2010-2013 Arxopia LLC.
2
+ # All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # * Redistributions of source code must retain the above copyright
8
+ # notice, this list of conditions and the following disclaimer.
9
+ # * Redistributions in binary form must reproduce the above copyright
10
+ # notice, this list of conditions and the following disclaimer in the
11
+ # documentation and/or other materials provided with the distribution.
12
+ # * Neither the name of the Arxopia LLC nor the names of its contributors
13
+ # may be used to endorse or promote products derived from this software
14
+ # without specific prior written permission.
15
+ #
16
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
+ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ # DISCLAIMED. IN NO EVENT SHALL ARXOPIA LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
20
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
22
+ # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24
+ #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25
+ #OF THE POSSIBILITY OF SUCH DAMAGE.
26
+
27
+ module Risu
28
+ module Models
29
+
30
+ # Patch Model
31
+ #
32
+ class Attachment < ActiveRecord::Base
33
+ belongs_to :item
34
+ end
35
+ end
36
+ end
@@ -51,7 +51,7 @@ module Risu
51
51
  #
52
52
  # @return [Array] With all the Ip's in sorted order
53
53
  def sorted
54
- hosts = Host.where("ip is not NULL").order("ip").all
54
+ hosts = Host.where("ip is not NULL").order("ip").to_a
55
55
 
56
56
  #Sort the ips in natural order.
57
57
  hosts.sort! do |a,b|
@@ -69,7 +69,7 @@ module Risu
69
69
  # @return [String] of hosts \n delimited
70
70
  def ip_list
71
71
  ips = Array.new
72
- hosts = Host.where("ip is not NULL").order("ip").all
72
+ hosts = Host.where("ip is not NULL").order("ip").to_a
73
73
 
74
74
  hosts.each do |host|
75
75
  ips << host.ip if host.ip != nil
@@ -258,7 +258,7 @@ module Risu
258
258
  # @return [ActiveRecord::Relation] with the query results
259
259
  def not_os_windows_8
260
260
  where("os NOT LIKE '%Windows 8%'")
261
- end
261
+ end
262
262
 
263
263
  # Queries for hosts with a Windows Operating System that are not 2000,
264
264
  # XP, 2003, Vista, 2008 or 7
@@ -396,7 +396,7 @@ module Risu
396
396
  :background_colors => %w(white white)
397
397
  }
398
398
 
399
- Item.risks_by_host(limit).all.each do |item|
399
+ Item.risks_by_host(limit).to_a.each do |item|
400
400
  ip = Host.find_by_id(item.host_id).name
401
401
  # count = Item.where(:host_id => item.host_id).where("severity IN (?)", [2,3]).count
402
402
  count = Item.where(:host_id => item.host_id).where(:severity => 4).count
@@ -421,15 +421,15 @@ module Risu
421
421
  :background_colors => %w(white white)
422
422
  }
423
423
 
424
- linux = Host.os_linux.all.count
425
- osx = Host.os_osx.all.count
426
- freebsd = Host.os_freebsd.all.count
427
- netbsd = Host.os_netbsd.all.count
428
- cisco = Host.os_cisco.all.count
429
- vxworks = Host.os_vxworks.all.count
430
- esx = Host.os_vmware_esx.all.count
431
- aix = Host.os_aix.all.count
432
- other = Host.os_other.all.count
424
+ linux = Host.os_linux.to_a.count
425
+ osx = Host.os_osx.to_a.count
426
+ freebsd = Host.os_freebsd.to_a.count
427
+ netbsd = Host.os_netbsd.to_a.count
428
+ cisco = Host.os_cisco.to_a.count
429
+ vxworks = Host.os_vxworks.to_a.count
430
+ esx = Host.os_vmware_esx.to_a.count
431
+ aix = Host.os_aix.to_a.count
432
+ other = Host.os_other.to_a.count
433
433
 
434
434
  g.data("Linux", linux) unless linux == 0
435
435
  g.data("OSX", osx) unless osx == 0
@@ -462,16 +462,16 @@ module Risu
462
462
  :background_colors => %w(white white)
463
463
  }
464
464
 
465
- nt = Host.os_windows_nt.all.count
466
- w2k = Host.os_windows_2k.all.count
467
- xp = Host.os_windows_xp.all.count
468
- w2k3 = Host.os_windows_2k3.all.count
469
- vista = Host.os_windows_vista.all.count
470
- w2k8 = Host.os_windows_2k8.all.count
471
- w2k12 = Host.os_windows_2k12.all.count
472
- w7 = Host.os_windows_7.all.count
473
- w8 = Host.os_windows_8.all.count
474
- other = (Host.os_windows.os_windows_other).all.count
465
+ nt = Host.os_windows_nt.to_a.count
466
+ w2k = Host.os_windows_2k.to_a.count
467
+ xp = Host.os_windows_xp.to_a.count
468
+ w2k3 = Host.os_windows_2k3.to_a.count
469
+ vista = Host.os_windows_vista.to_a.count
470
+ w2k8 = Host.os_windows_2k8.to_a.count
471
+ w2k12 = Host.os_windows_2k12.to_a.count
472
+ w7 = Host.os_windows_7.to_a.count
473
+ w8 = Host.os_windows_8.to_a.count
474
+ other = (Host.os_windows.os_windows_other).to_a.count
475
475
 
476
476
  g.data("NT", nt) if nt >= 1
477
477
  g.data("2000", w2k) if w2k >= 1
@@ -481,7 +481,7 @@ module Risu
481
481
  g.data("Server 2008", w2k8) if w2k8 >= 1
482
482
  g.data("Server 2012", w2k12) if w2k12 >= 1
483
483
  g.data("7", w7) if w7 >= 1
484
- g.data("8", w8) if w8 >= 1
484
+ g.data("8", w8) if w8 >= 1
485
485
  g.data("Other Windows", other) if other >= 1
486
486
 
487
487
  StringIO.new(g.to_blob)
@@ -491,16 +491,16 @@ module Risu
491
491
  #@todo comment
492
492
  #
493
493
  def windows_os_graph_text
494
- nt = Host.os_windows_nt.all.count
495
- w2k = Host.os_windows_2k.all.count
496
- xp = Host.os_windows_xp.all.count
497
- w2k3 = Host.os_windows_2k3.all.count
498
- vista = Host.os_windows_vista.all.count
499
- w2k8 = Host.os_windows_2k8.all.count
500
- w2k12 = Host.os_windows_2k12.all.count
501
- w7 = Host.os_windows_7.all.count
502
- w8 = Host.os_windows_8.all.count
503
- other = (Host.os_windows.os_windows_other).all.count
494
+ nt = Host.os_windows_nt.to_a.count
495
+ w2k = Host.os_windows_2k.to_a.count
496
+ xp = Host.os_windows_xp.to_a.count
497
+ w2k3 = Host.os_windows_2k3.to_a.count
498
+ vista = Host.os_windows_vista.to_a.count
499
+ w2k8 = Host.os_windows_2k8.to_a.count
500
+ w2k12 = Host.os_windows_2k12.to_a.count
501
+ w7 = Host.os_windows_7.to_a.count
502
+ w8 = Host.os_windows_8.to_a.count
503
+ other = (Host.os_windows.os_windows_other).to_a.count
504
504
 
505
505
  windows_os_count = nt + w2k + xp + w2k3 + vista + w7 + w8 + w2k8 + w2k12 + other
506
506
 
@@ -533,7 +533,7 @@ module Risu
533
533
  return text
534
534
  end
535
535
 
536
- #
536
+ #
537
537
  # @todo comments
538
538
  #
539
539
  def unsupported_os?
@@ -634,15 +634,15 @@ module Risu
634
634
  text = "This graph shows the percentage of the different Non-Windows based operating systems " +
635
635
  "found on the #{Report.title} network.\n\n"
636
636
 
637
- linux = Host.os_linux.all.count
638
- osx = Host.os_osx.all.count
639
- freebsd = Host.os_freebsd.all.count
640
- netbsd = Host.os_netbsd.all.count
641
- cisco = Host.os_cisco.all.count
642
- vxworks = Host.os_vxworks.all.count
643
- esx = Host.os_vmware_esx.all.count
644
- aix = Host.os_aix.all.count
645
- other = Host.os_other.all.count
637
+ linux = Host.os_linux.to_a.count
638
+ osx = Host.os_osx.to_a.count
639
+ freebsd = Host.os_freebsd.to_a.count
640
+ netbsd = Host.os_netbsd.to_a.count
641
+ cisco = Host.os_cisco.to_a.count
642
+ vxworks = Host.os_vxworks.to_a.count
643
+ esx = Host.os_vmware_esx.to_a.count
644
+ aix = Host.os_aix.to_a.count
645
+ other = Host.os_other.to_a.count
646
646
 
647
647
  other_os_count = linux + osx + freebsd + netbsd + cisco + vxworks + esx + aix + other
648
648
 
@@ -653,10 +653,10 @@ module Risu
653
653
 
654
654
  #todo add other os's here
655
655
 
656
- text << "#{linux_percent.to_i}% of the non-windows network is running an Linux based operating system. " if linux_percent >= 1
657
- text << "#{aix_percent.to_i}% of the non-windows network is running an AIX based operating system. " if aix_percent >= 1
658
- text << "#{freebsd_percent.to_i}% of the non-windows network is running an FreeBSD based operating system. " if freebsd_percent >= 1
659
- text << "#{vmware_percent.to_i}% of the non-windows network is running an VMware based operating system. " if vmware_percent >= 1
656
+ text << "#{linux_percent.to_i}% of the non-windows network are running an Linux based operating system. " if linux_percent >= 1
657
+ text << "#{aix_percent.to_i}% of the non-windows network are running an AIX based operating system. " if aix_percent >= 1
658
+ text << "#{freebsd_percent.to_i}% of the non-windows network are running an FreeBSD based operating system. " if freebsd_percent >= 1
659
+ text << "#{vmware_percent.to_i}% of the non-windows network are running an VMware based operating system. " if vmware_percent >= 1
660
660
 
661
661
  text << "\n\n"<< unsupported_os_aix if aix > 0
662
662
  text << "\n\n" << unsupported_os_freebsd if freebsd > 0
@@ -668,7 +668,7 @@ module Risu
668
668
  # @todo comments
669
669
  #
670
670
  def top_n_vulnerable(n)
671
- hosts = Item.risks_by_host(Host.all.count).count
671
+ hosts = Item.risks_by_host(Host.count).count
672
672
  hosts = hosts.sort_by {|k, v| v}
673
673
  hosts.reverse!
674
674