Class: Prenus::Output::Afterglowout
- Defined in:
- lib/output/afterglowout.rb
Instance Method Summary collapse
-
#initialize(events, hosts, options) ⇒ Object
constructor
Initialises the Afterglowout class into an object.
-
#run ⇒ Object
Run the Afterout class - this will generate a simple CSV file called prenus.glow to the target folder.
Constructor Details
#initialize(events, hosts, options) ⇒ Object
Initialises the Afterglowout class into an object
23 24 25 |
# File 'lib/output/afterglowout.rb', line 23 def initialize(events,hosts,) super end |
Instance Method Details
#run ⇒ Object
Run the Afterout class - this will generate a simple CSV file called prenus.glow to the target folder
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/output/afterglowout.rb', line 36 def run #File.open(@options[:outputdir] + "/prenus.glow", 'w') do |f| @events.each do |k,v| unless [:filter].nil? next unless [:filter].include?(k.to_s) end # The graphs were getting too mental, so I hard coded to ignore everything except High and Critical findings next if v[:severity].to_i < [:severity].to_i impacted_hosts = [] v[:ports].each do |k2,v2| v2[:hosts].each do |h,w| impacted_hosts << h end end impacted_hosts.uniq.each do |host| #f.puts k.to_s + " (" + v[:severity].to_s + ")," + @hosts[host][:ip] + "\n" @oFile.syswrite k.to_s + " (" + v[:severity].to_s + ")," + @hosts[host][:ip] + "\n" end end #end end |