Token导航 LogoToken导航TokenDH.com
fireshark (Hendrik Reh) logo
安全风控未说明官方级别未说明来源级核验

fireshark (Hendrik Reh)

MCP Server

Fireshark是一款专为LLM和人类设计的网络数据包分析工具,提供Rust原生协议解析、AI驱动的安全审计和彩色CLI直接分析功能。

工具数

19

提示词数

0

GitHub Stars

1

资源数

0
安全审计RustClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

HendrikReh

提供方

HendrikReh

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

Fireshark

](<>) ![Rust](https://www.rust-lang.org/) ![Tests](<>) ![Status](<>)

为LLM和人类构建的数据包分析器。Rust原生协议解析,使用MCP服务器进行AI驱动的安全审计,使用颜色编码的CLI进行直接分析。

目录

电梯演讲

Fireshark通过结构化MCP工具调用,为LLM提供了与人类分析师从Wireshark获得的分析工具包相同的分析工具包——数据包查询、协议解码、显示过滤器、流跟踪、流重组、证书提取、查找升级和安全审计启发式。对于人类来说,这是一个快速的、颜色编码的CLI,有9个命令,可以解码11个协议,遵循TCP/UDP对话并重新组装有效载荷,运行8个自动安全检查,验证校验和(IPv4和IPv6),并将结果导出为JSON。一切都是库优先:一个Rust工作区,8个crates,508个测试,零不安全代码。

当tshark存在时,为什么会有本土解剖者?

Fireshark船只都是因为它们解决了不同的问题。

tshark 覆盖引擎:它使Fireshark能够访问Wireshark非常广泛的协议支持、成熟的流重组,以及对包含Fireshark尚未本地解码的协议的捕获进行快速分类。

原生Rust解析器是语义引擎:它们为Fireshark提供稳定的、仓库拥有的数据包类型、进程内过滤、十六进制转储的字节跨度、流标识和审计逻辑的直接输入。这是系统的一部分,Fireshark可以通过MCP进行推理、测试、模糊和公开,而不依赖于外部二进制文件的输出格式。

尺寸原生锈标记
协议广度更窄:11个核心协议更广:数千个剖析者
内部数据模型回购拥有的类型化层和字段Fireshark必须规范的外部解码输出
显示过滤器较小的功能集,但正在处理中并与Fireshark数据包对象集成更完整的Wireshark语义,但与Firesharg的原生管道分开
流处理回购拥有的流ID和每个流的元数据更强的重组和跟踪功能
十六进制转储/字节级UX本机层跨度驱动Fireshark的颜色编码详细视图未以相同的字节跨度形式显示
审计输入直接馈送Fireshark的审计引擎需要额外的映射层,目前支持较少
运行时依赖关系无需安装Wireshark需要 tshark 二进制
Fireshark中的最佳使用确定性分析、过滤、审计、MCP语义广泛的协议分类、重新组装、兼容性、验证

为什么原生11协议仍然重要

本地剖析者并没有试图超越Wireshark Wireshark。他们涵盖了Fireshark的大多数高级功能实际上依赖的协议:

  • 以太网、ARP、IPv4、IPv6、TCP、UDP、ICMP 提供数据包事实,以驱动摘要、端点、端口、TTL/跳限制检查、碎片状态、流ID和几个审计启发式方法。
  • 域名系统 提供键入的查询名称、查询类型和响应记录,直接支持以DNS为中心的过滤和DNS隧道检测。
  • TLS客户端Hello/服务器Hello 提供对握手元数据(如SNI、ALPN、版本、密码选择和密钥共享组)的本地访问,即使没有完全的TLS解密,这些元数据也是有用的安全枢轴。
  • 超文本传输协议 通过ASCII签名启发式调度提供第一种数据包方法、URI、主机、状态代码和内容类型提取,实现HTTP特定的过滤和审计,而无需重新组装。

这为Fireshark提供了一个可以端到端拥有的稳定核心:

  • 键入Rust字段,而不是后端特定的字符串解析
  • 确定性进程内过滤器评估
  • 原生流跟踪和数据包到流身份
  • 颜色编码十六进制转储的字节跨度
  • 审计引擎的直接输入
  • 默认工作流的零运行时依赖操作

因此,实际的分割是:

  • 使用本机 当您需要Fireshark拥有的语义时:审计、过滤、流标识、MCP查询和对核心协议集进行字节精确的数据包检查。
  • 使用tshark 当你需要广度时:不受支持的协议、更丰富的重组、快速的分类和针对Wireshark的差异验证。

两个后端都很重要。 tshark 让Fireshark触手可及。本土解剖者赋予Fireshark自己的产品行为。

系统要求

运行时

本机后端(默认)具有 零外部运行时依赖关系 --无需Wireshark、libpcap或其他系统库。所有协议解析都是纯Rust。A预制 firesharkfireshark-mcp 二进制文件就是你所需要的。

预构建二进制文件 适用于macOS(Apple Silicon)的 页面。

依赖关系版本必需目的
鲨鱼 (Wireshark CLI)3.0.0+可选通过 --backend tshark

Fireshark通过检查自动发现tshark PATH 首先是已知位置:

  • /Applications/Wireshark.app/Contents/MacOS/tshark (macOS)
  • /usr/local/bin/tshark
  • /usr/bin/tshark (Linux)
# macOS
brew install --cask wireshark

# Debian/Ubuntu
sudo apt install tshark

# Fedora/RHEL
sudo dnf install wireshark-cli

# Verify
tshark --version   # must be >= 3.0.0

从源头构建

依赖关系版本必需目的
1.85+(2024版)编译器工具链
货物(与Rust捆绑在一起)构建系统和包管理器
只是任何任务运行器(just check, just test等等)
货物绒毛任何仅用于模糊引信测试目标

特性

  • 捕获文件读取 --带有时间戳和原始线长的pcap和pcapng
  • 协议剖析 --以太网、ARP、IPv4、IPv6、TCP、UDP、ICMP、DNS、TLS(ClientHello+ServerHello)、带完整RFC字段提取的HTTP
  • 校验和验证 --IPv4报头、TCP和UDP校验和已针对IPv4和IPv6进行验证;NIC卸载(IPv4)跳过零校验和或标记为无效(根据RFC 8200的IPv6 UDP)
  • IPv6扩展标头 --跳过逐跳、路由、片段和目的地选项标头以到达传输;AH/ESP停止行走(IPsec未解码)
  • TLS握手分析 --任何TCP端口上的启发式调度、SNI提取、密码套件、ALPN、支持的版本、签名算法、密钥共享组
  • DNS响应解析 --带有键入答案数据的A/AAAA答案记录;RFC 1035压缩指针跟踪循环检测
  • 流跟踪 --使用规范的5元组密钥、流ID和每流统计信息进行TCP/UDP会话跟踪
  • 颜色编码CLI --摘要输出中的Wireshark风格协议着色
  • 数据包详细信息视图 --带有颜色编码十六进制转储的解码层树(fireshark detail)
  • 关注流媒体fireshark follow 按流ID显示对话中的所有数据包,其中 --payload 用于重新组装TCP有效载荷十六进制转储和 --http 用于HTTP请求/响应(需要tshark后端)
  • 流重新组装 --tshark支持的TCP流重组 follow --payloadfollow --http
  • TLS证书提取fireshark certificates CLI命令和 get_certificates MCP工具从TLS握手中提取主题CN、SAN DNS名称(需要tshark)
  • 多条件搜索fireshark search 随着 --protocol, --source, --destination, --port, --text, --has-issues 标志,可与显示过滤器组合
  • 显示过滤 --Wireshark风格表达语言(-f "tcp and port 443", tcp.stream == 0)使用字符串运算符(contains, matches 用于正则表达式)和字段名拼写错误检测
  • JSON导出--json 旗上 summary, stats, issues, audit, search, certificates 用于JSONL输出(每行一个JSON对象,没有颜色代码)
  • 捕获比较fireshark diff 显示两次捕获之间新的/缺失的主机、协议和端口
  • MCP服务器 --使用21个工具对LLM驱动的工作流和安全审计进行离线捕获分析,涵盖会话、数据包、流、审计、比较和TLS
  • 模糊测试 --具有两个模糊目标的货物模糊基础设施

快速开始

# Build and verify
just check

# Packet summary with color-coded output
cargo run -p fireshark-cli -- summary your-capture.pcap

# With a display filter
cargo run -p fireshark-cli -- summary your-capture.pcap -f "tcp and port 443"

# Inspect a single packet (layer tree + hex dump)
cargo run -p fireshark-cli -- detail your-capture.pcap 1

# Follow a TCP/UDP conversation
cargo run -p fireshark-cli -- follow your-capture.pcap 0

# Follow with reassembled TCP payload hex dump (requires tshark)
cargo run -p fireshark-cli -- follow your-capture.pcap 0 --payload

# Follow with HTTP request/response (requires tshark)
cargo run -p fireshark-cli -- follow your-capture.pcap 0 --http

# Capture statistics
cargo run -p fireshark-cli -- stats your-capture.pcap

# Security audit
cargo run -p fireshark-cli -- audit your-capture.pcap

# Security audit with a focused profile
cargo run -p fireshark-cli -- audit --profile security your-capture.pcap

# Security audit with custom packet limit
cargo run -p fireshark-cli -- audit --max-packets 500000 large-capture.pcap

# Multi-criteria search (combinable flags)
cargo run -p fireshark-cli -- search your-capture.pcap --protocol TCP --port 443
cargo run -p fireshark-cli -- search your-capture.pcap --source 192.168.1.0 --has-issues
cargo run -p fireshark-cli -- search your-capture.pcap --text "example.com"

# TLS certificate extraction (requires tshark)
cargo run -p fireshark-cli -- certificates your-capture.pcap

# Compare two captures (new/missing hosts, protocols, ports)
cargo run -p fireshark-cli -- diff baseline.pcap suspect.pcap

# JSON export (JSONL: one JSON object per line, no color codes)
cargo run -p fireshark-cli -- summary your-capture.pcap --json
cargo run -p fireshark-cli -- search your-capture.pcap --protocol DNS --json
cargo run -p fireshark-cli -- certificates your-capture.pcap --json

# Use tshark backend for broader protocol coverage
cargo run -p fireshark-cli -- summary --backend tshark your-capture.pcap

显示过滤

# Filter by protocol
cargo run -p fireshark-cli -- summary capture.pcap -f "tcp"

# Filter by port
cargo run -p fireshark-cli -- summary capture.pcap -f "port 443"

# Complex expressions
cargo run -p fireshark-cli -- summary capture.pcap -f "tcp and port 443 and ip.ttl > 64"

# Address filtering with CIDR
cargo run -p fireshark-cli -- summary capture.pcap -f "src 10.0.0.0/8"

# Boolean field checks
cargo run -p fireshark-cli -- summary capture.pcap -f "tcp.flags.syn and not tcp.flags.ack"

# DNS queries only
cargo run -p fireshark-cli -- summary capture.pcap -f "dns and not dns.qr"

# DNS by transaction ID
cargo run -p fireshark-cli -- summary capture.pcap -f "dns.id == 0x1234"

# DNS NXDOMAIN responses
cargo run -p fireshark-cli -- summary capture.pcap -f "dns.rcode == 3"

# TLS handshakes
cargo run -p fireshark-cli -- summary capture.pcap -f "tls"

# TLS ClientHello only
cargo run -p fireshark-cli -- summary capture.pcap -f "tls.handshake.type == 1"

# TLS by cipher suite
cargo run -p fireshark-cli -- summary capture.pcap -f "tls.cipher_suite == 0x1301"

# HTTP requests
cargo run -p fireshark-cli -- summary capture.pcap -f "http"

# HTTP by method
cargo run -p fireshark-cli -- summary capture.pcap -f 'http.method contains "POST"'

# HTTP by URI
cargo run -p fireshark-cli -- summary capture.pcap -f 'http.uri contains "/api"'

# HTTP by host
cargo run -p fireshark-cli -- summary capture.pcap -f 'http.host contains "example.com"'

# HTTP by status code
cargo run -p fireshark-cli -- summary capture.pcap -f "http.status_code == 200"

# HTTP by content type
cargo run -p fireshark-cli -- summary capture.pcap -f 'http.content_type contains "json"'

# Filter by stream ID (conversation)
cargo run -p fireshark-cli -- summary capture.pcap -f "tcp.stream == 0"
cargo run -p fireshark-cli -- summary capture.pcap -f "udp.stream == 1"

# String filter: case-insensitive substring match
cargo run -p fireshark-cli -- summary capture.pcap -f 'dns.qname contains "evil"'

# String filter: regex match
cargo run -p fireshark-cli -- summary capture.pcap -f 'tls.sni matches ".*\.example\.com"'

跟随流

# Show all packets in TCP/UDP conversation 0
cargo run -p fireshark-cli -- follow capture.pcap 0

# Show reassembled TCP payload as hex dump (requires tshark)
cargo run -p fireshark-cli -- follow capture.pcap 0 --payload

# Show HTTP request/response for a stream (requires tshark)
cargo run -p fireshark-cli -- follow capture.pcap 0 --http
Stream 0: TCP 192.0.2.10:51514 ↔ 198.51.100.20:443
3 packets, 162 bytes, duration 0.200s
──────────────────────────────────────
   1  2024-01-15T10:30:45.123Z  TCP    192.0.2.10:51514       -> 198.51.100.20:443        54
   2  2024-01-15T10:30:45.200Z  TCP    198.51.100.20:443      -> 192.0.2.10:51514         54
   3  2024-01-15T10:30:45.300Z  TCP    192.0.2.10:51514       -> 198.51.100.20:443        54

数据包详细信息

cargo run -p fireshark-cli -- detail capture.pcap 1

显示具有字段值的解码层树和颜色编码的十六进制转储,其中每个字节都由其协议层着色。

工作区布局

板条箱用途
fireshark-core域名类型(Frame, Packet, Layer, Pipeline, StreamTracker, TrackingPipeline)、摘要、解码问题
fireshark-file基于时间戳/长度提取的pcap和pcapng摄入
fireshark-dissectors具有完整RFC字段提取的协议解码器(11个协议)
fireshark-filter显示过滤语言:词法分析器、解析器、计算器(包括 tcp.stream/udp.stream, contains/matches 字符串运算符)
fireshark-cliCLI包含9个命令: summary, detail, stats, issues, audit, follow, diff, search, certificates
fireshark-backend后端抽象, AnalyzedCapture, AuditEngine、本地管道和tshark子流程适配器
fireshark-tsharktshark子流程发现、执行和输出规范化
fireshark-mcp离线MCP服务器(21个工具),用于LLM驱动的捕获分析、安全审计、流重组、证书提取、查找升级和捕获比较

其他目录:

  • fixtures/ --手工制作的二元夹具和烟雾捕捉器用于测试
  • fuzz/ --用于解剖器和捕获器的货物模糊目标
  • docs/ --设计规范和实施计划

MCP 服务器

离线MCP服务器,用于LLM驱动的数据包分析和安全审计。状态:打开一次捕获,获得一个 session_id,将其重新用于查询。有关完整的工具参考,请参阅 MCP服务器参考.

cargo run -p fireshark-mcp
家庭工具
会议open_capture, describe_capture, close_capture
数据包查询list_packets, get_packet, search_packets, list_decode_issues, summarize_protocols, top_endpoints
溪流list_streams, get_stream, get_stream_payload
捕获概述summarize_capture
比较compare_captures
审计audit_capture, list_findings, explain_finding, escalate_finding
TLSget_certificates

限制:stdio传输、离线捕获、可配置的数据包限制(默认100k)、8个并发会话、15分钟空闲超时。

连接到克劳德代码

添加fireshark作为MCP服务器,这样Claude就可以在对话过程中分析数据包捕获:

# From the fireshark repo root — build first
cargo build -p fireshark-mcp --release

# Add to Claude Code
claude mcp add fireshark ./target/release/fireshark-mcp

或手动添加到 ~/.claude/mcp.json:

{
  "mcpServers": {
    "fireshark": {
      "command": "/path/to/fireshark/target/release/fireshark-mcp"
    }
  }
}

然后,Claude可以直接使用fireshark工具:

“打开 /tmp/capture.pcap 告诉我里面有什么” → 克劳德打电话来 open_capture, summarize_capture,然后使用 list_findingsget_packet

连接到Codex

添加到您的Codex MCP配置中(通常 codex-mcp.json 或同等):

{
  "servers": {
    "fireshark": {
      "command": "/path/to/fireshark/target/release/fireshark-mcp",
      "transport": "stdio"
    }
  }
}

通用MCP客户端

Fireshark的MCP服务器使用 stdio传输 --它从stdin读取JSON-RPC并写入stdout。任何兼容MCP的客户端都可以通过将二进制文件作为子进程生成来进行连接:

# Direct stdio interaction (for testing)
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | cargo run -p fireshark-mcp

LLM工作流示例

通过MCP进行的典型分析会话:

  1. 打开open_capture({ path: "/tmp/traffic.pcap" }) → session_id、数据包计数、协议故障
  2. 总结summarize_capture({ session_id }) → 协议、顶级端点、流、发现计数
  3. 审计audit_capture({ session_id, profile: "security" }) → 有证据的安全调查结果
  4. 向下钻取get_packet({ session_id, packet_index: 42 }) → 可疑数据包的全层解码
  5. 过滤器list_packets({ session_id, filter: "tls and tls.handshake.type == 1" }) → 所有TLS客户端Hellos
  6. get_stream({ session_id, stream_id: 5 }) → 跟上对话
  7. 重新组装get_stream_payload({ session_id, stream_id: 5 }) → 重新组装TCP有效载荷十六进制转储
  8. 证书get_certificates({ session_id }) → TLS证书详细信息(主题CN、SAN DNS、org)
  9. 升级escalate_finding({ session_id, finding_id: "f1", notes: "confirmed C2 beacon" }) → 标记查找以供审查
  10. 关闭close_capture({ session_id }) → 免费资源

捕获大小限制

表面数据包限制行为
summary, detail, stats, issues, follow, search无--流式处理处理任何捕获大小
audit100000(可通过配置 --max-packets)如果超过,则拒绝捕获
MCP工具100000(可通过配置 max_packets 参数输入 open_capture)如果超过,则拒绝捕获
tshark后端加载tshark输出的任何内容

流式CLI命令(summary, detail, stats, issues, follow)一次迭代一个数据包,没有内存限制。这 audit 命令和MCP工具将所有数据包加载到内存中进行索引和交叉引用,因此它们强制执行可配置的数据包限制(默认100000)。

要分析较大的捕获:

# CLI: increase the limit for audit
fireshark audit --max-packets 500000 large-capture.pcap

对于MCP,通过 max_packets 打开时:

{ "path": "/tmp/large.pcap", "max_packets": 500000 }

发展

要求:防锈工具链, cargo,以及 just.

just fmt          # cargo fmt --all
just fmt-check    # cargo fmt --all -- --check
just clippy       # cargo clippy --workspace --all-targets -- -D warnings
just test         # cargo test --workspace
just check        # all of the above

模糊测试

cd fuzz
cargo fuzz run fuzz_decode_packet -- -max_total_time=60
cargo fuzz run fuzz_capture_reader -- -max_total_time=60

阶段

阶段焦点状态
爬行离线捕获解析、剖析、CLI、MCP服务器、显示过滤器、流跟踪完成
tshark后端、捕获比较、JSON导出、校验和验证(IPv4+IPv6)、tshark流重组、TLS证书提取完成
字符串过滤器、审计配置文件、HTTP解析器、查找升级、IPv6扩展标头、DNS压缩指针、RFC合规性强化、CLI/MCP功能奇偶校验完成
v1.0实时捕获后端(libpcap、AF_PACKET)、BPF捕获过滤器已计划

设计规则

  • 文件解析与协议解析是分开的
  • 解码更倾向于显式、类型化的层,而不是即席字节检查
  • API支持流式传输/迭代,而不是强制加载完整文件
  • 功能是在垂直切片中添加的,而不是像大型推测框架那样
  • MCP视图类型保持不变 fireshark-mcp --领域逻辑(审计、分析)存在 fireshark-backend
  • CLI不依赖于MCP——通过以下方式访问共享逻辑 fireshark-backend

文档

按受众分类的详细文档:

文档受众
建筑师指南系统架构、机箱边界、设计决策、扩展点
开发者指南开始,添加协议/过滤器/命令、代码模式
用户指南CLI命令、显示过滤器参考、MCP工具指南、后端选择
测试仪指南测试架构、夹具、机箱覆盖率、模糊工作流
DevOps指南CI管道、发布清单、依赖关系清单
操作指南部署、MCP服务器操作、运行时要求、故障排除
MCP服务器参考MCP安装,所有21个带有参数的工具,示例工作流程
CLI/MCP功能奇偶校验CLI和MCP功能的并排比较
RFC合规性审计规范RFC级协议合规性审计摘要和源列表
路线图版本历史、计划功能、当前指标

许可证

根据Apache许可证2.0版授权。看 LICENSE. 版权所有2026 Hendrik Reh 。参见 COPYRIGHT.

______________________________________________________________________

版本: 0.10.0 | 上次更新时间: 2026-03-19 | 维护单位:

目录标签

目录标签

安全审计RustClaude数据包分析本地部署协议解析网络流量分析LLM工具

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

19

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP