risu 1.6.3 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +12 -0
  3. data/Gemfile.ci +9 -9
  4. data/Gemfile.lock +118 -0
  5. data/LICENSE +1 -1
  6. data/NEWS.markdown +98 -0
  7. data/README.markdown +10 -3
  8. data/Rakefile +2 -2
  9. data/bin/risu +3 -3
  10. data/lib/risu.rb +6 -2
  11. data/lib/risu/base.rb +10 -3
  12. data/lib/risu/base/graph_template_helper.rb +71 -0
  13. data/lib/risu/base/host_template_helper.rb +75 -0
  14. data/lib/risu/base/malware_template_helper.rb +96 -0
  15. data/lib/risu/base/post_process_base.rb +210 -0
  16. data/lib/risu/base/post_process_manager.rb +120 -0
  17. data/lib/risu/base/schema.rb +10 -7
  18. data/lib/risu/base/shares_template_helper.rb +158 -0
  19. data/lib/risu/base/template_base.rb +12 -10
  20. data/lib/risu/base/template_helper.rb +105 -3
  21. data/lib/risu/base/template_manager.rb +16 -12
  22. data/lib/risu/base/templater.rb +23 -9
  23. data/lib/risu/cli.rb +1 -1
  24. data/lib/risu/cli/application.rb +23 -17
  25. data/lib/risu/cli/banner.rb +3 -3
  26. data/lib/risu/exceptions.rb +1 -1
  27. data/lib/risu/exceptions/invaliddocument.rb +1 -1
  28. data/lib/risu/models.rb +1 -1
  29. data/lib/risu/models/attachment.rb +3 -3
  30. data/lib/risu/models/familyselection.rb +3 -3
  31. data/lib/risu/models/host.rb +74 -9
  32. data/lib/risu/models/hostproperty.rb +3 -3
  33. data/lib/risu/models/individualpluginselection.rb +3 -3
  34. data/lib/risu/models/item.rb +92 -29
  35. data/lib/risu/models/patch.rb +3 -3
  36. data/lib/risu/models/plugin.rb +30 -2
  37. data/lib/risu/models/pluginspreference.rb +1 -1
  38. data/lib/risu/models/policy.rb +1 -1
  39. data/lib/risu/models/reference.rb +1 -1
  40. data/lib/risu/models/report.rb +1 -2
  41. data/lib/risu/models/serverpreference.rb +1 -1
  42. data/lib/risu/models/servicedescription.rb +3 -3
  43. data/lib/risu/models/version.rb +1 -1
  44. data/lib/risu/parsers.rb +1 -1
  45. data/lib/risu/parsers/nessus/nessus_document.rb +3 -3
  46. data/lib/risu/parsers/nessus/nessus_sax_listener.rb +23 -16
  47. data/lib/risu/parsers/nessus/postprocess.rb +3 -6
  48. data/lib/risu/parsers/nessus/postprocess/adobe_air.rb +82 -0
  49. data/lib/risu/parsers/nessus/postprocess/adobe_reader.rb +86 -0
  50. data/lib/risu/parsers/nessus/postprocess/apache.rb +67 -0
  51. data/lib/risu/parsers/nessus/postprocess/core_ftp.rb +52 -0
  52. data/lib/risu/parsers/nessus/postprocess/flash_player.rb +104 -0
  53. data/lib/risu/parsers/nessus/postprocess/flexnet.rb +53 -0
  54. data/lib/risu/parsers/nessus/postprocess/google_chrome.rb +52 -0
  55. data/lib/risu/parsers/nessus/postprocess/hp_system_mgt_homepage.rb +60 -0
  56. data/lib/risu/parsers/nessus/postprocess/java.rb +49 -198
  57. data/lib/risu/parsers/nessus/postprocess/openssh.rb +65 -0
  58. data/lib/risu/parsers/nessus/postprocess/openssl.rb +54 -0
  59. data/lib/risu/parsers/nessus/postprocess/oracle_database.rb +84 -0
  60. data/lib/risu/parsers/nessus/postprocess/php.rb +62 -0
  61. data/lib/risu/parsers/nessus/postprocess/post_process.rb +178 -0
  62. data/lib/risu/parsers/nessus/postprocess/risk_score.rb +10 -5
  63. data/lib/risu/parsers/nessus/postprocess/root_cause.rb +375 -0
  64. data/lib/risu/parsers/nessus/postprocess/servu.rb +57 -0
  65. data/lib/risu/parsers/nessus/postprocess/shockwave.rb +73 -0
  66. data/lib/risu/parsers/nessus/postprocess/windows.rb +57 -0
  67. data/lib/risu/parsers/nessus/postprocess/wireshark.rb +72 -0
  68. data/lib/risu/parsers/nexpose/nexpose_document.rb +1 -1
  69. data/lib/risu/parsers/nexpose/simple_nexpose.rb +1 -1
  70. data/lib/risu/renderers.rb +3 -1
  71. data/lib/risu/renderers/csvrenderer.rb +53 -0
  72. data/lib/risu/renderers/nilrenderer.rb +1 -1
  73. data/lib/risu/renderers/pdfrenderer.rb +57 -0
  74. data/lib/risu/templates/assets.rb +5 -4
  75. data/lib/risu/templates/cover_sheet.rb +4 -3
  76. data/lib/risu/templates/exec_summary.rb +4 -3
  77. data/lib/risu/templates/executive_summary_detailed.rb +9 -8
  78. data/lib/risu/templates/exploitablity_summary.rb +82 -0
  79. data/lib/risu/templates/failed_audits.rb +98 -0
  80. data/lib/risu/templates/finding_statistics.rb +2 -1
  81. data/lib/risu/templates/findings_host.rb +20 -22
  82. data/lib/risu/templates/findings_summary.rb +11 -9
  83. data/lib/risu/templates/findings_summary_with_pluginid.rb +31 -85
  84. data/lib/risu/templates/graphs.rb +9 -10
  85. data/lib/risu/templates/host_findings_csv.rb +67 -0
  86. data/lib/risu/templates/host_summary.rb +2 -1
  87. data/lib/risu/templates/malicious_process_detection.rb +2 -1
  88. data/lib/risu/templates/missing_root_causes.rb +162 -0
  89. data/lib/risu/templates/ms_patch_summary.rb +3 -2
  90. data/lib/risu/templates/ms_update_summary.rb +5 -4
  91. data/lib/risu/templates/ms_wsus_findings.rb +5 -4
  92. data/lib/risu/templates/notable.rb +7 -11
  93. data/lib/risu/templates/notable_detailed.rb +7 -4
  94. data/lib/risu/templates/pci_compliance.rb +5 -4
  95. data/lib/risu/templates/stig_findings_summary.rb +5 -4
  96. data/lib/risu/templates/talking_points.rb +164 -0
  97. data/lib/risu/templates/technical_findings.rb +8 -4
  98. data/lib/risu/templates/template.rb +3 -2
  99. data/lib/risu/templates/top_25.rb +115 -0
  100. data/risu.gemspec +16 -15
  101. metadata +142 -77
@@ -0,0 +1,67 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class Apache < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "Apache Patch Rollup",
38
+ :plugin_id => -99986,
39
+ :plugin_name => "Update to the latest Apache",
40
+ :item_name => "Update to the latest Apache",
41
+ :plugin_ids => [
42
+ 11030,
43
+ 11137,
44
+ 11793,
45
+ 11915,
46
+ 31654,
47
+ 55976,
48
+ 57792,
49
+ 12280,
50
+ 17696,
51
+ 31408,
52
+ 73405,
53
+ 56216,
54
+ 57791,
55
+ 62101,
56
+ 64912,
57
+ 68915,
58
+
59
+
60
+ ]
61
+ }
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,52 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class CoreFTP < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "CoreFTP Patch Rollup",
38
+ :plugin_id => -99989,
39
+ :plugin_name => "Update to the latest CoreFTP",
40
+ :item_name => "Update to the latest CoreFTP",
41
+ :plugin_ids => [
42
+ 65789,
43
+ 70656,
44
+ 59243
45
+ ]
46
+ }
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,104 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class FlashPlayer < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "Flash Player Patch Rollup",
38
+ :plugin_id => -99997,
39
+ :plugin_name => "Update to the latest Flash Player",
40
+ :item_name => "Update to the latest Flash Player",
41
+ :plugin_ids => [
42
+ 46859,
43
+ 48300,
44
+ 49307,
45
+ 50493,
46
+ 51926,
47
+ 52673,
48
+ 53472,
49
+ 54299,
50
+ 54972,
51
+ 55140,
52
+ 55803,
53
+ 56259,
54
+ 56874,
55
+ 58001,
56
+ 58207,
57
+ 58538,
58
+ 58994,
59
+ 59196,
60
+ 59426,
61
+ 61622,
62
+ 62480,
63
+ 62836,
64
+ 63242,
65
+ 63450,
66
+ 64506,
67
+ 64584,
68
+ 64916,
69
+ 65219,
70
+ 65910,
71
+ 66445,
72
+ 66872,
73
+ 67225,
74
+ 69866,
75
+ 70858,
76
+ 71351,
77
+ 71951,
78
+ 72284,
79
+ 74431,
80
+ 73994,
81
+ 73740,
82
+ 73433,
83
+ 72606,
84
+ 76413,
85
+ 34741,
86
+ 35742,
87
+ 40434,
88
+ 43068,
89
+ 25694,
90
+ 72937,
91
+ 22056,
92
+ 44596,
93
+ 23869,
94
+ 20158,
95
+ 29741,
96
+ 21079
97
+ ]
98
+ }
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,53 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class Flexnet < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "Macrovision FLEXnet Patch Rollup",
38
+ :plugin_id => -99987,
39
+ :plugin_name => "Update to the latest Macrovision FLEXnet",
40
+ :item_name => "Update to the latest Macrovision FLEXnet",
41
+ :plugin_ids => [
42
+ 25371,
43
+ 24712,
44
+ 27599,
45
+
46
+ ]
47
+ }
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,52 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class GoogleChrome < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "Google Chrome Patch Rollup",
38
+ :plugin_id => -99990,
39
+ :plugin_name => "Update to the latest Google Chrome",
40
+ :item_name => "Update to the latest Google Chrome",
41
+ :plugin_ids => [
42
+ 74434,
43
+ 76581,
44
+
45
+ ]
46
+ }
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,60 @@
1
+ # Copyright (c) 2010-2014 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 Parsers
29
+ module Nessus
30
+ module PostProcess
31
+ class HPSystemMgtHomePage < Risu::Base::PostProcessBase
32
+
33
+ #
34
+ def initialize
35
+ @info =
36
+ {
37
+ :description => "HP System Management Homepage Patch Rollup",
38
+ :plugin_id => -99985,
39
+ :plugin_name => "Update to the latest HP System Management Homepage",
40
+ :item_name => "Update to the latest HP System Management Homepage",
41
+ :plugin_ids => [
42
+ 53532,
43
+ 58811,
44
+ 59851,
45
+ 66541,
46
+ 69020,
47
+ 70118,
48
+ 76345,
49
+ 49272,
50
+ 72959,
51
+
52
+
53
+ ]
54
+ }
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2010-2013 Arxopia LLC.
1
+ # Copyright (c) 2010-2014 Arxopia LLC.
2
2
  # All rights reserved.
