一个用于解析pcap文件的python库
Project description
pypcaptools介绍
pypcaptools 是一个用于处理pcap文件的 Python 库,可以实现以下功能:
- 将流量按照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
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 Distribution
pypcaptools-1.0.tar.gz
(3.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f378305b3d9f7a4fef9109f95e0e12edc73f5f6cc10d92ae5cd335d6a505bf8
|
|
| MD5 |
8e8c2092bba64f8f9e83970abc367ad5
|
|
| BLAKE2b-256 |
4c13ec221417a23fbd21dce32f20d2a3bca6f8e428c35c99c3d8265556a50774
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3bfbc7b3bd0d40133aed8b44d851dbbde456b201491bcc09f5b8dbb09d3e665
|
|
| MD5 |
8d5e4b7ea82dae6f785250c617be8aa0
|
|
| BLAKE2b-256 |
b1c116dd93cc058afec95100fd64240e197e363f06f296188e7302e88b6a8c90
|