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
.pcapfiles 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
--helpflag. - Maintainability: Modular, clean codebase for easy future expansion.
- Security: Only reads
.pcapfiles; 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
Show all the used protocols:
python -m analyser --file capture.pcapng --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
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_analyzer-0.1.2.tar.gz.
File metadata
- Download URL: pcap_analyzer-0.1.2.tar.gz
- Upload date:
- Size: 81.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ca218d734fb902e3cbf8870e8e29c19b3e49c65a4b1f1388b7a5b22ada65440
|
|
| MD5 |
8451fa6b0b42c7bf6449ce35ed682a4b
|
|
| BLAKE2b-256 |
a85651f14c75e52f4a76575c49269081669a604206ef1964b5deaa33c7e4b119
|
File details
Details for the file pcap_analyzer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pcap_analyzer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 77.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4ff3b92386a27510079cd22b8b0d0bffe80d5f890e3cc31295e7c3f1da05c94
|
|
| MD5 |
b3fb855624d43deae8e19bf7722c0965
|
|
| BLAKE2b-256 |
8f68b5ccc87eb6ba4704ede6c17b565ea9ba2d99ed21ea2b19f1c066e7fbace2
|