protocol-reverse
What it does
This tool helps understand how programs communicate by exchanging data. It analyzes network packets or files to uncover the 'secret language' they use.
When to use it
- ✓When you have a network data file (PCAP) and want to know what it means.
- ✓When analyzing a program that uses formats like Protobuf or gRPC.
- ✓To decipher the communication of a website or app using WebSockets.
Skill link
https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/protocol-reverse/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Analyze this PCAP file and tell me how the data is structured.”
5 new skills a week. 1 minute to read.
How it works
The tool examines the data exchanged between programs, looking for patterns and repeating structures. It tries to identify the different 'pieces' of information and how they fit together.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Protocol Reverse Engineering
ACTION REQUIRED(读完后立刻执行)
NOW: 读取../field-journal/precedent-reverse.md— 确认授权与常规操作边界NOW: 确认任务是否为协议/流量/序列化格式逆向(非纯 Web 参数签名 → 转js-reverse/)NOW: 若有目标网络交互 →../scripts/case-init.ps1完成 scope;auth未 granted 禁止对目标 ACTNEXT: 读取../tool-index.md;缺工具 bootstrap(tshark/wireshark 等可能需手动)ACT: 进入工作流 Phase 1,产出帧布局或消息字典草稿
适用场景
- 自定义 TCP/UDP 二进制协议
- Protobuf / gRPC / FlatBuffers / MessagePack
- WebSocket / MQTT / 私有 RPC
- PCAP / PCAPNG 还原字段与状态机
- 客户端-服务端校验、序列号、加密帧头
不走本 skill
| 情况 | 去哪 |
|---|---|
| 仅 HTTP 参数签名 / JS 加密 | js-reverse/ |
| 仅 TLS 证书问题 | pentest-tools/ 或浏览器代理 |
| 固件内协议栈深挖 + 仿真 | firmware-pentest/ 后再回本 skill |
工作流
Phase 1 — 采集与分诊
□ 拿到样本:PCAP / 代理导出 / 客户端日志 / 二进制
□ 标记方向:C→S / S→C;是否有握手、心跳、重连
□ 固定头?魔数?长度字段?TLV?定长?
□ 是否压缩(zlib/gzip/lz4)或加密(AES/ChaCha 帧内)
□ tshark -r cap.pcap -T fields -e frame.number -e ip.src -e tcp.payload
Phase 2 — 帧布局还原
□ 对齐多个同类消息,找不变字节 / 自增序列号
□ 长度字段:大端/小端、含头/不含头
□ 校验:CRC16/32、checksum、HMAC 位置
□ 画出状态机:Connect → Auth → Ready → Request/Response → Close
□ 工具:Wireshark 自定义 dissector 草稿 / ImHex / 010 Editor 模板 / Kaitai Struct
Phase 3 — 序列化与加密
□ Protobuf:.proto 恢复(blackboxprotobuf / pbtk / protoc --decode_raw)
□ gRPC:HTTP/2 headers + protobuf body
□ 加密:找密钥派生(客户端 so/dll/JS)→ 联合 ida-reverse / js-reverse / apk-reverse
□ 重放:仅在授权 scope 内;先无害字段再敏感操作
Phase 4 — 产物
MUST 产出:
- 消息类型表(name / opcode / fields)
- 至少 1 条可复现的解码命令或脚本
- Evidence:原始 hex 摘录 + 解码结果(脱敏)
工具链
| 工具 | 必需 | 用途 | 自举 |
|---|---|---|---|
| tshark / Wireshark | 强烈建议 | PCAP 解析 | 手动 / winget |
| Python3 | 是 | 解码脚本 | 系统 |
| blackboxprotobuf | 可选 | 未知 protobuf | pip |
| ImHex / 010 | 可选 | 结构模板 | 手动 |
| IDA / r2 / Ghidra | 按需 | 客户端序列化函数 | 见对应 skill |
参考
references/protocol-workflow.md— 帧布局与 Protobuf 速查- 相关:
../ida-reverse/../js-reverse/../firmware-pentest/../pentest-tools/
路由上下文
上游: MASTER-ROUTING R21 · routing.md
下游: 需客户端算法 → ida-reverse/js-reverse;需利用重放 → pentest-tools/api-security
同级: malware-analysis(C2 协议)、digital-forensics(流量取证)
任务完成自检
- 是否还原了消息布局或状态机(而非只贴 hex)?
- 是否有可复现解码命令?
- 是否遵守 scope / 脱敏?
- 是否回写 field-journal / 报告 Checklist?
FAQ
What is a 'protocol'?
It's a set of rules that defines how computers or programs exchange information.
What is 'reverse engineering'?
It's the process of taking something apart to understand how it works, without having the original manual.
Do I need any special tools to use this?
You might need to install some network analysis tools like Wireshark, but the tool will try to guide you.
Details
Original description by the author
Use for authorized reverse engineering of custom binary protocols, Protobuf/gRPC, WebSocket frames, and PCAP-driven protocol recovery.
Popularity
- GitHub stars
- 42k
- Ranking position
- #6493
- License
- MIT
- Updated
- 9/22/2026
Comments
- …
More skills from this repository
competition-ad-certificate-abuse
42kHelps your agent analyze attacks on digital certificate systems. It investigates how certificates can be misused to gain access.
competition-agent-cloud
42kHelps your agent analyze security challenges in AI and cloud systems. It investigates how prompts, tools, and the cloud can be exploited.
competition-android-hooking
42kHelps your agent investigate Android applications. It analyzes how apps work internally and how they might be modified or exploited.
competition-browser-persistence
42kHelps your agent analyze how websites store information in your browser. It investigates cookies and other data to understand how sessions work.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.