I wrote this script to interact with nessus and tell me what reports were in the nessus list:
#!/usr/bin/python
from NessusXMLRPC import Scanner
import sys
x = Scanner("localhost", "8834", login="root", password="password123")
report = str(x.reportList())
print report
x.logout
I now want to take the output:
root@bt:~/NessusXMLRPC-0.21# ./reportfornessus.py
[{'status': 'running', 'readableName': 'SecondScan', 'name': '76c25e9b-8280-5310-23e8-f9873255c5a6288ff86b03b2cdb6', 'timestamp': '1328641639'}, {'status': 'running', 'readableName': 'Third Scan', 'name': '01b2a026-44d3-574c-08e3-e6c97e3f8e21c7c00ec9cb71a7cd', 'timestamp': '1328641704'}]
and parse through it looking for my specifically passed ‘readableName’ and then return the ‘status’ for that scan.
1 Answer