AutoNessus - Script to Communicate with Nessus API

This script communicates with the Nessus API in an attempt to help with automating scans. Depending on the flag issued with the script, you can list all scans, list all policies, start, stop, pause, and resume a scan. It may be helpful to create a cron job/scheduled task for automating the start or pause of scans if the client has a desired testing window.

Please feel free to use and modify this code; it works for our purposes but may not work perfectly for yours. Any suggestions or improvements are highly encouraged.

Requires python version 2.x and "requests" module to be installed. Installation can be found here:

Start & Help


python -h   
Both will run the help menu and display a list of options.

This script authenticates to the Nessus server when supplying any other flag than -h. Correct URL and credentials must be placed on lines 52-56 of the script.

List all scans and scan IDs (scan IDs to be used with other flags)
python -l
Start scan 42
python -sS 42
Pause scan 42
python autoNessus --pause 42

If you would like to start an already completed scan (one with a "completed" status) you must add 'completed' to the list on line 272. This was done to ensure that scans would not re-run once completed.

AutoNessus - Script to Communicate with Nessus API AutoNessus - Script to Communicate with Nessus API Reviewed by Lydecker Black on 7:16 PM Rating: 5