Skip to main content

A lightweight CLI tool for analyzing pcap files

Project description

PCAP Analyzer

This project is a lightweight, simple CLI tool written in Python designed to analyse .pcap files and offer insight in the network traffic without the overhead of full packet inspections.


Introduction

Network administrators often need to quickly analyze .pcap files to understand traffic patterns, protocol usage, and network performance. Tools like Wireshark offer deep inspection but can be heavy and overkill for simple summaries.

PCAP Analyzer fills this gap by offering a lightweight, scriptable CLI tool that provides essential network insights without the overhead.

Features

Option Description
--printall Shows all IP traffic as source → destination.
--showprotocols Displays the number of packets per IP protocol (such as TCP, UDP, ICMP).
--toptalkers Shows the top 5 most active sending IP addresses.
--throughput Calculates total throughput in Mbps over the duration of the capture.
--data_packet_rtt Measures average latency (RTT) between data packets and their ACKs.
--extract_dns_domains Lists unique domains queried via DNS.

Non-functional Specifications

  • Performance: Analyze .pcap files up to 100MB in under 5 seconds on modern hardware.
  • Platform Support: Compatible with Windows, Linux, and macOS; requires Python 3.8 or higher.
  • Usability: Simple CLI with one-command execution; help available via --help flag.
  • Maintainability: Modular, clean codebase for easy future expansion.
  • Security: Only reads .pcap files; no packet modification or network interaction.

Installation

Gitlab

Clone the repository:

git clone https://gitlab.fdmci.hva.nl/schiffd/pcap-analyzer
cd pcap-analyzer

Requirements

Install dependencies:

pip install -r requirements.txt

Or with UV:

uv pip install .

Include optional dependencies:

uv pip install .[dev]

Usage

Run:

python -m analyser --file <path/to/file.pcapng> [options]

Examples

Show the toptalkers (most active IP addresses):
python -m analyser --file capture.pcapng --toptalkers

Demo --showprotocols

Show all the used protocols:
python -m analyser --file capture.pcapng --showprotocols

Demo --showprotocols

License

This project is licensed under the MIT License - see the LICENSE file for details.


Author

Daniël Schiffers
Amsterdam University of Applied Sciences
📧 daniel.schiffers@hva.nl

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

pcap_analyzer-0.1.1.tar.gz (81.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pcap_analyzer-0.1.1-py3-none-any.whl (78.0 kB view details)

Uploaded Python 3

File details

Details for the file pcap_analyzer-0.1.1.tar.gz.

File metadata

  • Download URL: pcap_analyzer-0.1.1.tar.gz
  • Upload date:
  • Size: 81.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pcap_analyzer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 85e4dac4e154d8ca25c66839ba59c4d7a395326aa77a679dfc6b9ae71fbe851a
MD5 f119513982032741675481415d886c86
BLAKE2b-256 79c6514541299c0d43ff038fed27ecee147dcb5d8441079b4d1102c33e0c4407

See more details on using hashes here.

File details

Details for the file pcap_analyzer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pcap_analyzer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 78.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pcap_analyzer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4117e1da7b7aa4d9cf6a1033955a6fac0a8f71b904a0399b09cee9bc1a40c6e1
MD5 bfb6d921eb0b2a6edc25d287edd74844
BLAKE2b-256 a0d783d92db88ec5b60577446edda914a766a782debaa89a928dbd7292aa8b83

See more details on using hashes here.

Supported by

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