0.0
No release in over 3 years
Low commit activity in last 3 years
Usable, fast, simple Ruby gem for Tenable Nessus Pro from v7.0.1 to v8.3.1. NessusClient was designed to be simple, fast and performant through communication with Nessus over REST interface.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 0.1.14
>= 1.8.5, ~> 1.10.10
~> 0.12.2
>= 1.5.0, ~> 1.5
~> 3.2
~> 0.17.0
~> 0.9, >= 0.9.20

Runtime

>= 0.73.0, ~> 0.73
~> 3.7
 Project Readme

NessusClient

Usable, fast, simple Ruby gem for Tenable Nessus Pro from v7.0.1 to v8.3.1 NessusClient was designed to be simple, fast and performant through communication with Nessus over REST interface.

Gem Version Maintainability codecov Inline docs

Ruby gem for Nessus API

Contact

Code and Bug Reports

  • Issue Tracker
  • See CONTRIBUTING for how to contribute along with some common problems to check out before creating an issue.

Getting started

require 'nessus_client'

nc = NessusClient.new( { :uri=>'https://localhost:8834', :username=>'username',:password=> 'password'} )
status = nc.server_status 
puts status
puts nc.server_properties

if status['status'] == 'ready'
  scan_id = nc.get_scan_by_name('Monthly Scan')
  scan_uuid = nc.launch_by_name( 'Monthly Scan', ['127.0.0.1'])['scan_uuid']

  loop do
   puts `clear`
   scan_status = nc.scan_details( scan_id )["info"]["status"] 
   puts " #{scan_id} - #{scan_uuid} - #{scan_status} "
   sleep 5
   if ["completed","canceled"].include? scan_status
      export_request = nc.export_request(scan_id, "nessus" )
      puts " export request: #{export_request}"
      while true do
        puts `clear`
        export_status =  nc.token_status( export_request['token'])["status"]
        puts " export status: #{export_status}"
        sleep 5
        if export_status == "ready"
          puts " downloading..."
          open("scan_report", "wb") do |file|
            file.write(nc.token_download( export_request['token'] ))
          end
          exit 0
        end
      end
   end
  end
end

Installation

Add this line to your application's Gemfile:

gem 'nessus_client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nessus_client

Requirements

Requirements are Exon for HTTP(S) and Oj parsing:

require 'excon'
require 'oj'

Code of Conduct

Everyone participating in this project's development, issue trackers and other channels is expected to follow our Code of Conduct.

Contributing

See the contributing guide.

Copyright

Copyright (c) 2016-2019 Heyder Andrade. See MIT-LICENSE for details.