Tuesday, May 21, 2013

Download Multiple Nessus Reports via the Nessus XML-RPC API

Several months back I began to look at various ways to automate some of the common tasks that are usually performed within the Nessus GUI. I was familiar with nessuscmd, and had leveraged that tool within some scripts, but it didn't fit the bill for a lot of the administrative activity that I thought could be automated, or at least made more efficient.

The catalyst for my digging into this was that I wanted to be able to download multiple reports from a Nessus scanner (or scanners) en masse, without having to log in and manually download them.  I didn't have access to Security Center, and I'm not even sure if that's a feature or not. I started looking into the Nessus API Documentation and found that I could interact with Nessus and get almost all of the features of the GUI via HTTP POST's and GET's.

I coded up a python script that connects to a Nessus scanner, prompts you to enter a report name string (that accepts common wildcard characters such as * and ?) to list the reports, then downloads the reports matching your query. You can specify the file type to download (.nessus or .nbe) or you can specify that you want both formats. You can also download all of the reports from the scanner by leaving the query string blank.

I've found this script to be useful, especially when downloading 100+ scan files from multiple scanners.

You can download the script here: https://code.google.com/p/sunera-ap-team/downloads/list

No comments:

Post a Comment