risu 1.7.6 → 1.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -16
  3. data/README.markdown +1 -1
  4. data/Rakefile +10 -3
  5. data/{NEWS.markdown → docs/NEWS.markdown} +10 -0
  6. data/lib/risu/base.rb +1 -0
  7. data/lib/risu/base/graph_template_helper.rb +1 -1
  8. data/lib/risu/base/host_template_helper.rb +1 -1
  9. data/lib/risu/base/malware_template_helper.rb +62 -4
  10. data/lib/risu/base/post_process_manager.rb +1 -1
  11. data/lib/risu/base/scan_helper.rb +77 -0
  12. data/lib/risu/base/schema.rb +1 -3
  13. data/lib/risu/base/shares_template_helper.rb +47 -21
  14. data/lib/risu/base/template_helper.rb +3 -2
  15. data/lib/risu/base/template_manager.rb +3 -5
  16. data/lib/risu/cli/application.rb +2 -2
  17. data/lib/risu/cli/banner.rb +18 -0
  18. data/lib/risu/models/host.rb +58 -64
  19. data/lib/risu/models/item.rb +1 -0
  20. data/lib/risu/models/plugin.rb +7 -1
  21. data/lib/risu/models/report.rb +2 -2
  22. data/lib/risu/parsers/nessus/nessus_document.rb +1 -1
  23. data/lib/risu/parsers/nessus/nessus_sax_listener.rb +4 -2
  24. data/lib/risu/parsers/nessus/postprocess/adobe_acrobat.rb +4 -0
  25. data/lib/risu/parsers/nessus/postprocess/adobe_air.rb +10 -0
  26. data/lib/risu/parsers/nessus/postprocess/adobe_reader.rb +6 -1
  27. data/lib/risu/parsers/nessus/postprocess/apache_tomcat.rb +4 -0
  28. data/lib/risu/parsers/nessus/postprocess/apple_itunes.rb +58 -0
  29. data/lib/risu/parsers/nessus/postprocess/cisco_anyconnect.rb +63 -0
  30. data/lib/risu/parsers/nessus/postprocess/cisco_ios.rb +62 -0
  31. data/lib/risu/parsers/nessus/postprocess/downgrade_plugins.rb +1 -0
  32. data/lib/risu/parsers/nessus/postprocess/firefox.rb +11 -0
  33. data/lib/risu/parsers/nessus/postprocess/flash_player.rb +16 -1
  34. data/lib/risu/parsers/nessus/postprocess/google_chrome.rb +58 -0
  35. data/lib/risu/parsers/nessus/postprocess/hp_system_mgt_homepage.rb +3 -0
  36. data/lib/risu/parsers/nessus/postprocess/irfanview.rb +51 -0
  37. data/lib/risu/parsers/nessus/postprocess/java.rb +7 -0
  38. data/lib/risu/parsers/nessus/postprocess/libreoffice.rb +57 -0
  39. data/lib/risu/parsers/nessus/postprocess/openoffice.rb +56 -0
  40. data/lib/risu/parsers/nessus/postprocess/openssh.rb +10 -0
  41. data/lib/risu/parsers/nessus/postprocess/openssl.rb +2 -0
  42. data/lib/risu/parsers/nessus/postprocess/oracle_database.rb +9 -3
  43. data/lib/risu/parsers/nessus/postprocess/php.rb +8 -0
  44. data/lib/risu/parsers/nessus/postprocess/post_process.rb +2 -2
  45. data/lib/risu/parsers/nessus/postprocess/root_cause.rb +7 -1
  46. data/lib/risu/parsers/nessus/postprocess/shockwave.rb +3 -0
  47. data/lib/risu/parsers/nessus/postprocess/timbuktu.rb +53 -0
  48. data/lib/risu/parsers/nessus/postprocess/vmware_esxi.rb +15 -0
  49. data/lib/risu/parsers/nessus/postprocess/vmware_player.rb +8 -1
  50. data/lib/risu/parsers/nessus/postprocess/vmware_vcenter.rb +11 -0
  51. data/lib/risu/parsers/nessus/postprocess/vmware_vsphere_client.rb +2 -0
  52. data/lib/risu/parsers/nessus/postprocess/windows.rb +140 -3
  53. data/lib/risu/parsers/nessus/postprocess/wireshark.rb +11 -0
  54. data/lib/risu/parsers/nexpose/nexpose_document.rb +1 -1
  55. data/lib/risu/parsers/nexpose/simple_nexpose.rb +0 -3
  56. data/lib/risu/renderers/csvrenderer.rb +2 -1
  57. data/lib/risu/templates/authentication_summary.rb +95 -0
  58. data/lib/risu/templates/findings_summary.rb +7 -3
  59. data/lib/risu/templates/findings_summary_with_pluginid.rb +12 -6
  60. data/lib/risu/templates/host_findings_csv.rb +14 -5
  61. data/lib/risu/templates/malicious_process_detection.rb +1 -5
  62. data/lib/risu/templates/notable_detailed.rb +4 -9
  63. data/lib/risu/templates/technical_findings.rb +3 -3
  64. data/lib/risu/templates/top_25.rb +5 -4
  65. data/lib/risu/version.rb +2 -2
  66. data/risu.gemspec +11 -11
  67. metadata +41 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: afeb7452a6387818f031b7eb9be509fb7b8b1f91
