Skip to main content

A flexible and powerful network data analysis framework

Project description

.. image:: https://github.com/aouinizied/nfstream/blob/master/docs/source/asset/logo_main.png
:scale: 100%
:align: left


.. list-table::
:widths: 25 25
:header-rows: 0

* - Latest Release
- |release|
* - Supported Versions
- |python|
* -
- |pypy|
* - Supported Platforms
- |linux|
* -
- |macos|
* - Build Status
- |build|
* - Documentation Status
- |doc|
* - Code Coverage
- |coverage|
* - Code Quality
- |quality|
* - Discussions Channel
- |gitter|


nfstream main features
======================

* **Performance:** **nfstream** is designed to be fast (x10 faster with pypy3 support) with a small CPU and memory footprint.
* **Layer-7 visibility:** **nfstream** deep packet inspection engine is based on nDPI_ library. It allows nfstream to perform reliable_ encrypted applications identification and metadata extraction (e.g. TLS, SSH, DNS, HTTP).
* **Flexibility:** add a flow feature in 2 lines as an NFPlugin_.
* **Machine Learning oriented:** add your trained model as an NFPlugin_.

How to use it?
==============

* Dealing with a big pcap file and just want to aggregate it as network flows? **nfstream** make this path easier in few lines:

.. code-block:: python

from nfstream import NFStreamer
my_awesome_streamer = NFStreamer(source="facebook.pcap") # or capture from a network interface (source="eth0")
for flow in my_awesome_streamer:
print(flow) # print, append to pandas Dataframe or whatever you want :)!


.. code-block:: python

NFEntry(
flow_id=0,
first_seen=1472393122365,
last_seen=1472393123665,
version=4,
src_port=52066,
dst_port=443,
protocol=6,
vlan_id=0,
src_ip='192.168.43.18',
dst_ip='66.220.156.68',
total_packets=19,
total_bytes=5745,
duration=1300,
src2dst_packets=9,
src2dst_bytes=1345,
dst2src_packets=10,
dst2src_bytes=4400,
expiration_id=0,
master_protocol=91,
app_protocol=119,
application_name='TLS.Facebook',
category_name='SocialNetwork',
client_info='facebook.com',
server_info='*.facebook.com',
j3a_client='bfcc1a3891601edb4f137ab7ab25b840',
j3a_server='2d1eb5817ece335c24904f516ad5da12'
)

* Didn't find a specific flow feature? add a plugin to **nfstream** in few lines:

.. code-block:: python

from nfstream import NFPlugin

class my_awesome_plugin(NFPlugin):
def on_update(self, obs, entry):
if obs.length >= 666:
entry.my_awesome_plugin += 1

streamer_awesome = NFStreamer(source='devil.pcap', plugins=[my_awesome_plugin()])
for flow in streamer_awesome:
print(flow.my_awesome_plugin) # now you will see your dynamically created metric in generated flows


* More example and details are provided on the official Documentation_.

Getting Started
===============

Prerequisites
-------------

.. code-block:: bash

apt-get install libpcap-dev

Installation
------------

using pip
^^^^^^^^^

Binary installers for the latest released version are available:

.. code-block:: bash

pip3 install nfstream


from source
^^^^^^^^^^^

If you want to build **nfstream** on your local machine:

.. code-block:: bash

apt-get install autogen
git clone https://github.com/aouinizied/nfstream.git
cd nfstream
python3 setup.py install


Contributing
============

Please read Contributing_ for details on our code of conduct, and the process for submitting pull
requests to us.


Authors
=======

`Zied Aouini`_ (`aouinizied`_) created **nfstream** and `these fine people`_
have contributed.

Ethics
=======

**nfstream** is intended for network data research and forensics.
Researchers and network data scientists can use these framework to build reliable datasets, train and evaluate
network applied machine learning models.
As with any packet monitoring tool, **nfstream** could potentially be misused.
**Do not run it on any network of which you are not the owner or the administrator**.

License
=======

This project is licensed under the GPLv3 License - see the License_ file for details


.. |release| image:: https://img.shields.io/pypi/v/nfstream.svg
:target: https://pypi.python.org/pypi/nfstream
.. |gitter| image:: https://badges.gitter.im/gitterHQ/gitter.png
:target: https://gitter.im/nfstream/community
.. |build| image:: https://travis-ci.org/aouinizied/nfstream.svg?branch=master
:target: https://travis-ci.org/aouinizied/nfstream
.. |python| image:: https://img.shields.io/badge/python-%3E%3D3.6-blue
:target: https://travis-ci.org/aouinizied/nfstream
.. |pypy| image:: https://img.shields.io/badge/pypy-3-blue
:target: https://travis-ci.org/aouinizied/nfstream
.. |doc| image:: https://readthedocs.org/projects/nfstream/badge/?version=latest
:target: https://nfstream.readthedocs.io/en/latest/?badge=latest
.. |linux| image:: https://img.shields.io/badge/linux-x86__64-blue
:target: https://travis-ci.org/aouinizied/nfstream
.. |macos| image:: https://img.shields.io/badge/%09macOS-%3E%3D10.13-blue
:target: https://travis-ci.org/aouinizied/nfstream
.. |coverage| image:: https://codecov.io/gh/aouinizied/nfstream/branch/master/graph/badge.svg
:target: https://codecov.io/gh/aouinizied/nfstream/
.. |quality| image:: https://img.shields.io/lgtm/grade/python/github/aouinizied/nfstream.svg?logo=lgtm&logoWidth=18)
:target: https://lgtm.com/projects/g/aouinizied/nfstream/context:python

