prenus 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE.txt +20 -0
- data/README.rdoc +103 -0
- data/bin/prenus +190 -0
- data/lib/css/table.css +576 -0
- data/lib/images/back_disabled.png +0 -0
- data/lib/images/back_enabled.png +0 -0
- data/lib/images/back_enabled_hover.png +0 -0
- data/lib/images/forward_disabled.png +0 -0
- data/lib/images/forward_enabled.png +0 -0
- data/lib/images/forward_enabled_hover.png +0 -0
- data/lib/images/sort_asc.png +0 -0
- data/lib/images/sort_asc_disabled.png +0 -0
- data/lib/images/sort_both.png +0 -0
- data/lib/images/sort_desc.png +0 -0
- data/lib/images/sort_desc_disabled.png +0 -0
- data/lib/input.rb +1 -0
- data/lib/input/nessusin.rb +127 -0
- data/lib/js/highcharts.js +239 -0
- data/lib/js/jquery.dataTables.js +12091 -0
- data/lib/js/jquery.min.js +4 -0
- data/lib/output.rb +6 -0
- data/lib/output/afterglowout.rb +64 -0
- data/lib/output/circosout.rb +101 -0
- data/lib/output/hostinfoout.rb +62 -0
- data/lib/output/htmlout.rb +732 -0
- data/lib/output/output.rb +39 -0
- data/lib/output/xlsout.rb +60 -0
- metadata +87 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Prenus
|
|
2
|
+
module Output
|
|
3
|
+
|
|
4
|
+
class Baseout
|
|
5
|
+
|
|
6
|
+
@events = {} #instance variable of all vulnerability events
|
|
7
|
+
@hosts = {} #instance variable of all the hosts
|
|
8
|
+
@options = {} #instance variable of the options hash, this inclues all the configuration settings @see Htmlout#initialize
|
|
9
|
+
@oFile = nil #the output file
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# This is the super-class that all output classes should inherent
|
|
13
|
+
# @see Htmlout#initialize
|
|
14
|
+
#
|
|
15
|
+
def initialize(events, hosts, options)
|
|
16
|
+
@events = events
|
|
17
|
+
@hosts = hosts
|
|
18
|
+
@options = options
|
|
19
|
+
|
|
20
|
+
if @options[:type] == "html" #Therefore, the output should be a folder name, not a file
|
|
21
|
+
#Check if the output dir exists
|
|
22
|
+
Dir.mkdir(options[:output]) unless File.exists?(options[:output])
|
|
23
|
+
else
|
|
24
|
+
@oFile = File.new(@options[:output],'w') unless @options[:output].nil?
|
|
25
|
+
@oFile = STDOUT if @oFile.nil?
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
#
|
|
31
|
+
# All inherented classes should implement a run method
|
|
32
|
+
# @see Htmlout#run
|
|
33
|
+
#
|
|
34
|
+
def run
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
module Prenus
|
|
2
|
+
module Output
|
|
3
|
+
|
|
4
|
+
class Xlsout < Baseout
|
|
5
|
+
|
|
6
|
+
#
|
|
7
|
+
# Initialises the Xlsout class into an object
|
|
8
|
+
#
|
|
9
|
+
# @return [Object]
|
|
10
|
+
# Returns the Xlsout object
|
|
11
|
+
#
|
|
12
|
+
# @input
|
|
13
|
+
# events - the hash object with all the vulnerability events within it - @see Nessusin#import_nessus_files
|
|
14
|
+
# hosts - the hash object with all the hosts within it - @see Nessusin#import_nessus_files
|
|
15
|
+
# options - the hash object with the configuration objections within it. These options include the output folder etc, and are used within many of the methods below
|
|
16
|
+
#
|
|
17
|
+
# @example
|
|
18
|
+
# object = Prenus::Output::Xmlout(events,hosts,options)
|
|
19
|
+
#
|
|
20
|
+
def initialize(events,hosts,options)
|
|
21
|
+
super
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Run the Xmlout class - this will generate HTML file called .xls to the target folder
|
|
26
|
+
#
|
|
27
|
+
# @return
|
|
28
|
+
# Returns nothing
|
|
29
|
+
#
|
|
30
|
+
# @example
|
|
31
|
+
# object.run
|
|
32
|
+
#
|
|
33
|
+
def run
|
|
34
|
+
# File.open(@options[:outputdir] + "/out.xls", 'w') do |f|
|
|
35
|
+
|
|
36
|
+
@oFile.syswrite "<table border=1>\n"
|
|
37
|
+
@oFile.syswrite "<tr><th>Nessus Plugin ID</th><th>Severity</th><th>Synopsis</th><th>Description</th><th>Solution</th><th>Hosts</th></tr>\n"
|
|
38
|
+
|
|
39
|
+
@events.each do |k,v|
|
|
40
|
+
@oFile.syswrite "<tr><td>" + k.to_s + "</td><td>" + v[:severity].to_s + "</td><td>" + v[:synopsis] + "</td><td>" + v[:description] + "</td><td>" + v[:solution].to_s + "</td>"
|
|
41
|
+
@oFile.syswrite "<td>"
|
|
42
|
+
impacted_hosts = []
|
|
43
|
+
v[:ports].each {|k,v|
|
|
44
|
+
v[:hosts].each do |h,w|
|
|
45
|
+
impacted_hosts << h
|
|
46
|
+
end
|
|
47
|
+
}
|
|
48
|
+
impacted_hosts.uniq.each do |host|
|
|
49
|
+
@oFile.syswrite @hosts[host][:ip] + "\n"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
@oFile.syswrite "</td></tr>\n"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
@oFile.syswrite "</table>\n"
|
|
56
|
+
# end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
end end
|
metadata
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: prenus
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Christian Frichot
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2012-07-31 00:00:00.000000000Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: ruby-nessus
|
|
16
|
+
requirement: &70165631471960 !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ~>
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 1.0.3
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: *70165631471960
|
|
25
|
+
description: Pretty Nessus = Prenus
|
|
26
|
+
email: xntrik@gmail.com
|
|
27
|
+
executables:
|
|
28
|
+
- prenus
|
|
29
|
+
extensions: []
|
|
30
|
+
extra_rdoc_files:
|
|
31
|
+
- LICENSE.txt
|
|
32
|
+
- README.rdoc
|
|
33
|
+
files:
|
|
34
|
+
- lib/css/table.css
|
|
35
|
+
- lib/images/back_disabled.png
|
|
36
|
+
- lib/images/back_enabled.png
|
|
37
|
+
- lib/images/back_enabled_hover.png
|
|
38
|
+
- lib/images/forward_disabled.png
|
|
39
|
+
- lib/images/forward_enabled.png
|
|
40
|
+
- lib/images/forward_enabled_hover.png
|
|
41
|
+
- lib/images/sort_asc.png
|
|
42
|
+
- lib/images/sort_asc_disabled.png
|
|
43
|
+
- lib/images/sort_both.png
|
|
44
|
+
- lib/images/sort_desc.png
|
|
45
|
+
- lib/images/sort_desc_disabled.png
|
|
46
|
+
- lib/input/nessusin.rb
|
|
47
|
+
- lib/input.rb
|
|
48
|
+
- lib/js/highcharts.js
|
|
49
|
+
- lib/js/jquery.dataTables.js
|
|
50
|
+
- lib/js/jquery.min.js
|
|
51
|
+
- lib/output/afterglowout.rb
|
|
52
|
+
- lib/output/circosout.rb
|
|
53
|
+
- lib/output/hostinfoout.rb
|
|
54
|
+
- lib/output/htmlout.rb
|
|
55
|
+
- lib/output/output.rb
|
|
56
|
+
- lib/output/xlsout.rb
|
|
57
|
+
- lib/output.rb
|
|
58
|
+
- LICENSE.txt
|
|
59
|
+
- README.rdoc
|
|
60
|
+
- bin/prenus
|
|
61
|
+
homepage: http://github.com/AsteriskLabs/prenus
|
|
62
|
+
licenses:
|
|
63
|
+
- MIT
|
|
64
|
+
post_install_message:
|
|
65
|
+
rdoc_options: []
|
|
66
|
+
require_paths:
|
|
67
|
+
- lib
|
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
|
+
none: false
|
|
70
|
+
requirements:
|
|
71
|
+
- - ! '>='
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: 1.9.2
|
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
|
+
none: false
|
|
76
|
+
requirements:
|
|
77
|
+
- - ! '>='
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: 1.8.0
|
|
80
|
+
requirements: []
|
|
81
|
+
rubyforge_project:
|
|
82
|
+
rubygems_version: 1.8.10
|
|
83
|
+
signing_key:
|
|
84
|
+
specification_version: 3
|
|
85
|
+
summary: Prenus - The Pretty Nessus Parser
|
|
86
|
+
test_files: []
|
|
87
|
+
has_rdoc:
|