Skip to main content

CICFlowMeter V3 Python Implementation

Project description

Python CICFlowMeter (PyFlowmeter)

This project is cloned from Python Wrapper CICflowmeter and customized to fit my need. Therefore, it is not maintained actively. If there are any problems, please create an issue or a pull request.

Installation

pip install --upgrade pip
pip install pyflowmeter

Usage

from pyflowmeter.sniffer import create_sniffer

This function returns a scapy.sendrecv.AsyncSniffer object.

Parameters

  • input_file [default=None]

    • A .pcap file where capture offline data from. If it is set to ´None´, the data will be capture from input_interface
  • input_interface [default=None]

    • Interface or list of interfaces (default: None for sniffing on all interfaces).
  • server_endpoint [default=None]

    • A server endpoint where the data of the flow will be sent. If it is set to None, no data will be sent.
  • verbose [default=False]

    • Wheather or not to print a message when a new packet is read.
  • to_csv [defalut=Fasle]

    • Wheather or not to save the output flows as csv. The data will be saved on output_file.
  • output_file [default=None]

    • File to store the data. If to_csv is set to False, this parameter will be ignored.

Examples

Sniff packets real-time from interface and send the flow to a server (need root permission):

from pyflowmeter.sniffer import create_sniffer

sniffer = create_sniffer(
            server_endpoint='http://127.0.0.1:5000/send_traffic',
            verbose=True
        )

sniffer.start()
try:
    sniffer.join()
except KeyboardInterrupt:
    print('Stopping the sniffer')
    sniffer.stop()
finally:
    sniffer.join()

Project details


Download files

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

Source Distribution

pyflowmeter-0.2.3.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyflowmeter-0.2.3-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file pyflowmeter-0.2.3.tar.gz.

File metadata

  • Download URL: pyflowmeter-0.2.3.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.4

File hashes

Hashes for pyflowmeter-0.2.3.tar.gz
Algorithm Hash digest
SHA256 076a1a6c6ecbc52f6a259094d2d252dc59f3c8e075b94e3ff5217e304c35f0dc
MD5 174be7cd534ebc2f9b81c31b037bbd8e
BLAKE2b-256 c012a6ebef293b0d5deea652d33de00c30dd42b943598c7f173fbf227d562015

See more details on using hashes here.

File details

Details for the file pyflowmeter-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: pyflowmeter-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.4

File hashes

Hashes for pyflowmeter-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6a51b1665794b1f462759858945df0fad6d7cbdc96e7d51f60a3c357b7297cab
MD5 4b3ffc9e6b421caa55592242ffa2110a
BLAKE2b-256 be29ac1d34572b888a06f391789206dc03ed0b68bcd4f67b37fe6ea505ca81e2

See more details on using hashes here.

Supported by

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