So I recently needed to add multiple scans to nessus and export the results for splunk, being new to python and loving it.
I decided to look for some examples and work from there,
I found “https://github.com/averagesecurityguy/Nessus6/blob/master/nessus6_scan_demo.py” grabbed a copy and started to modify it to what I needed.
Warning this is not the best code but does what I currenlty need it to do.
./nessus-cli.py -h
##################################
# Nessus api client #
##################################
Add Desktop Scan
./nessus.py add_desktop_scan name description target
Add Server Scan
./nessus.py add_server_scan name description target
List Scans
./nessus.py list_scans
List Subnets
./nessus.py list_subnets
List running scans
./nessus.py list_running_scans
List completed scans
./nessus.py list_completed_scans
Export Scan
./nessus.py export_scan id
Export scans that have not been completed
./nessus.py export_scans
Start Scan
./nessus.py launch_scan id
##################################