Anonymize PCAP files
Project description
pcap-anonymization
This Python package reads PCAP files, and produces anonymized versions of the given files. More precisely, the following fields are anonymized:
- Ethernet
- Source MAC address
- Destination MAC address
- ARP
- Source hardware address
- Destination hardware address
- DHCP
- Client hardware address
- Client Identifier option
- HTTP
- All fields are removed, except the method and URI path.
- Request parameters are removed
- CoAP
- All fields are removed, except the type, code, and URI path.
- TP-Link Smart Home protocol (TCP port 9999)
- The TCP payload is removed.
Installation
Dependencies
Retrieve from PyPI
pip install pcap-anonymize
Usage
CLI
pcap-anonymize [-i input] [-o output] [-d dir]
The program can be used either with a single input PCAP file, or a directory containing multiple PCAP files.
Options for the former case are the following:
input: path to a single input PCAP fileoutput: path to a single output file.- If not specified, a new file is created in the same directory as the input file, with the name
<input>.anon.pcap.
- If not specified, a new file is created in the same directory as the input file, with the name
In the latter case, only the directory containing the PCAP files is provided.
For each PCAP file, its corresponding, anonymized output file will be created in the same directory,
with the suffix anon.pcap.
If no option is provided, the program stops directly.
Library
Single input/output file
from pcap_anonymize import anonymize_pcap
anonymize_pcap(
input: os.PathLike,
output: os.PathLike = None
)
Directory
from pcap_anonymize import anonymize_pcaps_in_dir
anonymize_pcaps_in_dir(
dir: os.PathLike
)
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
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 pcap_anonymize-0.2.0.tar.gz.
File metadata
- Download URL: pcap_anonymize-0.2.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c764fae27cea7e2a925f9e10b7d518fdb3d2cb6e8d3a1537bef78b0414625e9e
|
|
| MD5 |
8eeac331599dd08701e356bf0997bc3d
|
|
| BLAKE2b-256 |
413b1281baea6b6d27f226da834a99abde2b19f85f2269912f3e047c4e146116
|
File details
Details for the file pcap_anonymize-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pcap_anonymize-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
814e28088b0938348507d9d84e6a8407d8d1f5f37752037d3bac0f6997380be4
|
|
| MD5 |
50cbe3a1981cd15f1a5925de29df79be
|
|
| BLAKE2b-256 |
68efb6edae4c30a42bf4d9d0447f207c3feef27f61a7745b2ae9fa944f0a9981
|