A script to export Nessus results regularly into a MySQL database for easy analysis/aggregation.
- Find occurences of a specific vulnerability across your scans (e.g. in a folder) without having to export all of them to CSV.
- Search for text in plugin outputs across all your scans.
- Quickly see trending stats across scan runs (summary stats are calculated at export time and saved in the DB).
- Build a web app front end to present a subset of results for customers.
Some usage examples here: https://projectblack.io/blog/nessus-reporting-customisation-and-analysis/
- Nessus Professional
- MySQL database (can be run locally or in Docker)
More details can be found in database\README.md
.
- Start the database container:
docker compose up -d
Default passwords can be changed in the docker-compose.yml
file.
- Install MySQL on your system
- Create a new database and user
- Import the schema:
mysql -u your_username -p your_database < database/schema.sql
- You also have to import the stored procedures in
database/queries/*
More details can be found in exporter\README.md
.
-
Copy
config.ini.example
toconfig.ini
:cp config.ini.example config.ini
-
Configure the following in
config.ini
:- Nessus hostname, port, access key, and secret key
- MySQL hostname, username, password, and database name
- Additional options:
trash
: Set totrue
to include scans in trash foldersdebug
: Set totrue
for debug outputcompliance
: Set totrue
to include compliance data
-
Build the exporter container:
cd exporter docker build -t nessus-export .
-
Run the exporter:
docker run nessus-export
- Install Python dependencies:
pip3 install -r requirements.txt
The exporter can be run in two ways:
docker run nessus-export
python3 export.py
Example output:
Processing: REDACTED
Inserting scan run: 69
Inserting scan run: 81
Processing: REDACTED
Processing: REDACTED
Inserting scan run: 87
Once the export is completed you can run whatever queries you want. e.g.:
- TODO: Add flag to only retrieve latest scan
- TODO: Possibly build more samples if there's interest?
- NOTE: Compliance scans are experimental, try it and let me know if it works?