https://github.com/james-e-a/pysecuritycentersuite
SecurityCenter [REST] and Nessus [XML scan report, version 2] bindings for Python 3
https://github.com/james-e-a/pysecuritycentersuite
nessus python-library securitycenter
Last synced: about 1 year ago
JSON representation
SecurityCenter [REST] and Nessus [XML scan report, version 2] bindings for Python 3
- Host: GitHub
- URL: https://github.com/james-e-a/pysecuritycentersuite
- Owner: James-E-A
- License: mit
- Created: 2018-05-28T16:21:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-23T18:25:27.000Z (almost 8 years ago)
- Last Synced: 2025-02-08T03:33:22.833Z (over 1 year ago)
- Topics: nessus, python-library, securitycenter
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.rst
- License: LICENSE
Awesome Lists containing this project
README
=====================
pySecurityCentersuite
=====================
| `SecurityCenter [REST]`__ and `Nessus [XML scan report, version 2]`__ bindings for Python 3
| *(Tested EXCLUSIVELY on Python 3.6.3, RHEL6 x86_64)*
.. __: https://docs.tenable.com/sccv/api/index.html
.. __: https://static.tenable.com/documentation/nessus_v2_file_format.pdf
Installation:
#############
::
#apt-get install python3-pip
#yum install rh-python36-python{,-pip} && ln -vsf '../../../opt/rh/rh-python36/root/usr/bin/python3' /usr/local/bin/
python3 -m pip install "${source}"
Where ``"${source}"`` is one of:
a. A URL pointing to the ``.tar.gz`` of the desired version (or a path to one)
b. A local path to either this source code tree, or a compiled ``.whl`` file
c. Probably some other stuff; pip is pretty smart.
Usage:
######
Try the following (type it in manually, in REPL, for most effective learning) and you'll be able to grok it in no time::
from scsuite.sc import SecurityCenterAPI
from scsuite.nessus import dict1_from_xmlv2_root
S=SecurityCenterAPI('localhost')
S.login('securitymanager', 'p@$$w0rd')
r=S.get('scanResult', _PROCESS='RESTRESP')
id=r['usable'][-1]['id']
x=S.get('scanResult/{id}/download'.format(id=id), _PROCESS='UNZIPFILES')[0]
from lxml import etree
r=dict1_from_xmlv2_root(etree.fromstring(x))
#Example: count vulnerabilities
vulnsbysev=[0]*6
for id,res in r.items():
lvl=int(res['severity'])
vulnsbysev[lvl]+=1
.. todo:: more comprehensive documentation
.. warning:: This API is currently NOT STABLE!
Uninstallation:
###############
::
python3 -m pip uninstall scsuite
(If this doesn't `seem` to work, try restarting your shell or relogging/rebooting)