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

Uploaded CPython 3.8

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

Uploaded CPython 3.7m

nfstream-3.0.3-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.3-cp37-cp37m-macosx_10_14_x86_64.whl (249.9 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

nfstream-3.0.3-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.3-cp36-cp36m-manylinux1_x86_64.whl (784.1 kB view details)

Uploaded CPython 3.6m

File details

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

File metadata

  • Download URL: nfstream-3.0.3-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.3-pp371-pypy3_71-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7cfda57e3b7476fbb56635d9ad1713a470f32e8f46b78e96a196339064e7ca63
MD5 e8260775d65a4121b4645c9fe03d085c
BLAKE2b-256 b4478919de55099008f049caa367c171663950aa355b8c98c521b7155a159875

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.3-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.3-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fb2004b1e53b919908c5752e35ae4a2127d6d854836b484ac199b4027abc07ae
MD5 111a5e2f541e4b15b3e19cf5c6fa4b12
BLAKE2b-256 7efcafcaa819b167a4b1f15d332ef82674f16fc08812b302a3038091fed0ed77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.3-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.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 51162a69aae1076d91b03a5e321a984f8e1141421a0ca38ebeb67cf298058967
MD5 5ade2df49c4b8d87cc82dfa0a346af36
BLAKE2b-256 c38e4c716c62e8a6ca9fce71db7c655603bff91fb40e618e19ec50715514255b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.3-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.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2a2b97f7e6aa9fee4763b75b57e4f1882286d6d418ae7c1200e3f7f8d26b807a
MD5 b56ae3925b986cb5f0d4314a8d0d4875
BLAKE2b-256 3e1a390565932fc138badc4f7027fa038b611d9e4626f1faaee61cd94b1c5957

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.3-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 249.9 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.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 beb4fa1bed67755558c172f87ba781364ce6d6aca86b3faf6107d22ebef38114
MD5 d43cf110c0f0db75f35794ec5b12ae8e
BLAKE2b-256 655cdc42ce85105b00da6650e81417608f1c7bdb67d624d0aba92c62a3bf7600

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.3-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.3-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 1274a7a51dff0d0eb122e878b40da55b6d955869f1776cfac977967284bf9179
MD5 89e4703420c75c75e6aeade3a2f076dd
BLAKE2b-256 5689595c9aa5f012b452ee6155baa9cafeff9ccad8abbccb52be00ed43c6455e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nfstream-3.0.3-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.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4d74e207d29851dbd2eb762c9651cf03d0cb393214bab30114f4015ae59abe26
MD5 cf437e8267cdd9329fb2cf47e4a189e0
BLAKE2b-256 c937403908ac50ca3914a72f3961faf7cef252d77f7465e39d6a50c850fb5cae

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