risu 1.7.9 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE +1 -1
- data/README.markdown +16 -8
- data/Rakefile +12 -3
- data/bin/risu +2 -2
- data/docs/NEWS.markdown +32 -9
- data/lib/risu.rb +2 -2
- data/lib/risu/base.rb +1 -1
- data/lib/risu/base/graph_template_helper.rb +20 -26
- data/lib/risu/base/host_template_helper.rb +17 -23
- data/lib/risu/base/malware_template_helper.rb +18 -24
- data/lib/risu/base/post_process_base.rb +97 -71
- data/lib/risu/base/post_process_manager.rb +3 -3
- data/lib/risu/base/scan_helper.rb +17 -23
- data/lib/risu/base/schema.rb +2 -2
- data/lib/risu/base/shares_template_helper.rb +18 -24
- data/lib/risu/base/template_base.rb +1 -1
- data/lib/risu/base/template_helper.rb +20 -26
- data/lib/risu/base/template_manager.rb +5 -5
- data/lib/risu/base/templater.rb +3 -5
- data/lib/risu/cli.rb +1 -1
- data/lib/risu/cli/application.rb +26 -5
- data/lib/risu/cli/banner.rb +1 -1
- data/lib/risu/exceptions.rb +1 -1
- data/lib/risu/exceptions/invaliddocument.rb +1 -1
- data/lib/risu/graphs.rb +1 -1
- data/lib/risu/graphs/top_vuln_graph.rb +1 -1
- data/lib/risu/graphs/windows_os_graph.rb +1 -1
- data/lib/risu/models.rb +1 -1
- data/lib/risu/models/attachment.rb +1 -1
- data/lib/risu/models/familyselection.rb +1 -1
- data/lib/risu/models/host.rb +13 -13
- data/lib/risu/models/hostproperty.rb +1 -1
- data/lib/risu/models/individualpluginselection.rb +1 -1
- data/lib/risu/models/item.rb +7 -7
- data/lib/risu/models/patch.rb +1 -1
- data/lib/risu/models/plugin.rb +1 -1
- data/lib/risu/models/pluginspreference.rb +1 -1
- data/lib/risu/models/policy.rb +1 -1
- data/lib/risu/models/reference.rb +1 -1
- data/lib/risu/models/report.rb +2 -2
- data/lib/risu/models/serverpreference.rb +1 -1
- data/lib/risu/models/servicedescription.rb +1 -1
- data/lib/risu/models/version.rb +1 -1
- data/lib/risu/parsers.rb +1 -1
- data/lib/risu/parsers/nessus/nessus_document.rb +1 -1
- data/lib/risu/parsers/nessus/nessus_sax_listener.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/7zip.rb +46 -0
- data/lib/risu/parsers/nessus/postprocess/adobe_acrobat.rb +8 -1
- data/lib/risu/parsers/nessus/postprocess/adobe_air.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/adobe_reader.rb +5 -3
- data/lib/risu/parsers/nessus/postprocess/apache.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/apache_tomcat.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/apple_itunes.rb +2 -1
- data/lib/risu/parsers/nessus/postprocess/apple_quicktime.rb +26 -3
- data/lib/risu/parsers/nessus/postprocess/blackberry_enterprise_server.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/ca_brightstor_arcserve.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/cisco_anyconnect.rb +5 -1
- data/lib/risu/parsers/nessus/postprocess/cisco_ios.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/core_ftp.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/db2.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/downgrade_plugins.rb +3 -2
- data/lib/risu/parsers/nessus/postprocess/filezilla.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/firefox.rb +3 -1
- data/lib/risu/parsers/nessus/postprocess/flash_player.rb +29 -26
- data/lib/risu/parsers/nessus/postprocess/flexnet.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/foxit_phantom_pdf.rb +46 -0
- data/lib/risu/parsers/nessus/postprocess/foxit_reader.rb +11 -8
- data/lib/risu/parsers/nessus/postprocess/google_chrome.rb +11 -1
- data/lib/risu/parsers/nessus/postprocess/hp_system_mgt_homepage.rb +2 -1
- data/lib/risu/parsers/nessus/postprocess/irfanview.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/java.rb +3 -1
- data/lib/risu/parsers/nessus/postprocess/libreoffice.rb +3 -2
- data/lib/risu/parsers/nessus/postprocess/openoffice.rb +3 -1
- data/lib/risu/parsers/nessus/postprocess/openssh.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/openssl.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/oracle_database.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/php.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/post_process.rb +2 -2
- data/lib/risu/parsers/nessus/postprocess/real_player.rb +53 -0
- data/lib/risu/parsers/nessus/postprocess/risk_score.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/root_cause.rb +2 -3
- data/lib/risu/parsers/nessus/postprocess/servu.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/shockwave.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/sigplus_pro.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/skype.rb +46 -0
- data/lib/risu/parsers/nessus/postprocess/symantec_endpoint.rb +52 -0
- data/lib/risu/parsers/nessus/postprocess/symantec_pcanywhere.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/timbuktu.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/vlc.rb +12 -9
- data/lib/risu/parsers/nessus/postprocess/vmware_esxi.rb +9 -2
- data/lib/risu/parsers/nessus/postprocess/vmware_player.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/vmware_vcenter.rb +2 -2
- data/lib/risu/parsers/nessus/postprocess/vmware_vsphere_client.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/windows.rb +751 -705
- data/lib/risu/parsers/nessus/postprocess/winscp.rb +1 -1
- data/lib/risu/parsers/nessus/postprocess/wireshark.rb +2 -1
- data/lib/risu/parsers/nexpose/nexpose_document.rb +1 -1
- data/lib/risu/parsers/nexpose/simple_nexpose.rb +1 -1
- data/lib/risu/renderers.rb +1 -1
- data/lib/risu/renderers/csvrenderer.rb +3 -3
- data/lib/risu/renderers/nilrenderer.rb +1 -1
- data/lib/risu/renderers/pdfrenderer.rb +4 -5
- data/lib/risu/template_helpers.rb +1 -1
- data/lib/risu/templates/assets.rb +3 -3
- data/lib/risu/templates/authentication_summary.rb +34 -5
- data/lib/risu/templates/cover_sheet.rb +3 -6
- data/lib/risu/templates/exec_summary.rb +12 -4
- data/lib/risu/templates/executive_summary_detailed.rb +3 -3
- data/lib/risu/templates/exploitablity_summary.rb +3 -3
- data/lib/risu/templates/failed_audits.rb +20 -26
- data/lib/risu/templates/finding_statistics.rb +3 -3
- data/lib/risu/templates/findings_host.rb +3 -3
- data/lib/risu/templates/findings_summary.rb +5 -5
- data/lib/risu/templates/findings_summary_with_pluginid.rb +5 -5
- data/lib/risu/templates/graphs.rb +3 -3
- data/lib/risu/templates/host_findings_csv.rb +3 -3
- data/lib/risu/templates/host_summary.rb +3 -3
- data/lib/risu/templates/malicious_process_detection.rb +3 -3
- data/lib/risu/templates/missing_root_causes.rb +3 -3
- data/lib/risu/templates/ms_patch_summary.rb +3 -3
- data/lib/risu/templates/ms_update_summary.rb +3 -3
- data/lib/risu/templates/ms_wsus_findings.rb +19 -26
- data/lib/risu/templates/notable.rb +3 -3
- data/lib/risu/templates/notable_detailed.rb +3 -3
- data/lib/risu/templates/pci_compliance.rb +3 -3
- data/lib/risu/templates/stig_findings_summary.rb +3 -3
- data/lib/risu/templates/talking_points.rb +5 -31
- data/lib/risu/templates/technical_findings.rb +3 -3
- data/lib/risu/templates/template.rb +3 -3
- data/lib/risu/templates/top_25.rb +3 -3
- data/lib/risu/version.rb +6 -5
- data/risu.gemspec +9 -7
- metadata +49 -20
- metadata.gz.sig +2 -0
- data/Gemfile.lock +0 -148
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2010-
|
1
|
+
# Copyright (c) 2010-2017 Jacob Hammack.
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -30,7 +30,7 @@ module Risu
|
|
30
30
|
# @param path Path relative to the base_dir of risu
|
31
31
|
#
|
32
32
|
# @return New instance of the template manager with templates loaded.
|
33
|
-
def initialize
|
33
|
+
def initialize path
|
34
34
|
@registered_postprocesses = Array.new
|
35
35
|
@postprocesses = Array.new
|
36
36
|
|
@@ -92,7 +92,7 @@ module Risu
|
|
92
92
|
# @param template The template to validate
|
93
93
|
#
|
94
94
|
# @return [Boolean] If the template is valid
|
95
|
-
def validate
|
95
|
+
def validate template
|
96
96
|
t = template.new
|
97
97
|
|
98
98
|
return false if t == nil
|
@@ -1,28 +1,22 @@
|
|
1
|
-
# Copyright (c)
|
2
|
-
# All rights reserved.
|
1
|
+
# Copyright (c) 2010-2017 Jacob Hammack.
|
3
2
|
#
|
4
|
-
#
|
5
|
-
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
6
9
|
#
|
7
|
-
#
|
8
|
-
#
|
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.
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
15
12
|
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
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.
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
26
20
|
|
27
21
|
module Risu
|
28
22
|
module Templates
|
@@ -30,7 +24,7 @@ module Risu
|
|
30
24
|
|
31
25
|
#
|
32
26
|
# TODO doc
|
33
|
-
def scan_info_to_hash
|
27
|
+
def scan_info_to_hash plugin_output
|
34
28
|
scan_info = {}
|
35
29
|
|
36
30
|
plugin_output.split("\n").each do |line|
|
data/lib/risu/base/schema.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2010-
|
1
|
+
# Copyright (c) 2010-2017 Jacob Hammack.
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -23,7 +23,7 @@ module Risu
|
|
23
23
|
module Base
|
24
24
|
|
25
25
|
# Risu database Schema
|
26
|
-
class Schema < ActiveRecord::Migration
|
26
|
+
class Schema < ActiveRecord::Migration[4.2]
|
27
27
|
|
28
28
|
# Creates all of the database tables required by the parser
|
29
29
|
def self.up
|
@@ -1,28 +1,22 @@
|
|
1
|
-
# Copyright (c)
|
2
|
-
# All rights reserved.
|
1
|
+
# Copyright (c) 2010-2017 Jacob Hammack.
|
3
2
|
#
|
4
|
-
#
|
5
|
-
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
6
9
|
#
|
7
|
-
#
|
8
|
-
#
|
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.
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
15
12
|
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
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.
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
26
20
|
|
27
21
|
module Risu
|
28
22
|
module Templates
|
@@ -32,7 +26,7 @@ module Risu
|
|
32
26
|
def anon_ftp_count
|
33
27
|
begin
|
34
28
|
return Item.where(:plugin_id => Plugin.where(:plugin_name => "Anonymous FTP Enabled").first.id).count
|
35
|
-
rescue
|
29
|
+
rescue
|
36
30
|
return 0
|
37
31
|
end
|
38
32
|
end
|
@@ -88,7 +82,7 @@ module Risu
|
|
88
82
|
|
89
83
|
count = count + 1
|
90
84
|
end
|
91
|
-
rescue
|
85
|
+
rescue
|
92
86
|
return 0
|
93
87
|
end
|
94
88
|
|
@@ -1,28 +1,22 @@
|
|
1
|
-
# Copyright (c)
|
2
|
-
# All rights reserved.
|
1
|
+
# Copyright (c) 2010-2017 Jacob Hammack.
|
3
2
|
#
|
4
|
-
#
|
5
|
-
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
6
9
|
#
|
7
|
-
#
|
8
|
-
#
|
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.
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
15
12
|
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
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.
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
26
20
|
|
27
21
|
module Risu
|
28
22
|
module Templates
|
@@ -137,18 +131,18 @@ module Risu
|
|
137
131
|
end
|
138
132
|
|
139
133
|
#
|
140
|
-
def item_count_by_plugin_name
|
134
|
+
def item_count_by_plugin_name plugin_name
|
141
135
|
begin
|
142
136
|
return Item.where(:plugin_id => Plugin.where(:plugin_name => plugin_name).first.id).count
|
143
|
-
rescue
|
137
|
+
rescue
|
144
138
|
return 0
|
145
139
|
end
|
146
140
|
end
|
147
141
|
|
148
|
-
def item_count_by_plugin_id
|
142
|
+
def item_count_by_plugin_id plugin_id
|
149
143
|
begin
|
150
144
|
return Item.where(:plugin_id => plugin_id).count
|
151
|
-
rescue
|
145
|
+
rescue
|
152
146
|
return 0
|
153
147
|
end
|
154
148
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2010-
|
1
|
+
# Copyright (c) 2010-2017 Jacob Hammack.
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -30,7 +30,7 @@ module Risu
|
|
30
30
|
# @param path Path relative to the base_dir of risu
|
31
31
|
#
|
32
32
|
# @return New instance of the template manager with templates loaded.
|
33
|
-
def initialize
|
33
|
+
def initialize path
|
34
34
|
@registered_templates = Array.new
|
35
35
|
@templates = Array.new
|
36
36
|
|
@@ -44,7 +44,7 @@ module Risu
|
|
44
44
|
# Loads templates from a specific path
|
45
45
|
#
|
46
46
|
# @param path Path to templates to load
|
47
|
-
def load_templates
|
47
|
+
def load_templates path, recursive=true
|
48
48
|
begin
|
49
49
|
search_path = "#{path}/**/*.rb" if recursive == true
|
50
50
|
search_path = "#{path}/*.rb" if recursive == false
|
@@ -74,7 +74,7 @@ module Risu
|
|
74
74
|
# @param template The template to validate
|
75
75
|
#
|
76
76
|
# @return [Boolean] If the template is valid
|
77
|
-
def validate
|
77
|
+
def validate template
|
78
78
|
t = template.new
|
79
79
|
|
80
80
|
return false if t == nil
|
@@ -86,7 +86,7 @@ module Risu
|
|
86
86
|
# @param name Name of the template to find
|
87
87
|
#
|
88
88
|
# @return the instance of the template or nil if not found
|
89
|
-
def find_template_by_name
|
89
|
+
def find_template_by_name name
|
90
90
|
@registered_templates.each do |template|
|
91
91
|
t = template.new
|
92
92
|
if t.template_info[:name] == name
|
data/lib/risu/base/templater.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2010-
|
1
|
+
# Copyright (c) 2010-2017 Jacob Hammack.
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,7 +29,7 @@ module Risu
|
|
29
29
|
# Setups of the Templater class initializing all of the variables
|
30
30
|
#
|
31
31
|
# @return [Templater] New Instance
|
32
|
-
def initialize
|
32
|
+
def initialize template, findings, output, template_manager
|
33
33
|
@template = template
|
34
34
|
@findings = findings
|
35
35
|
@output_file = output
|
@@ -59,10 +59,8 @@ module Risu
|
|
59
59
|
t = t.class.new
|
60
60
|
t.output = output
|
61
61
|
t.render(output) unless t == nil
|
62
|
-
end
|
62
|
+
end
|
63
63
|
end
|
64
|
-
|
65
|
-
|
66
64
|
rescue => e
|
67
65
|
raise unless Rails.env.production?
|
68
66
|
puts "Templater Error: #{e.message} \n #{e.backtrace.join("\n\t")}\n"
|
data/lib/risu/cli.rb
CHANGED
data/lib/risu/cli/application.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2010-
|
1
|
+
# Copyright (c) 2010-2017 Jacob Hammack.
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -53,6 +53,9 @@ module Risu
|
|
53
53
|
f.write(" author: \n")
|
54
54
|
f.write(" title: \n")
|
55
55
|
f.write(" company: \n")
|
56
|
+
f.write(" network: \n")
|
57
|
+
f.write(" owner: \n")
|
58
|
+
f.write(" location: \n")
|
56
59
|
f.write(" classification: \n\n")
|
57
60
|
f.write("database:\n")
|
58
61
|
f.write(" adapter: \n")
|
@@ -69,7 +72,7 @@ module Risu
|
|
69
72
|
#
|
70
73
|
# @param file Path to configuration file
|
71
74
|
# @param in_memory_config [Boolean] If the configuration is in memory
|
72
|
-
def load_config
|
75
|
+
def load_config file=CONFIG_FILE, in_memory_config=false
|
73
76
|
if File.exist?(file) == true or in_memory_config == true
|
74
77
|
begin
|
75
78
|
if in_memory_config
|
@@ -102,7 +105,7 @@ module Risu
|
|
102
105
|
# Initiator for [ActiveRecord] migrations.
|
103
106
|
#
|
104
107
|
# @param direction [Symbol] :up or :down
|
105
|
-
def migrate
|
108
|
+
def migrate direction
|
106
109
|
begin
|
107
110
|
if @database["adapter"] == nil
|
108
111
|
return false, "[!] Invalid database adapter, please check your configuration file"
|
@@ -168,8 +171,20 @@ module Risu
|
|
168
171
|
puts "[!] Database adapter not found, please check your configuration file"
|
169
172
|
puts "#{anf.message}\n #{anf.backtrace}" if @options[:debug]
|
170
173
|
exit
|
174
|
+
rescue ActiveRecord::NoDatabaseError => nde
|
175
|
+
puts "[!] Database not found. Please check your configuration file"
|
176
|
+
puts "#{nde.message}\n #{nde.backtrace}" if @options[:debug]
|
177
|
+
exit
|
178
|
+
rescue Mysql2::Error => mse
|
179
|
+
puts "[!] Unable to connect to MySQL. \"#{mse.message}\" Please check your configuration file"
|
180
|
+
puts "#{mse.message}\n #{mse.backtrace}" if @options[:debug]
|
181
|
+
exit
|
182
|
+
rescue SQLite3::Exception => se
|
183
|
+
puts "[!] Unable to open database. Please check your configuration file"
|
184
|
+
puts "#{se.message}\n #{se.backtrace}" if @options[:debug]
|
185
|
+
exit
|
171
186
|
rescue => e
|
172
|
-
puts "[!] Exception! #{e.message}\n #{e.backtrace}"
|
187
|
+
puts "[!] Exception (#{e.class})! #{e.message}\n #{e.backtrace}"
|
173
188
|
end
|
174
189
|
end
|
175
190
|
|
@@ -219,7 +234,7 @@ module Risu
|
|
219
234
|
def parse_options
|
220
235
|
begin
|
221
236
|
opts = OptionParser.new do |opt|
|
222
|
-
opt.banner = "#{APP_NAME} v#{VERSION}\nJacob Hammack\nhttp://www.
|
237
|
+
opt.banner = "#{APP_NAME} v#{VERSION}\nJacob Hammack\nhttp://www.hammackj.com\n\n"
|
223
238
|
opt.banner << "Usage: #{APP_NAME} [options] [files_to_parse]"
|
224
239
|
opt.separator('')
|
225
240
|
opt.separator("Parse Options")
|
@@ -327,6 +342,9 @@ module Risu
|
|
327
342
|
puts opts.to_s + "\n"
|
328
343
|
exit
|
329
344
|
end
|
345
|
+
rescue OptionParser::AmbiguousOption => a
|
346
|
+
puts opts.to_s + "\n"
|
347
|
+
exit
|
330
348
|
rescue OptionParser::MissingArgument => m
|
331
349
|
puts opts.to_s + "\n"
|
332
350
|
exit
|
@@ -398,6 +416,9 @@ module Risu
|
|
398
416
|
@findings.title = @report["title"]
|
399
417
|
@findings.company = @report["company"]
|
400
418
|
@findings.classification = @report["classification"]
|
419
|
+
@findings.network = @report["network"]
|
420
|
+
@findings.owner = @report["owner"]
|
421
|
+
@findings.location = @report["location"]
|
401
422
|
@findings.extra = @report
|
402
423
|
|
403
424
|
template = Templater.new(@options[:template], @findings, @options[:output_file], @template_manager)
|
data/lib/risu/cli/banner.rb
CHANGED
data/lib/risu/exceptions.rb
CHANGED
data/lib/risu/graphs.rb
CHANGED
data/lib/risu/models.rb
CHANGED