Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

tcpdump

$ tcpdump Foundation High Risk
The Tcpdump Group · Browser & Web · BSD-3-Clause · macos / linux

tcpdump captures and decodes network packets matching Berkeley Packet Filter (BPF) expressions (tcpdump -i any -nn port 443 -w cap.pcap). While live interface capture requires elevated privileges, offline .pcap inspection (tcpdump -r cap.pcap -nn -c 20) runs unprivileged, fast, and non-interactively.

FCRS-1.0 Score
77 /100
Good
High Confidence
Zero-Friction Install
brew install tcpdump
CLI vs MCP Decision CLI Only

Reads local .pcap files and kernel BPF capture interfaces directly (tcpdump -r, tcpdump -c); MCP tools cannot inspect kernel packet streams.

Agent-Readiness Checklist

Local Probe Evidence
— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md
Version
tcpdump version 4.99.1 -- Apple version 161
Startup
8 ms
Exit Codes (help / invalid)
0 / 1
NO_COLOR Clean / Non-TTY Safe
Yes / Safe
Captured --help excerpt
tcpdump version 4.99.1 -- Apple version 161
libpcap version 1.10.1
LibreSSL 3.3.6
Usage: tcpdump [-AbdDefhHIJKlLnNOpqStuUvxX#] [ -B size ] [ -c count ] [--count]
		[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
		[ -i interface ] [ --immediate-mode ] [ -j tstamptype ]
		[ -M secret ] [ --number ] [ --print ] [ -Q in|out|inout|out|packet-metadata-filter ]
		[ -r file ] [ -s snaplen ] [ -T type ] [ --version ]
		[ -V file ] [ -w file ] [ -W filecount ] [ -y datalinktype ]
		[ --time-stamp-precision precision ] [ --micro ] [ --nano ]
		[ -z postrotate-command ] [ -Z user ] [ expression ]
		[ --apple-oneline] [ -g ]
		[ --apple-md-print (metadata_arg)] [ -k (metadata_arg)]
		[ --apple-pcapng] [ -P ]
		[ --apple-md-filter meta-data-expression] [ -Q meta-data-expression ]
		[ --apple-ext-fmt n ] [--apple-arp-plain]
		[ --apple-compression n ] [--apple-truncate] [--apple-pktapv2 ]
		[ --apple-head-drop ]

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 17 / 25

Deterministic BPF filtering, bounded -c <N> packet count, -nn clean numeric output, and -l line buffering, though output is plain text rather than JSON.

  • -c <N> bounds capture count; -nn suppresses DNS noise
  • Plain-text packet summaries; use tshark -T json for JSON
Trust & Safety 16 / 25

Offline -r reading is safe and unprivileged, but live capture requires root/sudo and exposes raw unencrypted payloads or secrets on the wire.

  • Live capture needs root/BPF access and captures sensitive traffic
Setup & Portability 13 / 15

Pre-installed on macOS (/usr/sbin/tcpdump) and nearly all Linux distributions; Windows requires separate WinDump/Npcap.

  • Built into macOS and standard Linux distros
Utility & Efficiency 13 / 15

Low-overhead standard for fast packet capture and BPF filtering prior to deeper tshark inspection.

  • Minimal CPU/memory footprint with kernel-level BPF filtering
Maintenance & Lineage 9 / 10

Maintained by The Tcpdump Group (the-tcpdump-group/tcpdump) under BSD-3-Clause.

  • Foundation-grade the-tcpdump-group/tcpdump repo
Docs & Verifiability 9 / 10

Canonical tcpdump(1) and pcap-filter(7) man pages plus --help.

  • Official man pages at tcpdump.org

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No authentication credentials required; live packet capture requires root/sudo or BPF device permissions.

Side Effects
Read-Only Local Write
Cost & Quotas

Free, BSD-3-Clause open-source C tool maintained by The Tcpdump Group.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# tcpdump Agent Rules
- Always pass `-c <count>` and `-nn` on live or offline runs so `tcpdump` terminates cleanly without slow DNS lookups.
- Use `tcpdump -r <file>` unprivileged for analysis; only invoke `sudo tcpdump` for live capture with explicit user approval and tight BPF filters.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect first 20 packets of an offline pcap file
tcpdump -r cap.pcap -nn -c 20

Reads cap.pcap without root privileges (-r), disables DNS/port name resolution (-nn), and stops after 20 packets (-c 20).

List available capture interfaces
tcpdump -D

Prints network interface names and indices recognized by libpcap.

Controlled Writes & Previews

Capture 50 loopback HTTPS packets to a pcap file
sudo tcpdump -i lo0 -nn -c 50 port 443 -w cap.pcap

Captures exactly 50 packets (-c 50) on loopback port 443 and writes them to cap.pcap.

Strengths for Agents

  • + Pre-installed on macOS and almost every Linux host with minimal overhead.
  • + -c <N> -nn makes bounded capture and offline .pcap inspection fast and deterministic.

Caveats & Pitfalls

  • ! No JSON output—pair with tshark -r cap.pcap -T json when structured dissection is needed.
  • ! Live packet sniffing requires sudo or BPF/network capture privileges.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI