Skip to main content

Cap: lightweight package for use network captures

Project description

Cap: lightweight package for use network captures

PyPI version PyPI downloads GitHub PyPI - Python Version

The idea is to read and write capture files like it is really a serialized data. The API is ment to be close as possible to json and pickle APIs.

Installation:

install the package by:

pip install cap

or from the source:

python setup.py install

Usage:

read cap:

import cap
captured_packets = cap.load(open("C:\\test.cap", "rb"))

filter about somthing

ip_v4_captured_packet = []
for captured_packet in captured_packets:
    if captured_packet.data[12:14] == '\x08\x00':
        ip_v4_captured_packet.append(p)

dump filtered packets

cap.dump(ip_v4_captured_packet, open('C:\\new_test.cap', "wb"))

Have a nice use and please report about problems and issues. Thank you.

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

cap-0.1.4.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

cap-0.1.4-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

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