4
- data.tar.gz: d0c0482d6673456aaa3eb7ffd32f928df5ba4d03
3
+ metadata.gz: 7bfaa5045c80e643b40cc2c4aa2dda7bd51df8ea
4
+ data.tar.gz: 702efcb8879156cd8fbdea75ff5eef32e6f41011
5
5
  SHA512:
6
- metadata.gz: c009a3228e6fb7a9b84b256610fcd61381c223520e8f9ff9a3412c577fd4690f0adceeea0dfde312d3f78519c5337ce8560af3b5100cb79eeabd0f9533cf043e
7
- data.tar.gz: abf5109f7c5ebc5f1931c1cebaa4290ae740140364ca0d9503f3901ab09f04a38b69179fdb1031663bb489ac393b3b470c76fd21567bb47ba84f9923eef6cac5
6
+ metadata.gz: 37662a0fa9723012859b123ef993dc25aa150019d61c90dfecc9692133ffad2c3e3df3a4a2a8832027608ebcaacc9f07e9d7314537b5a37fea68c4db21027c30
7
+ data.tar.gz: 0fa39c976bcf35de2405cb3f08309df5ebbb1e1117cf2d0a6700bdc15c1838a02ae3f9fcb3438105649fe5cb6c5f3faf85a01f9422dcce2587c2b9f9f26c21c4
data/Gemfile CHANGED
@@ -1,18 +1,2 @@
1
1
  source "https://rubygems.org"
2
2
  gemspec
3
-
4
- #
5
- # gem 'simplecov', '~> 0.11.0'
6
- # gem 'yard', '~> 0.8.0'
7
- # gem 'minitest', '~> 5.0'
8
- # gem 'test-unit'
9
- #
10
- # gem 'rails', "~> 4.2.5"
11
- # gem 'libxml-ruby', "~> 2.8.0"
12
- # gem 'prawn', "~> 2.0.2"
13
- # gem 'prawn-table', "~> 0.2.2"
14
- # gem 'gruff', "~> 0.6.0"
15
- # gem 'mysql2', "~> 0.4.1"
16
- # gem 'rmagick', "~> 2.15.4"
17
- # gem 'sqlite3', "~> 1.3.11"
18
- # gem 'nokogiri', "~> 1.6.7"
@@ -12,7 +12,7 @@ Risu is [Nessus](http://www.nessus.org) parser, that converts Nessus .nessus xml
12
12
  ## Requirements
13
13
 
14
14
  ### Ruby
15
- Risu has been tested with ruby-2.0.0, ruby-2.1.0 and ruby-2.2.3. Please try to use one of these versions if possible. I recommend using RVM to setup your ruby environment you can get it [here](https://rvm.beginrescueend.com/).
15
+ Risu has been tested with ruby-2.0.0, ruby-2.1.0 and ruby-2.2.3. Please use the latest version if possible. I recommend using [chruby](https://github.com/postmodern/chruby) or [RVM](https://rvm.io/) to setup your ruby environment.
16
16
 
17
17
  ### RubyGems
18
18
  Risu relies heavily on [RubyGems](http://rubygems.org/) to install other dependencies I highly recommend using it. RubyGems is included by default in the 1.9.x versions of [Ruby](http://ruby-lang.org/).
data/Rakefile CHANGED
@@ -42,9 +42,16 @@ task :tag_and_bag do
42
42
  system "git push"
43
43
  end
44
44
 
45
- task :release => [:tag_and_bag, :build] do
46
- system "gem push #{Risu::APP_NAME}-#{Risu::VERSION}.gem"
47
- puts "Just released #{Risu::APP_NAME} v#{Risu::VERSION}. #{Risu::APP_NAME} is an Nessus XML parser/database/report generator. More information at #{HOME_PAGE}"
45
+ task :push do
46
+ system "gem push #{Risu::APP_NAME}-#{Risu::VERSION}.gem"
47
+ end
48
+
49
+ task :tweet do
50
+ puts "Just released #{Risu::APP_NAME} v#{Risu::VERSION}. #{Risu::APP_NAME} is an Nessus XML parser/database/report generator. More information at #{Risu::HOME_PAGE}"
51
+ end
52
+
53
+ task :release => [:tag_and_bag, :build, :push, :tweet] do
54
+
48
55
  end
49
56
 
50
57
  task :clean do
@@ -1,5 +1,15 @@
1
1
  # News
2
2
 
3
+ # 1.7.7 (June 24, 2016)
4
+ - **NOTICE** Only ruby-2.2.1 and above are supported now. Please upgrade.
5
+ - Merge pull request #90 to add a new Banner for the console from [abenson]
6
+ - Updated Java, Windows, ESXi post-processing plugin-ids
7
+ - Templates
8
+ - Added a count of hosts on the host listings on the notable_detailed and technical_findings templates.
9
+ - Added more fields to the host_findings_csv template.
10
+ - Loads of updates to the PostProcessing Plugins
11
+ - Some changes based on code climate reports
12
+
3
13
  # 1.7.6 (December 02, 2015)
4
14
  - **NOTICE** Upon next major release, "1.8.0" ruby-2.2.1+ will only be supported. This is due to rails5 dropping support for all previous versions. Risu 1.8.0 will be release shortly after rails5 with this change.
5
15
  - **API CHANGES** Several APIs have been marked deprecated they will be moved in 1.8.0. Stubs will be left behind with warnings until 1.9.0. These changes are mostly to clean up the Models. Right now the models are very fat and interdependent on things they shouldn't. Some of the notable changes will be:
@@ -36,6 +36,7 @@ require 'risu/base/host_template_helper'
36
36
  require 'risu/base/malware_template_helper'
37
37
  require 'risu/base/graph_template_helper'
38
38
  require 'risu/base/shares_template_helper'
39
+ require 'risu/base/scan_helper'
39
40
  require 'risu/base/template_helper'
40
41
 
41
42
  require 'risu/base/post_process_base'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2012-2014 Arxopia LLC.
1
+ # Copyright (c) 2012-2016 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2012-2014 Arxopia LLC.
1
+ # Copyright (c) 2012-2016 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2012-2014 Arxopia LLC.
1
+ # Copyright (c) 2012-2016 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@ module Risu
31
31
  #
32
32
  def conficker_count
33
33
  begin
34
- return Plugin.where(:plugin_name => "Conficker Worm Detection (uncredentialed check)").count
34
+ return Item.where(:plugin_id => Plugin.where(:plugin_name => "Conficker Worm Detection (uncredentialed check)").first.id).count
35
35
  rescue => e
36
36
  return 0
37
37
  end
@@ -78,18 +78,76 @@ module Risu
78
78
 
79
79
  conficker_count = Item.where(:plugin_id => Plugin.where(:plugin_name => "Conficker Worm Detection (uncredentialed check)").first.id).count
80
80
  heading2 "Conficker Worm Infection"
81
- @output.text "Conficker Worm infections were found on #{conficker_count} of #{Report.title}'s computer systems. Conficker, also known as Downup, Downadup and Kido, is a computer worm targeting the Microsoft Windows operating system that was first detected in November 2008. It uses flaws in Windows software and dictionary attacks on administrator passwords to propagate while forming a botnet, and has been unusually difficult to counter because of its combined use of many advanced malware techniques. The systems of interest are detailed in the detailed findings report with remediation steps."
82
- @output.text "\n"
81
+
82
+ text "Conficker Worm infections were found on #{conficker_count} of #{Report.title}'s computer systems. Conficker, also known as Downup, Downadup and Kido, is a computer worm targeting the Microsoft Windows operating system that was first detected in November 2008. It uses flaws in Windows software and dictionary attacks on administrator passwords to propagate while forming a botnet, and has been unusually difficult to counter because of its combined use of many advanced malware techniques. The systems of interest are detailed in the detailed findings report with remediation steps."
83
+
84
+ text "\n"
85
+ end
86
+
87
+ #
88
+ def known_malicious_process_count
89
+ begin
90
+ return Item.where(:plugin_id => 59275).count
91
+ rescue => e
92
+ return 0
93
+ end
94
+ end
95
+
96
+ #
97
+ def known_malicious_process_section
98
+ count = known_malicious_process_count()
99
+
100
+ if count <= 0
101
+ return
102
+ end
103
+
104
+ heading1 "Known Malicious Process Detected" if count == 1
105
+ heading1 "Known Malicious Processes Detected" if count > 1
106
+
107
+ text "A known malicious process was detected active on the network. This process was detected using hash binary hashing. This hash was submitted to an malware detection service that checks each hash against several different anti virus software suites. Details can be found in Appendix A."
108
+
109
+ text "\n"
110
+ end
111
+
112
+ #
113
+ def known_malicious_process_appendix_section
114
+ count = known_malicious_process_count()
115
+
116
+ if count <= 0
117
+ return
118
+ end
119
+
120
+ heading2 "Known Malicious Process" if count == 1
121
+ heading2 "Known Malicious Processes" if count > 1
122
+
123
+ findings = Item.where(:plugin_id => 59275)
124
+ plugin = Plugin.find_by_id(59275)
125
+
126
+ findings.each do |finding|
127
+ host = Host.find_by_id(finding.host_id)
128
+
129
+ text "Host", :style => :bold
130
+ host_string = "#{host.name}"
131
+ host_string << " (#{host.fqdn})" if host.fqdn != nil
132
+ text host_string
133
+
134
+ definition "Description", plugin.description.gsub(/[ ]{2,}/, " ") if plugin.description != nil
135
+ definition "Plugin output", finding.plugin_output.gsub(/Any detected files 5 MB or less are available as attachments./, "")
136
+ end
137
+
138
+ text "\n"
83
139
  end
84
140
 
85
141
  #
86
142
  def malware_section
87
143
  conficker_section
144
+ known_malicious_process_section
88
145
  end
89
146
 
90
147
  #
91
148
  def malware_appendix_section
92
149
  conficker_appendix_section
150
+ known_malicious_process_appendix_section
93
151
  end
94
152
  end
95
153
  end
@@ -43,7 +43,7 @@ module Risu
43
43
 
44
44
  load_postprocesses(base_dir + path)
45
45
  load_postprocesses(Dir.pwd, false)
46
- load_postprocesses(File.expand_path(USER_TEMPLATES_DIR)) if File.exists?(File.expand_path(USER_TEMPLATES_DIR)) && File.directory?(File.expand_path(USER_TEMPLATES_DIR))
46
+ load_postprocesses(File.expand_path(USER_TEMPLATES_DIR)) if File.exist?(File.expand_path(USER_TEMPLATES_DIR)) && File.directory?(File.expand_path(USER_TEMPLATES_DIR))
47
47
 
48
48
  sort
49
49
  end
@@ -0,0 +1,77 @@
1
+ # Copyright (c) 2012-2016 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 Templates
29
+ module ScanHelper
30
+
31
+ #
32
+ # TODO doc
33
+ def scan_info_to_hash(plugin_output)
34
+ scan_info = {}
35
+
36
+ plugin_output.split("\n").each do |line|
37
+ a = line.split(":")
38
+
39
+ if a.size != 2
40
+ next
41
+ end
42
+
43
+ key = a[0].strip.downcase
44
+ value = a[1].strip.downcase
45
+
46
+ key = key.gsub(" ", "_")
47
+
48
+ scan_info[key] = value
49
+ end
50
+
51
+ return scan_info
52
+ end
53
+
54
+ # TODO doc
55
+ #
56
+ def authenticated_count
57
+ count = {}
58
+ count["auth"] = 0
59
+ count["unauth"] = 0
60
+
61
+ Item.where(:plugin_id => 19506).each do |item|
62
+ scan_info = scan_info_to_hash (item.plugin_output)
63
+
64
+ auth = scan_info["credentialed_checks"]
65
+
66
+ if auth =~ /yes/
67
+ count["auth"] = count["auth"] + 1
68
+ else
69
+ count["unauth"] = count["unauth"] + 1
70
+ end
71
+ end
72
+
73
+ return count
74
+ end
75
+ end
76
+ end
77
+ end
@@ -106,11 +106,9 @@ module Risu
106
106
  t.text :cm_compliance_check_name, limit: 4294967295
107
107
  t.text :cm_compliance_result, limit: 4294967295
108
108
  t.text :cm_compliance_output, limit: 4294967295
109
-
110
109
  t.text :cm_compliance_reference, limit: 4294967295
111
110
  t.text :cm_compliance_see_also, limit: 4294967295
112
111
  t.text :cm_compliance_solution, limit: 4294967295
113
-
114
112
  t.integer :real_severity
115
113
  t.integer :risk_score
116
114
  end
@@ -133,7 +131,7 @@ module Risu
133
131
  t.string :metasploit_name
134
132
  t.string :exploit_framework_canvas
135
133
  t.string :canvas_package
136
- t.string :exploit_available
134
+ t.boolean :exploit_available
137
135
  t.string :risk_factor
138
136
  t.text :solution, limit: 4294967295
139
137
  t.text :synopsis, limit: 4294967295
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2012-2014 Arxopia LLC.
1
+ # Copyright (c) 2012-2016 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -66,29 +66,54 @@ module Risu
66
66
  end
67
67
  end
68
68
 
69
+ #
70
+ def anon_smb_query
71
+ return Item.where(:plugin_id => Plugin.where(:plugin_name => "Microsoft Windows SMB Shares Unprivileged Access").first.id)
72
+ end
73
+
69
74
  #
70
75
  def anon_smb_count
76
+ count = 0
71
77
  begin
72
- return Item.where(:plugin_id => Plugin.where(:plugin_name => "Microsoft Windows SMB Shares Unprivileged Access").first.id).count
78
+ anon_smb_query().each do |finding|
79
+ host = Host.find_by_id(finding.host_id)
80
+
81
+ login = host.host_properties.where(:name => 'smb-login-used').first.value
82
+ login = login.split("\\")[1] if login.include?("\\")
83
+
84
+ if finding.plugin_output.include?("The following shares can be accessed as #{login}")
85
+ # If the output was collect via the username that is authenitcated skip it.
86
+ next
87
+ end
88
+
89
+ count = count + 1
90
+ end
73
91
  rescue => e
74
92
  return 0
75
93
  end
94
+
95
+ return count
76
96
  end
77
97
 
78
98
  #
79
99
  def anon_smb_section
80
-
81
100
  if anon_smb_count() <= 0
82
101
  return
83
102
  end
84
103
 
85
104
  heading2 "Anonymous SMB Share Detection"
86
105
 
87
- findings = Item.where(:plugin_id => Plugin.where(:plugin_name => "Microsoft Windows SMB Shares Unprivileged Access").first.id)
88
-
89
- findings.each do |finding|
106
+ anon_smb_query().each do |finding|
90
107
  host = Host.find_by_id(finding.host_id)
91
108
 
109
+ login = host.host_properties.where(:name => 'smb-login-used').first.value
110
+ login = login.split("\\")[1] if login.include?("\\")
111
+
112
+ if finding.plugin_output.include?("The following shares can be accessed as #{login}")
113
+ # If the output was collect via the username that is authenitcated skip it.
114
+ next
115
+ end
116
+
92
117
  host_string = "#{host.name}"
93
118
  host_string << " (#{host.fqdn})" if host.fqdn != nil
94
119
 
@@ -110,31 +135,31 @@ module Risu
110
135
  anon_ftp_text = ""
111
136
  anon_smb_text = ""
112
137
 
113
- anon_smb_count = 0
114
- anon_ftp_count = 0
138
+ v_anon_smb_count = 0
139
+ v_anon_ftp_count = 0
115
140
 
116
141
  begin
117
- anon_ftp_count = Item.where(:plugin_id => Plugin.where(:plugin_name => "Anonymous FTP Enabled").first.id).count
142
+ v_anon_ftp_count = anon_ftp_count()
118
143
  rescue Exception => e
119
144
  end
120
145
 
121
146
  begin
122
- anon_smb_count = Item.where(:plugin_id => Plugin.where(:plugin_name => "Microsoft Windows SMB Shares Unprivileged Access").first.id).count
147
+ v_anon_smb_count = anon_smb_count()
123
148
  rescue Exception => e
124
149
  end
125
150
 
126
- if anon_ftp_count > 1
151
+ if v_anon_ftp_count > 1
127
152
  anon_ftp_text = "Anonymous FTP was detected as being enabled on #{anon_ftp_count} network nodes. Anonymous FTP allows anyone to access files stored on the FTP server, depending on the server's configuration also write files. "
128
153
  poor_count = poor_count + 1
129
- elsif anon_ftp_count == 1
154
+ elsif v_anon_ftp_count == 1
130
155
  anon_ftp_text = "Anonymous FTP was detected as being enabled on #{anon_ftp_count} network node. Anonymous FTP allows anyone to access files stored on the FTP server, depending on the server's configuration also write files. "
131
156
  poor_count = poor_count + 1
132
157
  end
133
158
 
134
- if anon_smb_count > 1
159
+ if v_anon_smb_count > 1
135
160
  anon_smb_text = "Anonymous SMB shares were detected on #{anon_smb_count} network nodes. These shares also were found to have read and write access enabled. "
136
161
  poor_count = poor_count + 1
137
- elsif anon_smb_count == 1
162
+ elsif v_anon_smb_count == 1
138
163
  anon_smb_text = "Anonymous SMB shares were detected on #{anon_smb_count} network node. These shares also were found to have read and write access enabled. "
139
164
  poor_count = poor_count + 1
140
165
  end
@@ -144,7 +169,7 @@ module Risu
144
169
  heading1 "Other Findings of Interest" if poor_count > 0
145
170
 
146
171
  #Anon ftp/smb + clear text
147
- @output.text anon_ftp_text + anon_smb_text + anonymous_access_text if anon_ftp_count > 0 || anon_smb_count > 0
172
+ @output.text anon_ftp_text + anon_smb_text + anonymous_access_text if v_anon_ftp_count > 0 || v_anon_smb_count > 0
148
173
  @output.text "\n"
149
174
  @output.text "\n"
150
175
  end
@@ -154,30 +179,31 @@ module Risu
154
179
  anon_smb_section
155
180
  end
156
181
 
182
+ #
157
183
  def shares_section_has_findings?
158
184
  poor_count = 0
159
185
 
160
186
  anon_ftp_text = ""
161
187
  anon_smb_text = ""
162
188
 
163
- anon_smb_count = 0
164
- anon_ftp_count = 0
189
+ v_anon_smb_count = 0
190
+ v_anon_ftp_count = 0
165
191
 
166
192
  begin
167
- anon_ftp_count = Item.where(:plugin_id => Plugin.where(:plugin_name => "Anonymous FTP Enabled").first.id).count
193
+ v_anon_ftp_count = anon_ftp_count()
168
194
  rescue Exception => e
169
195
  end
170
196
 
171
197
  begin
172
- anon_smb_count = Item.where(:plugin_id => Plugin.where(:plugin_name => "Microsoft Windows SMB Shares Unprivileged Access").first.id).count
198
+ v_anon_smb_count = anon_smb_count()
173
199
  rescue Exception => e
174
200
  end
175
201
 
176
- if anon_ftp_count >= 1
202
+ if v_anon_ftp_count >= 1
177
203
  poor_count = poor_count + 1
178
204
  end
179
205
 
180
- if anon_smb_count >= 1
206
+ if v_anon_smb_count >= 1
181
207
  poor_count = poor_count + 1
182
208
  end
183
209