A flexible and powerful network data analysis library
Project description
nfstream is a flexible and lightweight network data analysis library.
nfstream main features
Performance: nfstream was designed to be fast with a small CPU and memory footprint.
Layer-7 visibility: nfstream dissection is based on nDPI (~300 applications including Tor, Messenger, WhatsApp, etc.).
Flexibility: add a flow metric in 2 lines of code using nfstream plugins method.
Machine Learning oriented: add your trained model as an NFStreamClassifier.
Use
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.streamer import Streamer
my_capture_streamer = Streamer(source="instagram.pcap") # or capture from a network interface
for flow in my_capture_streamer: # or for flow in my_live_streamer
print(flow) # print, append to pandas Dataframe or whatever you want :)!
Didn’t find a specific flow feature? add a plugin to the Streamer in few lines:
def my_awesome_plugin(packet_information, flow, direction):
if packet_information.length > 666:
return flow.metrics['count_pkts_gt_666'] + 1
streamer_awesome = Streamer(source='devil.pcap', user_metrics={'count_pkts_gt_666': my_awesome_plugin})
for export in streamer_awesome:
print(export.metrics['count_pkts_gt_666']) # now you will see your created metric in generated flows
More example and details are provided on the official Documentation.
Getting Started
Prerequisites
apt-get install python-dev install pypy3-dev libpcap-dev
Installation
using pip
Binary installers for the latest released version are available:
pip3 install nfstream
from source
If you want to build nfstream on your local machine:
apt-get install autogen
git clone https://github.com/aouinizied/nfstream.git
# move to nfstream directory and run
python3 setup.py install
Contributing
Please read Contributing for details on our code of conduct, and the process for submitting pull requests to us.
License
This project is licensed under the GPLv3 License - see the License file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file nfstream-1.1.4-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: nfstream-1.1.4-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 692.0 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dbc6cb9f58d37ce8a537aef3b5a0c564bb79189f5bed1ba7b80ba106c0092f7 |
|
MD5 | 3d51f3b7b6fb101d180e248d3bc67e9d |
|
BLAKE2b-256 | b4922521415f56a7207ca15bebc6e7d77575eaf479065e55e78314caa69fac8f |
File details
Details for the file nfstream-1.1.4-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: nfstream-1.1.4-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 692.0 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1fb143c7bc5ce1931e4ef342a89dff07878f5d4189fe0f1364713ffb894946e |
|
MD5 | d4db03817ddeeecb0d5a7a8570c0c421 |
|
BLAKE2b-256 | e625b60c6af5209221de74352edbc503c395312079079cc39e7261f12f55049a |
File details
Details for the file nfstream-1.1.4-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: nfstream-1.1.4-cp37-cp37m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 219.5 kB
- Tags: CPython 3.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f31863657ccec92cce458beeff3644162580b667292c6a9ff038eed2283bc8e |
|
MD5 | 2a48e35914fc21345430587caa651515 |
|
BLAKE2b-256 | da7acdf1e8436ffdbad9766e398d4f841fdbbe86f56c041c9d6eb9c93f401c9d |
File details
Details for the file nfstream-1.1.4-cp37-cp37m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: nfstream-1.1.4-cp37-cp37m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 221.6 kB
- Tags: CPython 3.7m, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 692a25b574ccb50c47ed46577088a9edad12029b58ce78813597b6be2f183c64 |
|
MD5 | 6f16bf177d05c532042d22073869a82a |
|
BLAKE2b-256 | 3eb907ca3d905dc4cede78c0dcec25d5bef17bfb93dd534a5433a9e0659bcddc |
File details
Details for the file nfstream-1.1.4-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: nfstream-1.1.4-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 692.0 kB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56bc6971a2a91cd765b42dc666c53fdc9673c6b2fcf4d38a665781c2ae46348b |
|
MD5 | 70422fbe4dc8ca0cec0f5c5a7864a1f4 |
|
BLAKE2b-256 | e227fb35b1b157114c5493c80b81346489f21f3f454cd535e6105cd68cdc50f5 |
File details
Details for the file nfstream-1.1.4-cp36-cp36m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: nfstream-1.1.4-cp36-cp36m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 220.0 kB
- Tags: CPython 3.6m, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5af6baef3a0fe15493bfdd929c6db8123c72dfe1d952e226ca4329836ff2f7a |
|
MD5 | 222357750fb73788878fe637f70d629f |
|
BLAKE2b-256 | 4f486447da50825e1fba3dd695b4cfffb0f38621a6d18ff821f09ac5b8498510 |
File details
Details for the file nfstream-1.1.4-cp27-cp27m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: nfstream-1.1.4-cp27-cp27m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 219.5 kB
- Tags: CPython 2.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c2a2c0cf8f77a15e210e0ff6037267580fb90447a19a9deb942aa39d77e7963 |
|
MD5 | 0b0e1a93e9ac83ec1157463685acfb12 |
|
BLAKE2b-256 | 9e43cef3072f666ef0176eaad3b8862205048e6649d10a721e03c68d33982d05 |
File details
Details for the file nfstream-1.1.4-cp27-cp27m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: nfstream-1.1.4-cp27-cp27m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 220.0 kB
- Tags: CPython 2.7m, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 633cad63f2148443b9ed3919470205a17fe0a3800058d57e922e507e095ef635 |
|
MD5 | dcb17371b588488f9783fb110f9eb09d |
|
BLAKE2b-256 | b6bc71575122684d63006c9901db8bfc71b2efa02163856074326d43a16dbecc |