一个用于解析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.1.tar.gz
(3.7 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.1.tar.gz.
File metadata
- Download URL: pypcaptools-1.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8ece90d77b53f4e2b7ae7c5900d41f92671f11b5341f1ad43351eca018f23ba
|
|
| MD5 |
3025cc9cfc5e5f5846276eeb151129e2
|
|
| BLAKE2b-256 |
be712ac88a3a175dabac2af4115aa7885c9491ba0306a1d848f4bfa6a88175a2
|
File details
Details for the file pypcaptools-1.1-py3-none-any.whl.
File metadata
- Download URL: pypcaptools-1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 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 |
df93248ee58d9ef79a3d4a92a4639e3f420f6862d21c85068822f4dcb648a1cd
|
|
| MD5 |
06dbb61762390b89452b8a2104af2ee0
|
|
| BLAKE2b-256 |
c18180495127dbf5da281ae205846d0e8dc76e6d55ad0565f081e5658e759990
|