Skip to main content

pcap-anonymize

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 file
  • output: 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.

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
)

Metadata

Release files for pcap-anonymize 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pcap-anonymize 0.3.0
File Size Uploaded Provenance Actions
pcap_anonymize-0.3.0.tar.gz 8.8 kB Without provenance Details for pcap_anonymize-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pcap-anonymize 0.3.0
File Interpreter ABI Platform Actions
pcap_anonymize-0.3.0-py3-none-any.whl Python 3 none any Details for pcap_anonymize-0.3.0-py3-none-any.whl

Total release size: 19.0 kB

Release files / pcap_anonymize-0.3.0.tar.gz

Download URL pcap_anonymize-0.3.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2e668c9d1374878439b71c12fbfdba83873e30c92115d5a360f50b2b6c4b30a6
BLAKE2b-256 checksum
How to use checksums
5b49406e39f37d2474d7e683c5c894ff29b9cc030a3c83accd2dbacc0cb31b30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / pcap_anonymize-0.3.0-py3-none-any.whl

Download URL pcap_anonymize-0.3.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3cfd299fcf60a531cbdfd9c13c732d418167c209779c707d05942115b627173
BLAKE2b-256 checksum
How to use checksums
36dfe18125d80ca7835a5476f0ee1367308eabcc610cac1b1ee6d305a4805fe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for pcap-anonymize 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page