pcap-analysis

pcap-analysis is a skill for Claude Code, Codex from benchflow-ai/skillsbench. It costs 28 tokens per session (3,850 once invoked), scanned A, original, Apache-2.0.

A Python guide and helper library for analyzing PCAP files, which are recorded network packets. It includes methods for separating protocols, measuring traffic, and identifying patterns such as scans, denial-of-service activity, and beaconing.

In plain words
What is it for?
Use it to load packet captures, calculate flow and timing metrics, count IPs and ports, and inspect network behavior.
Why use it?
It saves you from reimplementing packet-processing details and helps avoid mistakes in common network statistics.

Skill for Claude CodeCodex

About the project

SkillsBench is a benchmark for measuring how effectively AI agents use modular skills—folders containing instructions, scripts, and resources—to complete specialized tasks. It helps researchers and developers evaluate both skill quality and agent behavior, including tasks that require combining multiple skills. The catalogue’s skills and instructions are evaluated as part of this workflow.

benchflow-ai/skillsbench · 1,747 stars · on GitHub · skillsbench.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/benchflow-ai/skillsbench/pcap-analysis
Any agent
npx skills add benchflow-ai/skillsbench --skill pcap-analysis
Clone the repo
git clone --depth 1 https://github.com/benchflow-ai/skillsbench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pcap-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/pcap-analysis.svg)](https://agentmods.dev/skills/benchflow-ai/skillsbench/pcap-analysis)
Your own site
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/pcap-analysis"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/pcap-analysis.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,850 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.03850
Opus 5 $0.00014 $0.01925
Sonnet 5 $0.00006 $0.00770
Haiku 4.5 $0.00003 $0.00385

Measured 2d ago against content hash 26c80622440b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

pcap-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (pcap_utils.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

tasks/dapt-intrusion-detection/environment/skills/pcap-analysis/SKILL.md · 485 lines

How it starts

The opening of the file, as written. The whole thing — 485 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PCAP Network Analysis Guide

This skill provides guidance for analyzing network packet captures (PCAP files) and computing network statistics using Python.

Quick Start: Using the Helper Module

A utility module (pcap_utils.py) is available in this folder with tested, correct implementations of common analysis functions. It provides some utility functions to count intermediate results and help you come to some of the conclusion faster. Use these functions directly rather than reimplementing the logic yourself, as they handle edge cases correctly.

# RECOMMENDED: Import and use the helper functions
import sys
sys.path.insert(0, '/root/skills/pcap-analysis')  # Add skill folder to path
from pcap_utils import (
    load_packets, split_by_protocol, graph_metrics,
    detect_port_scan, detect_dos_pattern, detect_beaconing,
    port_counters, ip_counters, iat_stats, flow_metrics,
    packets_per_minute_stats, producer_consumer_counts, shannon_entropy
)

packets = load_packets('/root/packets.pcap')
parts = split_by_protocol(packets)

# Graph metrics (indegree/outdegree count UNIQUE IPs, not packets!)
g = graph_metrics(parts['ip'])
print(g['max_indegree'], g['max_outdegree'])

# Detection functions use STRICT thresholds that must ALL be met
print(detect_port_scan(parts['tcp']))      # Returns True/False
print(detect_dos_pattern(ppm_avg, ppm_max)) # Returns True/False
print(detect_beaconing(iat_cv))             # Returns True/False

The helper functions use specific detection thresholds (documented below) that are calibrated for accurate results. Implementing your own logic with different thresholds will likely produce incorrect results.

Overview

Network traffic analysis involves reading packet captures and computing various statistics:

  • Basic counts (packets, bytes, protocols)
  • Distribution analysis (entropy)
  • Graph/topology metrics
  • Temporal patterns
  • Flow-level analysis

Reading PCAP Files with Scapy

Scapy is the standard library for packet manipulation in Python:

Read the full file on GitHub · 485 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 485 lines · 28 tokens per session scan A 26c80622440b

Subscribe to this mod's changes

pcap-analysis is a skill published in the GitHub repository benchflow-ai/skillsbench (1,747 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 28 tokens to every session and 3,850 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.