pcap

pcap is a command for Claude Code from pashki975/thm-claude-kit. It costs 21 tokens per session (1,451 once invoked), scanned B, original, MIT.

A command for investigating network-capture files with tshark, the terminal version of Wireshark. A capture records network packets, either from a past session or from a live interface.

In plain words
What is it for?
Use it to capture traffic, identify protocols and conversations, and extract likely credentials, transferred files, attack evidence, or other answers from PCAP and PCAPNG files.
Why use it?
It starts with a traffic overview so you can focus on the relevant protocol or conversation instead of dumping and searching every packet. Targeted extraction makes investigations easier to follow.

Command for Claude Code

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 commands/pashki975/thm-claude-kit/pcap
Clone the repo
git clone --depth 1 https://github.com/pashki975/thm-claude-kit

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/pashki975/thm-claude-kit/pcap.svg)](https://agentmods.dev/commands/pashki975/thm-claude-kit/pcap)
Your own site
<a href="https://agentmods.dev/commands/pashki975/thm-claude-kit/pcap"><img src="https://agentmods.dev/badge/commands/pashki975/thm-claude-kit/pcap.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,451 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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 $0.00021 $0.01451
Opus 5 $0.00010 $0.00726
Sonnet 5 $0.00004 $0.00290
Haiku 4.5 $0.00002 $0.00145

Measured 4d ago against content hash 17a1bce4df01, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

pcap scanned grade B with 1 finding 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 4d ago.

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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- `sudo tshark -i <interface> -w scans/capture.pcap` (Ctrl-C to stop), then analyze that file.
.claude/commands/pcap.md · 80 lines

How it starts

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

Analyze traffic for: $ARGUMENTS Expected: a path to a .pcap/.pcapng file, OR "live " to capture first.

tshark is the CLI of Wireshark, so I can actually drive it. Work the same cheap→heavy way as the enum commands: get the overview first, form a hypothesis about what the room wants, THEN run the targeted extraction — don't blindly dump every packet. (The network-forensics skill has the methodology — how to think about a capture; this command has the tshark mechanics.)

The gate

Before a heavy extraction (carving all files, exporting every object, following hundreds of streams), say a one-line hypothesis about what the room is asking for (a credential? a transferred file? a specific conversation? evidence of an attack?) and let the overview point you at it. The protocol breakdown usually tells you where the answer lives — go there, don't grep the whole capture blindly.

0. Live capture first (only if $ARGUMENTS starts with "live")

  • sudo tshark -i <interface> -w scans/capture.pcap (Ctrl-C to stop), then analyze that file.
  • Or capture with a filter: sudo tshark -i <interface> -f "port 21 or port 80" -w scans/capture.pcap

1. CHEAP overview — always do these first

  • Protocol hierarchy (what's even in here): tshark -r <file> -q -z io,phs
  • Conversations (who talked to whom, volumes): tshark -r <file> -q -z conv,ip
  • Top talkers / endpoints: tshark -r <file> -q -z endpoints,ip
  • A quick skim of the first packets: tshark -r <file> -c 50 Read these and form the hypothesis before digging.

2. Credential & data extraction (gate to what the overview suggests)

  • Cleartext creds (HTTP/FTP/Telnet/POP/IMAP/SMTP): filter to the protocol and read it, e.g. tshark -r <file> -Y "http.request.method==POST" -T fields -e http.file_data tshark -r <file> -Y "ftp.request.command==USER || ftp.request.command==PASS" -T fields -e ftp.request.arg tshark -r <file> -Y "telnet" -T fields -e telnet.data (creds typed char-by-char — follow the stream) tshark -r <file> -Y "pop.request.parameter || imap || smtp.req.parameter" (mail auth) tshark -r <file> -Y "snmp" -T fields -e snmp.community (SNMP community strings = creds) HTTP Basic-Auth: the Authorization header is base64 — decode it.
  • Follow a specific TCP/UDP stream once you know which one: tshark -r <file> -q -z follow,tcp,ascii,<stream-number>
  • Search everything for a token when you must: tshark -r <file> -Y 'frame contains "flag"'
  • DNS queries (exfil / C2 hints): tshark -r <file> -Y dns -T fields -e dns.qry.name | sort -u
  • HTTP objects (URLs, user-agents, hosts): tshark -r <file> -Y http.request -T fields -e http.host -e http.request.uri

Read the full file on GitHub · 80 lines

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. 4d ago First seen · 80 lines · 21 tokens per session scan B 17a1bce4df01

Subscribe to this mod's changes

pcap is a command published in the GitHub repository pashki975/thm-claude-kit (2 stars, last pushed 21d ago), licensed MIT. It adds 21 tokens to every session and 1,451 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.