Accessing Nessus 6 API with Python
Nessus is one of the popular vulnerability scanners developed by Tenable Network Security, which scans a computer and raises an alert if it discovers any vulnerabilities that an attacker could use to access any computer you have connected to a network. Nessus provides an API to access it programmatically. We can use any library to make HTTP requests, which abound in Python. Tenable created a python
library nessrest (https://github.com/tenable/nessrest) with the requests
module for using the Nessus 6 REST API.
To use this module in our Python script, import it as we did for other modules after installation. We can install the nessrest
module with pip
:
$ pip install nessrest
Then, import it in our script:
from nessrest import ness6rest
Now we can initialize the scanner, as we are running Nessus with a self-signed certificate, we have to disable SSL certificate checking. For that, pass another parameter insecure=True
to the Scanner
initializer:
scan = ness6rest...