module Prenus module Output class Xlsout < Baseout # # Initialises the Xlsout class into an object # # @return [Object] # Returns the Xlsout object # # @input # events - the hash object with all the vulnerability events within it - @see Nessusin#import_nessus_files # hosts - the hash object with all the hosts within it - @see Nessusin#import_nessus_files # 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 # # @example # object = Prenus::Output::Xmlout(events,hosts,options) # def initialize(events,hosts,options) super end # # Run the Xmlout class - this will generate HTML file called .xls to the target folder # # @return # Returns nothing # # @example # object.run # def run # File.open(@options[:outputdir] + "/out.xls", 'w') do |f| @oFile.syswrite "\n" @oFile.syswrite "\n" @events.each do |k,v| @oFile.syswrite "" @oFile.syswrite "\n" end @oFile.syswrite "
Nessus Plugin IDSeveritySynopsisDescriptionSolutionHosts
" + k.to_s + "" + v[:severity].to_s + "" + v[:synopsis] + "" + v[:description] + "" + v[:solution].to_s + "" impacted_hosts = [] v[:ports].each {|k,v| v[:hosts].each do |h,w| impacted_hosts << h end } impacted_hosts.uniq.each do |host| @oFile.syswrite @hosts[host][:ip] + "\n" end @oFile.syswrite "
\n" # end end end end end