Skip to content

SecurityCenter [REST] and Nessus [XML scan report, version 2] bindings for Python 3

License

Notifications You must be signed in to change notification settings

James-E-A/pySecurityCenterSuite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pySecurityCentersuite

(Tested EXCLUSIVELY on Python 3.6.3, RHEL6 x86_64)

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:

  1. A URL pointing to the .tar.gz of the desired version (or a path to one)
  2. A local path to either this source code tree, or a compiled .whl file
  3. 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)

About

SecurityCenter [REST] and Nessus [XML scan report, version 2] bindings for Python 3

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages