Skip to main content

A flexible and powerful network data analysis framework

Project description

nfstream: a flexible network data analysis framework

nfstream is a Python package providing fast, flexible, and expressive data structures designed to make working with online or offline network data both easy and intuitive. It aims to be the fundamental high-level building block for doing practical, real world network data analysis in Python. Additionally, it has the broader goal of becoming a common network data processing framework for researchers providing data reproducibility across experiments.

Latest Release latest release
Supported Platforms Linux MacOS
Supported Versions python3 pypy3
Build Status Appveyor CI Travis CI
Documentation Status ReadTheDocs
Code Quality Quality
Code Coverage Coverage
Discussion Channel Gitter

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. 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:
   from nfstream import NFStreamer
   my_awesome_streamer = NFStreamer(source="facebook.pcap") # or network interface (source="eth0")
   for flow in my_awesome_streamer:
       print(flow)  # print, append to pandas Dataframe or whatever you want :)!
    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:
    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) # see your dynamically created metric in generated flows
  • More example and details are provided on the official documentation.

Prerequisites

    apt-get install libpcap-dev

Installation

Using pip

Binary installers for the latest released version are available:

    pip3 install nfstream

Build from source

If you want to build nfstream on your local machine:

    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 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

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.4-cp38-cp38-manylinux1_x86_64.whl (784.1 kB view details)

Uploaded CPython 3.8

nfstream-3.0.4-cp37-cp37m-manylinux1_x86_64.whl (784.1 kB view details)

Uploaded CPython 3.7m

nfstream-3.0.4-cp37-cp37m-macosx_10_15_x86_64.whl (250.6 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

nfstream-3.0.4-cp37-cp37m-macosx_10_14_x86_64.whl (250.0 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

nfstream-3.0.4-cp37-cp37m-macosx_10_13_x86_64.whl (252.2 kB view details)

Uploaded CPython 3.7m macOS 10.13+ x86-64

nfstream-3.0.4-cp36-cp36m-manylinux1_x86_64.whl (784.1 kB view details)

Uploaded CPython 3.6m

File details

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

File metadata

  • Download URL: nfstream-3.0.4-pp371-pypy3_71-manylinux1_x86_64.whl
  • Upload date:
  • Size: 784.1 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.2 PyPy/7.1.1beta

File hashes

Hashes for nfstream-3.0.4-pp371-pypy3_71-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8e092e6a4c5145276806b3c23015c6e256e0bf6703373bdd6626aec5670923c6
MD5 f73e42fbbc02ffe6ec01db6d05e0f94b
BLAKE2b-256 7cf4ee6060c43f67a1b13b2aa7710ba89395bdac06c4f8bb410d4678bed9cfbf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.4-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 784.1 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.2 CPython/3.8.0

File hashes

Hashes for nfstream-3.0.4-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6aa4e6b10233148a1c61534e5c63593d340a26d9f1cb4a5a35d1d819e05c58b3
MD5 4ce6ff92e25d5793cbdb2085d8a114c7
BLAKE2b-256 4a4cc8b605e2b5d65f4ad6858dc88b2364e193669d9d1ad7b21f1406094c9fbc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.4-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 784.1 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.2 CPython/3.7.1

File hashes

Hashes for nfstream-3.0.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ffc9e97a8dcd84a31610b2a26311755844bcab8b1e52c49cc40f42b26634c041
MD5 73e81984d8479929a8f4c7d507ebf9bf
BLAKE2b-256 7faebaf77cbdf0da3af0a68658cf98ab7a4db99cb74509257f1f8b20ad304ee2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.4-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 250.6 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.4-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 864cee3b7dd63663cf2bfb2d484f0a9d14ae0831c7e1127437df01b3390f182e
MD5 5728fc87e239e8850df3296f769225fc
BLAKE2b-256 77e2db526dc845915ddfbd17368a3b5aca1974016a9767ef734b371ed1c76be7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.4-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 250.0 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.2 CPython/3.7.4

File hashes

Hashes for nfstream-3.0.4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4eb9a7599c7e6bf26a72192121eb82e0cb4d4c45fd3ed14ba7d73b6441715844
MD5 78607f461fec926f6f7d1eddac0f86b5
BLAKE2b-256 60662060614490f77a2303947f27199663732112ab270d9ee0c89b805a595e7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.4-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 252.2 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.2 CPython/3.7.5

File hashes

Hashes for nfstream-3.0.4-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 659dc680ed74fb07c88b0c212e4e7ca2f5876cbc9dc1771a2cc530c67b00ca1c
MD5 441629498a7d14203154f9be80fd0575
BLAKE2b-256 c05aa673b117bdf5f9deccd834a7841c79d3fe0fa937b2b488e273241611de78

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.4-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 784.1 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.2 CPython/3.6.7

File hashes

Hashes for nfstream-3.0.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 01d51795ecfdbbc89e7ed3330ad2caa4293ca993457b005e7fbaae1d4d0e7e3f
MD5 925e4a04b020b775d1e1d1ec203a215b
BLAKE2b-256 947defc75ac03d6e6c025f5a26934db745d90a5d08a0202ac7c29276bed1a10a

See more details on using hashes here.

Supported by

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