Sha256: 3eb896ec8a148875bf208952bb26732e33383054454e7702791cce8a2fcfefeb

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__),'..','lib'))

#!/usr/bin/env ruby
require 'rubygems'
require 'ruby-nessus'

# Ruby-Nessus Example

Nessus::XML.new("example.nessus") do |scan|
  
  puts "Title: #{scan.title}"
  puts "Policy: #{puts scan.policy_name}"
  puts "Policy Description: #{puts scan.policy_name}"
  puts "Start Time: #{scan.start_time}"
  puts "Stop Time: #{scan.stop_time}"
  puts "Run Time: #{scan.runtime}"
  puts "Host Count: #{scan.host_count}"
  puts "Percentage Of Medium Events: #{scan.event_percentage_for('medium', true)}%"
  
  
  scan.hosts do |host|
    puts "Hostname: #{host.hostname}"
    puts "Open Ports: #{host.open_ports}"
    puts "High Severity Events: #{host.high_severity_events}"
    puts "Medium Severity Events: #{host.medium_severity_events}"
    puts "Low Severity Events: #{host.low_severity_events}"
    puts "Total Event Count: #{host.event_count}"
    puts "\n"
    
    host.events do |event|
      next unless event.name
      puts "Name: #{event.name}"
      puts "Port: #{event.port}"
      puts "Severity: #{event.severity.in_words}"
    end
  
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-nessus-0.1.2 examples/example.rb