Git Product home page Git Product logo

python-libnmap's Introduction

python-libnmap

Code status

preflight-check Coverage Status License

Use cases

libnmap is a python library enabling python developers to manipulate nmap process and data.

libnmap is what you were looking for if you need to implement the following:

  • automate or schedule nmap scans on a regular basis
  • manipulate nmap scans results to do reporting
  • compare and diff nmap scans to generate graphs
  • batch process scan reports

The above uses cases will be easy to implement with the help of the libnmap modules.

libnmap modules

The lib currently offers the following modules:

  • process: enables you to launch nmap scans
  • parse: enables you to parse nmap reports or scan results (only XML so far) from a file, a string,…
  • report: enables you to manipulate a parsed scan result and de/serialize scan results in a json format
  • diff: enables you to see what changed between two scans
  • common: contains basic nmap objects like NmapHost and NmapService. It is to note that each object can be "diff()ed" with another similar object.
  • plugins: enables you to support datastores for your scan results directly in the "NmapReport" object. from report module:
    • mongodb: insert/get/getAll/delete
    • sqlalchemy: insert/get/getAll/delete
    • aws s3: insert/get/getAll/delete (not supported for python3 since boto is not supporting py3)
    • csv: todo (easy to implement)
    • elastic search: todo

Documentation

All the documentation is available on read the docs. This documentation contains small code samples that you directly reuse.

Dependencies

libnmap has by default no dependencies, except defusedxml if you need to import untrusted XML scans data.

The only additional python modules you’ll have to install depends if you wish to use libnmap to store reports on an exotic data store via libnmap’s independents plugins.

Below the list of optional dependencies:

Security

If you are importing/parsing untrusted XML scan outputs with python-libnmap, install defusedxml library:

ronald@brouette:~/dev$ pip install defusedxml

This will prevent you from being vulnerable to XML External Entities attacks.

For more information, read the official libnmap documentation

This note relates to a cascaded CVE vulnerability from the python core library XML ElementTree. Nevertheless, python-libnmap has been assigned an official CVE to track this issue.

This CVE is addressed from v0.7.2.

Python Support

The libnmap code is tested against the following python interpreters:

  • Python 2.7
  • Python 3.6
  • Python 3.7
  • Python 3.8

Install

You can install libnmap via pip:

ronald@brouette:~$ pip install python-libnmap

or via git and dist utils (à l’ancienne):

ronald@brouette:~$ git clone https://github.com/savon-noir/python-libnmap.git
ronald@brouette:~$ cd python-libnmap
ronald@brouette:~$ python setup.py install

or via git and pip:

ronald@brouette:~$ git clone https://github.com/savon-noir/python-libnmap.git
ronald@brouette:~$ cd python-libnmap
ronald@brouette:~$ pip install .

Examples

Some codes samples are available in the examples directory or in the documentation.

Among other example, you notice an sample code pushing nmap scan reports in an ElasticSearch instance and allowing you to create fancy dashboards in Kibana like the screenshot below:

Kibanane

Contributors

Mike @bmx0r Boutillier for S3 and SQL-Alechemy plugins and for the constructive critics. Thanks!

python-libnmap's People

Contributors

savon-noir avatar bmx0r avatar deedasmi avatar pyoner avatar erwinjanssen avatar klondi avatar d4t4king avatar orf avatar cooperlees avatar dougroyal avatar dutchy- avatar freddiedev avatar gtataranni avatar weddige avatar n0skill avatar warnerpr-cyan avatar professor-plum avatar rcarrillo avatar snovvcrash avatar shouren avatar swapneelm avatar landonstewart avatar allfro avatar nnam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.