3
3
  #
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -21,211 +21,62 @@
21
21
  # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
22
22
  # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23
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.
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
26
 
27
27
  module Risu
28
28
  module Parsers
29
29
  module Nessus
30
30
  module PostProcess
31
- class Java
31
+ class Java < Risu::Base::PostProcessBase
32
32
 
33
33
  #
34
34
  def initialize
35
- @java_plugins = [
36
- 66932,
37
- 65995, # Needs ver
38
- 56959, # Needs ver
39
- 59462, # Needs ver
40
- 62593, # Needs ver
41
- 45544,
42
- 45379, # Oracle Java SE Multiple Vulnerabilities (March 2010 CPU)
43
- 65050, # Oracle Java JDK/JRE 6 < Update 43 Remote Code Execution (Windows)
44
- 63521,
45
- 65052,
46
- 49996,
47
- 52002,
48
- 54997,
49
- 55958, # Oracle Java JRE Unsupported Version Detection
50
- 56566,
51
- 57290,
52
- 57959,
53
- 64454,
54
- 64790
55
- ]
56
- end
57
-
58
- #NOTE:
59
- #looks like its working
60
- def newest_java_plugin
61
- newest = DateTime.new(0001, 01, 01)
62
- newest_plugin = nil
63
-
64
- @java_plugins.each do |id|
65
- plugin = Plugin.find_by_id(id)
66
-
67
- if plugin == nil || plugin.plugin_modification_date == nil
68
- next
69
- end
70
-
71
- if plugin.plugin_modification_date >= newest
72
- newest = plugin.plugin_modification_date if plugin.plugin_modification_date != nil
73
- newest_plugin = plugin
74
- end
75
- end
76
-
77
- return newest_plugin
78
- end
79
-
80
- # Creates a rollup plugin based on the newest java plugin
81
- #
82
- def create_plugin
83
-
84
- plugin = Plugin.find_by_id(-99999)
85
-
86
- newest_plugin = newest_java_plugin()
87
-
88
- if newest_plugin == nil
89
- return
90
- end
91
-
92
- if plugin == nil
93
- plugin = Plugin.new
94
- end
95
-
96
- plugin.id = -99999
97
- plugin.plugin_name = "Upgrade to the latest Oracle Java SE"
98
- plugin.family_name = "Risu Rollup Plugins"
99
- plugin.description = newest_plugin.description || ""
100
- plugin.plugin_version = newest_plugin.plugin_version || ""
101
- plugin.plugin_publication_date = newest_plugin.plugin_publication_date
102
- plugin.plugin_modification_date = newest_plugin.plugin_modification_date
103
- plugin.vuln_publication_date = newest_plugin.vuln_publication_date
104
- plugin.cvss_vector = newest_plugin.cvss_vector || ""
105
- plugin.cvss_base_score = newest_plugin.cvss_base_score
106
- plugin.cvss_temporal_score = newest_plugin.cvss_temporal_score
107
- plugin.cvss_temporal_vector = newest_plugin.cvss_temporal_vector
108
- plugin.risk_factor = newest_plugin.risk_factor
109
- plugin.solution = newest_plugin.solution
110
- plugin.synopsis = newest_plugin.synopsis
111
- plugin.plugin_type = "Rollup"
112
- plugin.rollup = true
113
-
114
- plugin.save
115
- end
116
-
117
- #
118
- def create_item(host_id, severity)
119
- item = Item.new
120
-
121
- item.host_id = host_id
122
- item.plugin_id = -99999
123
- item.plugin_output = nil
124
- item.port = 0
125
- item.severity = severity
126
- item.plugin_name = "Upgrade to the latest Oracle Java SE"
127
-
128
- item.save
129
- end
130
-
131
- #
132
- def has_java_findings
133
- @java_plugins.each do |plugin_id|
134
- if Item.where(:plugin_id => plugin_id)
135
- return true
136
- end
137
- end
138
-
139
- return false
140
- end
141
-
142
- def has_host_java_findings (host_id)
143
- @java_plugins.each do |plugin_id|
144
- if Item.where(:plugin_id => plugin_id).where(:host_id => host_id).count >= 1
145
- return true
146
- end
147
- end
148
-
149
- return false
150
- end
151
-
152
- #
153
- def calculate_severity current_severity, severity
154
- #record highest severity for all of the rolled up
155
- if severity == 4
156
- return 4
157
- elsif severity == 3 && current_severity != 4
158
- return 3
159
- elsif severity == 2 && current_severity != 4 && current_severity != 3
160
- return 2
161
- end
162
- end
163
-
164
- #
165
- def run
166
- if !has_java_findings()
167
- return
168
- end
169
-
170
- #Create the dummy plugin
171
- create_plugin()
172
-
173
- Host.all.each do |host|
174
- if !has_host_java_findings(host.id)
175
- next
176
- end
177
-
178
- finding_severity = 0
179
-
180
- @java_plugins.each do |plugin_id|
181
- Item.where(:plugin_id => plugin_id).each do |item|
182
- severity = item.severity
183
- item.real_severity = severity
184
- item.severity = -1
185
- item.save
186
-
187
- finding_severity = calculate_severity(finding_severity, severity)
188
- end
189
- end
190
-
191
- create_item(host.id, finding_severity)
192
- end
193
-
194
-
195
- # @host_list = Hash.new
196
-
197
- # #Set all plugins
198
- # @java_plugins.each do |plugin_id|
199
- # @current_severity = "None"
200
-
201
- # Item.where(:plugin_id => plugin_id).each do |item|
202
- # severity = item.severity
203
- # item.real_severity = severity
204
- # item.severity = -1
205
- # item.save
206
-
207
- # #record highest severity for all of the rolled up
208
- # if severity == 4
209
- # @current_severity = 4
210
- # elsif severity == 3 && @current_severity != 4
211
- # @current_severity = 3
212
- # elsif severity == 2 && @current_severity != 4 && @current_severity != 3
213
- # @current_severity = 2
214
- # end
215
-
216
- # @host_list[item.host_id] = @current_severity
217
-
218
- # end
219
- # end
220
-
221
- # #Create the rollup plugin
222
- # create_plugin()
223
-
224
- # #Create 1 finding for each host, flagged with the highest severity for that host
225
- # @host_list.keys.each do |host_id|
226
- # create_item(host_id, @host_list[host_id])
227
- # end
228
-
35
+ @info =
36
+ {
37
+ :description => "Java Patch Rollup",
38
+ :plugin_id => -99999,
39
+ :plugin_name => "Update to the latest Java",
40
+ :item_name => "Update to the latest Java",
41
+ :plugin_ids => [
42
+ 66932,
43
+ 65995,
44
+ 56959,
45
+ 59462,
46
+ 62593,
47
+ 45544,
48
+ 45379,
49
+ 65050,
50
+ 63521,
51
+ 65052,
52
+ 49996,
53
+ 52002,
54
+ 54997,
55
+ 55958,
56
+ 56566,
57
+ 57290,
58
+ 57959,
59
+ 64454,
60
+ 64790,
61
+ 76532,
62
+ 73570,
63
+ 70472,
64
+ 71966,
65
+ 61746,
66
+ 42373,
67
+ 36034,
68
+ 40495,
69
+ 23931,
70
+ 25370,
71
+ 24022,
72
+ 26923,
73
+ 35030,
74
+ 31356,
75
+ 65048,
76
+
77
+
78
+ ]
79
+ }
229
80
  end
230
81
  end
231
82
  end