.. _License: https://github.com/aouinizied/nfstream/blob/master/LICENSE
.. _Contributing: https://nfstream.readthedocs.io/en/latest/contributing.html
.. _these fine people: https://github.com/aouinizied/nfstream/graphs/contributors
.. _Zied Aouini: https://www.linkedin.com/in/dr-zied-aouini
.. _aouinizied: https://github.com/aouinizied
.. _Documentation: https://nfstream.readthedocs.io/en/latest/
.. _nDPI: https://www.ntop.org/products/deep-packet-inspection/ndpi/
.. _NFPlugin: https://nfstream.readthedocs.io/en/latest/plugins.html
.. _reliable: http://people.ac.upc.edu/pbarlet/papers/ground-truth.pam2014.pdf




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

nfstream-3.0.2-cp38-cp38-manylinux1_x86_64.whl (783.6 kB view details)

Uploaded CPython 3.8

nfstream-3.0.2-cp37-cp37m-manylinux1_x86_64.whl (783.6 kB view details)

Uploaded CPython 3.7m

nfstream-3.0.2-cp37-cp37m-macosx_10_15_x86_64.whl (250.3 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

nfstream-3.0.2-cp37-cp37m-macosx_10_14_x86_64.whl (249.4 kB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

nfstream-3.0.2-cp37-cp37m-macosx_10_13_x86_64.whl (251.6 kB view details)

Uploaded CPython 3.7mmacOS 10.13+ x86-64

nfstream-3.0.2-cp36-cp36m-manylinux1_x86_64.whl (783.6 kB view details)

Uploaded CPython 3.6m

File details

Details for the file nfstream-3.0.2-pp371-pypy3_71-manylinux1_x86_64.whl.

File metadata

  • Download URL: nfstream-3.0.2-pp371-pypy3_71-manylinux1_x86_64.whl
  • Upload date:
  • Size: 783.6 kB
  • Tags: PyPy
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.1 PyPy/7.1.1beta

File hashes

Hashes for nfstream-3.0.2-pp371-pypy3_71-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ca25ee07d4bab4297f0a14ec5489cc584e67657fec063a599692ee4bcde21bc4
MD5 0deb6e7232458d5e49c3b17e77227538
BLAKE2b-256 1af6aa41972666734170cb80735bdd5061441180dcf5350bfe57fa4d2ab19cea

See more details on using hashes here.

File details

Details for the file nfstream-3.0.2-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: nfstream-3.0.2-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 783.6 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.8.0

File hashes

Hashes for nfstream-3.0.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 33f85fde9dfd947ddf9a17bbe7ecca33f4de3db3c1ac8be8ba3fd105c63bc44d
MD5 c05855f0b13324002b67926f28401e8d
BLAKE2b-256 924cbdf2137e2fa13ba5d524aa6a1c61fa37a062122a4bd66f2aa51811a93c05

See more details on using hashes here.

File details

Details for the file nfstream-3.0.2-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: nfstream-3.0.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 783.6 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.1

File hashes

Hashes for nfstream-3.0.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 72972ffb48d400a0a7c8e66a394518ceb6c88c5c55baeed1505b4d9e5af8bec4
MD5 213617a87c4cfa66ec03a484c1cf3acd
BLAKE2b-256 2d1675e3972527b2862d10337e83148f7e5980a2928d03e97d82a868f67620aa

See more details on using hashes here.

File details

Details for the file nfstream-3.0.2-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: nfstream-3.0.2-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 250.3 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for nfstream-3.0.2-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0e2cb3e1d6281690187b59320dcd437183f076557806f2ba12951818d1738563
MD5 9007c331decde1ce8bec8862907090db
BLAKE2b-256 c53264ca6bee621781f320c97a3e72ebf4364bba520573dc592a7a56e668dd52

See more details on using hashes here.

File details

Details for the file nfstream-3.0.2-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: nfstream-3.0.2-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 249.4 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.4

File hashes

Hashes for nfstream-3.0.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f2781bbed26b3728b0670781e3bce24ad207abb34ee9bac3abe33e15c6fcfa47
MD5 39bcab55eaf87b84a2db34c8de5a72f0
BLAKE2b-256 36aa9db4132c599172cc3266bf4c0258658fef2a3a3bf1036beaa28799899f1d

See more details on using hashes here.

File details

Details for the file nfstream-3.0.2-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: nfstream-3.0.2-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 251.6 kB
  • Tags: CPython 3.7m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.5

File hashes

Hashes for nfstream-3.0.2-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8a93b832161ab1aa506ac4f204e5254e7cb0065a8f88805c2abefca2df253cb4
MD5 a7ec9dfff7108d0b8ac75fe909a89bec
BLAKE2b-256 d8e3aa8e3e92f07f47af8c376092503f0c44807d72d2fb8d90470abcb30f69bd

See more details on using hashes here.

File details

Details for the file nfstream-3.0.2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: nfstream-3.0.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 783.6 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.6.7

File hashes

Hashes for nfstream-3.0.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3952726010159c4abeda3f422225cf3909b97d583d9090dc678574be1fbec496
MD5 6090ac73a2ed8541622472fc31b584de
BLAKE2b-256 a4f2fea2b1202744db7e102a801ce3157f48568bf01a1a1e3ebac7a981ab47c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page