0% found this document useful (0 votes)
94 views1 page

Nessus Script

This document is a Ruby script that processes a Nessus vulnerability scan file. It uses the Nokogiri and Trollop gems to parse the Nessus XML file and get user options via the command line. It checks that a file is selected, sets the minimum severity level based on user input, and parses the Nessus XML file into a Nokogiri document object for further processing.

Uploaded by

api-385391462
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views1 page

Nessus Script

This document is a Ruby script that processes a Nessus vulnerability scan file. It uses the Nokogiri and Trollop gems to parse the Nessus XML file and get user options via the command line. It checks that a file is selected, sets the minimum severity level based on user input, and parses the Nessus XML file into a Nokogiri document object for further processing.

Uploaded by

api-385391462
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

#!

/usr/bin/ruby

require nokogiri
require trollop
require csv

opts = Trollop: :options do


version Nessus 6.11.0
opt :file, Nessus file to process ,:type => String
opt :severity, Minimum Severity Level: [H]igh, [C]ritical , :default => L
opt :col_sep, CSV Column Separator , :default => ;
end
Trollop::die :file, - Please select a .Nessus file unless opts[:file] #User selects a .nessus scan

doc = Nokogirl::XML(open(opts[:file]).read)
if [L, l, Low, low, LOW].include? opts[:severity]
arg_severity = 1
elsif [M, m, Medium, medium, MEDIUM].include? opts[:severity]
arg_severity = 2
elsif [H, h, High, high, HIGH].include? opts[:severity]
arg_severity = 3
elsif [C, c, Critical, critical, CRITICAL].include? opts[:severity]
arg_severity = 4
else
arg_severity = 0
end

You might also like