python-libnessus ==============
Code status
===========
[](https://travis-ci.org/bmx0r/python-libnessus)
[](https://coveralls.io/r/bmx0r/python-libnessus?branch=master)
[](https://landscape.io/github/bmx0r/python-libnessus/master)
Still in dev\...
About
=====
libnessue is a python library to manipulate nessus process and data.
libnessus is what you were looking for if you need to implement the
following: - manipulate nessus scans results to do reporting - compare
and diff nessus scans - store nessus scans in a datastore (mongo and
Elasticsearch supported)
In the future we might implement something to discuss with nessus API -
automate or schedule nessus scans on a regular basis - batch process
scan reports
Install
=======
Dependencies : You might need jsonpickle,elasticsearch,pymongo if you
want to use the backend plugins
You can install libnmap via pip:
pip install python-libnessus
or via git:
$ git clone https://github.com/bmx0r/python-libnessus.git
$ cd python-libnessus
$ python setup.py install
Model
=====
NessusReport:
``` {.pyton}
In [32]: report = NessusParser.parse_fromfile('/home/vagrant/python-libnessus/libnessus/test/files/nessus_forgedReport_ReportItem.nessus')
In [33]: report?
Type: NessusReport
String form: localpci 1 0:00:05
File: /home/vagrant/python-libnessus/libnessus/objects/report.py
Docstring:
This class represent a Nessus repport, it aims to manipulate
in a easy way the content, and present some metadata
Init docstring:
Description: Constructor of NessusReport
:param name: name of the report
:type name: str
:param hosts: list of NessusReportHost
:type hosts: list
:return: NessusReport
:rtype: NessusReport
```
NessusReportHost:
``` {.pyton}
In [34]: host = report.hosts[0]
In [35]: host?
Type: NessusReportHost
String form: 127.0.0.1 127.0.0.1 {'patch-summary-txt-79ed019e4b6ec5267fd968e511eccdb2': 'CentOS 6 : libtirpc ( <...> 2cda94fbf08': 'CentOS 5 / 6 : libxml2 (CESA-2013:0581): Update the affected libxml2 packages.')'} 5
File: /home/vagrant/python-libnessus/libnessus/objects/reporthost.py
Docstring: Description: Represent an object NessusReportHost in a nessus xml
```
NessusReportItem:
``` {.pyton}
In [36]: reportitem = host.get_report_items[3]
In [37]: reportitem?
Type: NessusReportItem
String form: 10544:Linux Multiple statd Packages Remote Format String 4
File: /home/vagrant/python-libnessus/libnessus/objects/reportitem.py
Docstring: This class represent a ReportItem in the nessus xml
Init docstring:
Constructor of Vulnerability
:param vuln_info: dict of vulnerabities as generated by
NessusParser.parse_reportitem
:type vuln_info: dict
```
Examples
========
Here\'s a basic example:
``` {.pyton}
# Parse a nessus report from xml and save it in Elastic search
In [1]: from libnessus.parser import NessusParser
In [3]: from libnessus.plugins.backendplugin import NessusBackendPlugin
In [4]: from libnessus.plugins.backendpluginFactory import BackendPluginFactory
In [5]: url = {'plugin_name': "es"}
In [6]: backend = BackendPluginFactory.create(\**url)
In [7]: nessus_obj_list = NessusParser.parse_fromfile('/home/vagrant/python-libnessus/libnessus/test/files/nessus_forgedReport_ReportItem.nessus')
In [8]: rc = nessus_obj_list.save(backend)
In [9]: rc
Out[9]: 2275333
In [10]: backend
Out[10]: <libnessus.plugins.es.NessusEsPlugin at 0x1dcc790>
In [11]: nessus_obj_list
Out[11]: localpci 1 0:00:05
#retrieve the report from ES
In [15]: ff = backend.get("2275333")
In [16]: ff
Out[16]: localpci 1 0:00:05
```
Raw data
{
"_id": null,
"home_page": "https://github.com/bmx0r/python-libnessus",
"name": "python-libnessus",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Ronald Bister and Mike Boutillier",
"author_email": "michael.boutillier@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a4/5d/04322524258543697d620f866955580022851248d375ab4eb20309393600/python-libnessus-1.0.0.10.tar.gz",
"platform": "",
"description": "python-libnessus ==============\n\nCode status\n===========\n\n[](https://travis-ci.org/bmx0r/python-libnessus)\n[](https://coveralls.io/r/bmx0r/python-libnessus?branch=master)\n[](https://landscape.io/github/bmx0r/python-libnessus/master)\n\nStill in dev\\...\n\nAbout\n=====\n\nlibnessue is a python library to manipulate nessus process and data.\n\nlibnessus is what you were looking for if you need to implement the\nfollowing: - manipulate nessus scans results to do reporting - compare\nand diff nessus scans - store nessus scans in a datastore (mongo and\nElasticsearch supported)\n\nIn the future we might implement something to discuss with nessus API -\nautomate or schedule nessus scans on a regular basis - batch process\nscan reports\n\nInstall\n=======\n\nDependencies : You might need jsonpickle,elasticsearch,pymongo if you\nwant to use the backend plugins\n\nYou can install libnmap via pip:\n\n pip install python-libnessus\n\nor via git:\n\n $ git clone https://github.com/bmx0r/python-libnessus.git \n $ cd python-libnessus \n $ python setup.py install\n\nModel\n=====\n\nNessusReport:\n\n``` {.pyton}\nIn [32]: report = NessusParser.parse_fromfile('/home/vagrant/python-libnessus/libnessus/test/files/nessus_forgedReport_ReportItem.nessus')\nIn [33]: report?\nType: NessusReport\nString form: localpci 1 0:00:05\nFile: /home/vagrant/python-libnessus/libnessus/objects/report.py\nDocstring:\nThis class represent a Nessus repport, it aims to manipulate\nin a easy way the content, and present some metadata\nInit docstring:\nDescription: Constructor of NessusReport\n:param name: name of the report\n:type name: str\n:param hosts: list of NessusReportHost\n:type hosts: list\n:return: NessusReport\n:rtype: NessusReport\n```\n\nNessusReportHost:\n\n``` {.pyton}\nIn [34]: host = report.hosts[0]\nIn [35]: host?\nType: NessusReportHost\nString form: 127.0.0.1 127.0.0.1 {'patch-summary-txt-79ed019e4b6ec5267fd968e511eccdb2': 'CentOS 6 : libtirpc ( <...> 2cda94fbf08': 'CentOS 5 / 6 : libxml2 (CESA-2013:0581): Update the affected libxml2 packages.')'} 5\nFile: /home/vagrant/python-libnessus/libnessus/objects/reporthost.py\nDocstring: Description: Represent an object NessusReportHost in a nessus xml\n```\n\nNessusReportItem:\n\n``` {.pyton}\nIn [36]: reportitem = host.get_report_items[3]\nIn [37]: reportitem?\nType: NessusReportItem\nString form: 10544:Linux Multiple statd Packages Remote Format String 4\nFile: /home/vagrant/python-libnessus/libnessus/objects/reportitem.py\nDocstring: This class represent a ReportItem in the nessus xml\nInit docstring:\nConstructor of Vulnerability\n:param vuln_info: dict of vulnerabities as generated by\nNessusParser.parse_reportitem\n:type vuln_info: dict\n```\n\nExamples\n========\n\nHere\\'s a basic example:\n\n``` {.pyton}\n# Parse a nessus report from xml and save it in Elastic search\nIn [1]: from libnessus.parser import NessusParser\nIn [3]: from libnessus.plugins.backendplugin import NessusBackendPlugin\nIn [4]: from libnessus.plugins.backendpluginFactory import BackendPluginFactory\nIn [5]: url = {'plugin_name': \"es\"}\nIn [6]: backend = BackendPluginFactory.create(\\**url)\nIn [7]: nessus_obj_list = NessusParser.parse_fromfile('/home/vagrant/python-libnessus/libnessus/test/files/nessus_forgedReport_ReportItem.nessus')\nIn [8]: rc = nessus_obj_list.save(backend)\nIn [9]: rc\nOut[9]: 2275333\nIn [10]: backend\nOut[10]: <libnessus.plugins.es.NessusEsPlugin at 0x1dcc790>\nIn [11]: nessus_obj_list\nOut[11]: localpci 1 0:00:05\n#retrieve the report from ES \nIn [15]: ff = backend.get(\"2275333\")\nIn [16]: ff\nOut[16]: localpci 1 0:00:05\n```",
"bugtrack_url": null,
"license": "Creative Common \"Attribution\" license (CC-BY) v3",
"summary": "Python Nessus module to parse, chat with XMLRPC API, ...",
"version": "1.0.0.10",
"project_urls": {
"Download": "https://github.com/bmx0r/python-libnessus/tarball/1.0.0.10",
"Homepage": "https://github.com/bmx0r/python-libnessus"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a45d04322524258543697d620f866955580022851248d375ab4eb20309393600",
"md5": "c1f19c426a810283923b64e7e9c0cdc9",
"sha256": "99adeea904628acbabe30c746f24d86b4e244682902e0b843277b70e0082628f"
},
"downloads": -1,
"filename": "python-libnessus-1.0.0.10.tar.gz",
"has_sig": false,
"md5_digest": "c1f19c426a810283923b64e7e9c0cdc9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14523,
"upload_time": "2019-08-29T21:50:23",
"upload_time_iso_8601": "2019-08-29T21:50:23.663258Z",
"url": "https://files.pythonhosted.org/packages/a4/5d/04322524258543697d620f866955580022851248d375ab4eb20309393600/python-libnessus-1.0.0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-08-29 21:50:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bmx0r",
"github_project": "python-libnessus",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"lcname": "python-libnessus"
}