PcapAnalyzer – 自托管 pcap 分析器,含 27 个问题检测器
PcapAnalyzer – self-hosted pcap analyzer with 27 problem detectors

原始链接: https://github.com/sebaandrada-cell/PcapAnalyzer

PcapAnalyzer 是一个免费、开源、可自托管、本地运行的网络抓包分析器(Apache 2.0,测试版)。它使用 27 个检测器分析 `.pcap`/`.pcapng` 文件,覆盖 TCP、路径、DNS/DHCP/ARP、应用、隧道和安全问题,以及抓包质量警告。它提供 Wireshark 风格视图、表格、响应时间、流程图、可选的使用你自己的 Anthropic 密钥的 AI 调查,以及 PDF 报告。它支持英语/西班牙语和浅色/深色主题。可通过 Docker Compose 或 Python/Node/tshark 运行,然后使用生成的令牌在本地访问。抓包保留在你的机器上,并在空闲后或按需删除;AI 只能看到工具结果。后端和前端都有测试。欢迎通过 GitHub issues 反馈,但不要附带敏感抓包。tshark/Wireshark 单独使用,不随 PcapAnalyzer 分发。

PcapAnalyzer 是一款自托管的 Python pcap 分析器,内置 27 个问题检测器,近日在 Hacker News 上受到关注。评论将其与基于 LLM 的“doctor”脚本以及 CableLabs 类似的 PNM 工作进行比较,还有用户推荐 PacketSnitch 作为替代方案。讨论的问题包括 AI 功能是否会脱敏敏感捕获数据、是否可在 uv 环境而非 Docker 中运行,以及它解决什么问题。一位评论者解释了 pcap 抓包及自动化检测如何帮助缺乏深厚协议知识的用户;另一位则认为用户可能更偏好集成到现有 LLM 工具中的 MCP 或技能插件。
相关文章

原文

Versión en español: README.es.md.

Find the network fault in seconds, not hours. Upload a .pcap / .pcapng capture (gzip too) and PcapAnalyzer tells you what is failing, why, and what to check next. It runs on your own machine, so captures never leave your network.

Free and open source (Apache 2.0). Status: beta.

  • 27 detectors that run on every capture, each with a severity and a next step:
    • TCP: firewall blocks (SYN→RST), retransmissions, duplicate ACKs, loss and reordering, zero and full windows, resets after the handshake, slow handshakes.
    • Path: PMTUD black holes, low MSS, IP fragmentation, ICMP errors, routing loops.
    • Name and address services: unanswered or slow DNS, SERVFAIL, NXDOMAIN bursts, DHCP NAK / DECLINE / no answer, duplicate IPs, ARP storms.
    • Applications: HTTP 4xx / 5xx and slow responses, TLS alerts, SSL 3.0 / TLS 1.0 / 1.1.
    • Tunnels: IPsec (IKE and ESP), WireGuard, OpenVPN, GRE, L2TP and Teredo that are one-way, never answer a handshake or keep renegotiating.
    • Security: port scans and sweeps, cleartext logins (FTP, POP3, IMAP, SMTP AUTH, HTTP Basic; credentials are never stored or shown), Telnet / SMBv1 / SNMP v1-v2c, ARP spoofing, overlapping IP fragments.
  • Capture quality first. It warns when the capture itself limits the result: frames duplicated by a mirror port, traffic seen in one direction only, truncated packets, connections already open when the capture started.
  • Wireshark-style views: packet list with real Wireshark display filters over the whole capture, colouring, CSV export, expert info, HTTP / DNS / DHCP / TLS tables, response times and a flow diagram per conversation.
  • AI investigation (optional): an AI investigates the capture with tools (real filters, stream detail, statistics) and cites the packets behind every claim. You can then ask follow-up questions. It uses your own Anthropic API key; without one, a demo mode runs the full flow with text generated from the analysis, at no cost.
  • PDF report, Spanish and English interface, light and dark theme.

You need Docker with Docker Compose. On Windows, run the script from Git Bash or WSL.

git clone https://github.com/sebaandrada-cell/PcapAnalyzer.git
cd PcapAnalyzer
./start.sh

The script creates a random access token (shown once, stored in .env) and starts the app. When the build finishes, open http://localhost:8080, paste the token into the "API token" field (top right) and upload a capture, or click "Try the sample capture".

The app listens on 127.0.0.1 only. Do not expose it on a network without an authenticated reverse proxy: the API can use your AI account. QUICKSTART.md has the details, the AI setup and troubleshooting.

You need Python 3.9+, Node 20+ and tshark (installed with Wireshark).

cd backend
python3 -m venv .venv
.venv/bin/pip install -r requirements-dev.txt
export API_TOKENS="$(openssl rand -hex 32)"
.venv/bin/uvicorn app.main:app --reload
cd frontend
npm install
npm run dev

Open http://localhost:5173 and paste the same token. If tshark is not on your PATH, set TSHARK_PATH to the binary.

  • The capture is analysed on your machine. While an AI investigation lasts it is kept encrypted (60 minutes of inactivity, or until you press "Delete capture now") and is then deleted.
  • The AI is optional. It only sees what its tools return (packet metadata; packet content only if you switch it on for that session), never the pcap file.
  • No telemetry and no accounts for the self-hosted version.
cd backend && .venv/bin/python -m pytest -q    # needs tshark
cd frontend && npm test

PcapAnalyzer is a beta. It has been tested with synthetic fixtures and public sample captures, and the most useful feedback is a capture where it misses a problem or reports one that is not real. Please open an issue at https://github.com/sebaandrada-cell/PcapAnalyzer/issues and describe the case. Do not attach captures that contain real credentials or customer data; anonymise them first or describe the pattern.

The technical reference (JSON schema, detector thresholds, limits, API errors) is in README.es.md, in Spanish.

Apache License 2.0. See NOTICE for third-party software: tshark / Wireshark (GPL) runs as a separate program and is not distributed with PcapAnalyzer.

联系我们 contact @ memedata.com