Last active
June 19, 2017 06:30
-
-
Save vanhecke/f2b7b03f611c35114f17282b6418467f to your computer and use it in GitHub Desktop.
Convert .nessus file(s) to a CSV using mephux/ruby-nessus.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nessus' | |
require 'csv' | |
csv = CSV.open("results.csv", "w", force_quotes: true) | |
csv << ['Plugin ID','CVE','CVSS','Risk','Host','Protocol','Port','Name','Synopsis','Description','Solution','See Also','Plugin Output'] | |
Dir.glob('/PATH_TO_FILE(S)/*.nessus').each do |nessus_file| | |
Nessus::Parse.new(nessus_file) do |scan| | |
puts "#{scan.title} (#{scan.host_count})" | |
scan.each_host do |host| | |
next if host.event_count.zero? # Skip if zero vulnerabilities. | |
puts host.ip | |
host.each_event do |event| | |
csv << [ | |
event.id, | |
event.cve, | |
event.cvss_base_score, | |
event.risk, | |
host.ip, | |
event.port.protocol, | |
event.port.number, | |
event.plugin_name, | |
event.synopsis, | |
event.description, | |
event.solution, | |
event.see_also, | |
event.output | |
] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment