Skip to main content

A set of Python scripts to manipulate PCAPNG files

Project description

PCAPNG to HAR Converter

Python-based tool for converting PCAPNG files to HAR files.

License: GPLv3 and MIT

Website | Support

Overview

This project is a Python-based tool for converting PCAPNG files to HAR files. It supports both HTTP/1.1 and HTTP/2 protocols.

Requirements

  • Python 3.11+
  • tshark (part of the Wireshark suite; requires version >= 4.0)

Installation

  1. Install Python 3.11 or higher.
  2. Install tshark from the Wireshark suite.
  3. Clone this repository:
git clone <repository_url>
cd <repository_directory>
  1. Install the required Python packages:
pip install -r requirements.txt

Usage

Prior to using this converter, please have a look at documentation on how to convert .pcap to .pcapng

Shell

Run ./pcapng_to_har.py [-h] in your shell (with your Python virtual environment activated)

Python

from pcapng_to_har import pcapng_to_har, Tshark
def pcapng_to_har(
    input_file: Path | str,
    output_file: Path | str | None = None,
    *,
    tshark: Tshark | None = None,
    socket_operations_file: Path | str | None = None,
    cryptography_operations_file: Path | str | None = None,
    overwrite: bool = False,
    **json_dump_kws: Any,
) -> None:

Licensing

This work is licensed under multiple licences:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pcapng_utils-1.0.1.tar.gz (32.1 kB view hashes)

Uploaded Source

Built Distribution

pcapng_utils-1.0.1-py3-none-any.whl (36.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page