一个用于解析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.2.tar.gz
(3.8 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.2.tar.gz.
File metadata
- Download URL: pypcaptools-1.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f005133ed59c0006d9ae55a7a3d670a30fc5f07519b486b3b4352722c5cc4c6
|
|
| MD5 |
0f38c5dc92bba9f29ebfef0b965cfdd9
|
|
| BLAKE2b-256 |
ba698a1f2c98220577b6cec3e0c1a38561f52835b986eeb358fd4a88c375a2a1
|
File details
Details for the file pypcaptools-1.2-py3-none-any.whl.
File metadata
- Download URL: pypcaptools-1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 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 |
6196c6848aa828c2e34d7e8fd2ff66e92d65e2885d7401296b4886addacba36e
|
|
| MD5 |
02513368f00bb084a910942dadb317fd
|
|
| BLAKE2b-256 |
ab8530d0db8741ba24b6fb9afac301dfb71dea7acbc4d7a7c75c1a04dff39734
|