Skip to main content

一个用于解析pcap文件的python库

Project description

pypcaptools介绍

pypcaptools 是一个用于处理pcap文件的 Python 库,可以实现以下功能:

  1. 将流量按照session进行分隔,可以输出pcap格式或json格式。

安装

pip install pypcaptools

Quick Start

from pypcaptools import PcapHandler

origin_pcap = "/path/dir/filename"

ph = PcapHandler(origin_pcap)
output_dir = "/path/dir/output_dir"

# 分流之后以pcap格式输出,TCP流允许从中途开始(即没有握手过程)
ph.split_flow(output_dir, tcp_from_first_packet=False, output_type="pcap")

# 分流之后以json格式输出,输出一个json文件,其中每一个单元表示一条流,TCP流必须从握手阶段开始,从中途开始的TCP流会被丢弃
ph.split_flow(output_dir, tcp_from_first_packet=True, output_type="json")

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

pypcaptools-1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

pypcaptools-1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pypcaptools-1.0.tar.gz.

File metadata

  • Download URL: pypcaptools-1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pypcaptools-1.0.tar.gz
Algorithm Hash digest
SHA256 4f378305b3d9f7a4fef9109f95e0e12edc73f5f6cc10d92ae5cd335d6a505bf8
MD5 8e8c2092bba64f8f9e83970abc367ad5
BLAKE2b-256 4c13ec221417a23fbd21dce32f20d2a3bca6f8e428c35c99c3d8265556a50774

See more details on using hashes here.

File details

Details for the file pypcaptools-1.0-py3-none-any.whl.

File metadata

  • Download URL: pypcaptools-1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pypcaptools-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3bfbc7b3bd0d40133aed8b44d851dbbde456b201491bcc09f5b8dbb09d3e665
MD5 8d5e4b7ea82dae6f785250c617be8aa0
BLAKE2b-256 b1c116dd93cc058afec95100fd64240e197e363f06f296188e7302e88b6a8c90

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