competition-custom-protocol-replay Skill
ctf-sandbox-orchestrator 的内部下游技能。针对自定义二进制或文本协议还原、握手重建、分帧、序列控制、校验和、有状态重放及被接受会话复现的 CTF-sandbox 工作流。当用户要求解码未知协议、还原自定义分帧、构建重放工具、满足序列或校验和规则、重放捕获的会话、或证明达到被接受分支的最小消息顺序时使用。仅在 `$ctf-sandbox-orchestrator` 已建立沙箱假设并路由至此之后使用。
安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。
技能指令原文(SKILL.md)
Competition Custom Protocol Replay
Use this skill only as a downstream specialization after $ctf-sandbox-orchestrator is already active and has established sandbox assumptions, node ownership, and evidence priorities. If that has not happened yet, return to $ctf-sandbox-orchestrator first.
Use this skill when the hard part is not merely naming the protocol, but reproducing the exact message order and state needed for acceptance.
Reply in Simplified Chinese unless the user explicitly requests English.
Quick Start
- Identify client and server roles, session boundaries, and reset conditions before decoding field semantics.
- Recover framing, lengths, delimiters, sequence numbers, checksums, nonces, and state transitions before broad replay attempts.
- Keep one canonical transcript of a successful exchange.
- Change one field or one message at a time while replaying.
- Reproduce the smallest accepted conversation that proves the decisive branch.
Workflow
1. Map The Session State Machine
- Identify handshake, negotiation, authentication, keepalive, command, and teardown phases.
- Record which fields are static, which are derived, and which depend on prior messages.
- Keep message order, direction, and timing tied to the same session identity.
2. Recover Framing And Integrity
- Reconstruct lengths, delimiters, type bytes, checksums, MACs, counters, compression, or encryption boundaries.
- Distinguish transport framing from application-level framing.
- Note exactly where server acceptance changes when one field or step is mutated.
3. Build The Minimal Replay Harness
- Reduce the path to the smallest transcript that reaches the accepted state, parser branch, command effect, or artifact.
- Preserve both the original captured sequence and the replayed minimal sequence.
- If the problem is mainly generic PCAP or stream decoding with no stateful replay requirement, switch back to the broader PCAP skill.
Read This Reference
- Load
references/custom-protocol-replay.mdfor the state-machine checklist, transcript checklist, and evidence packaging.
What To Preserve
- Canonical transcript, message types, field boundaries, checksums, counters, and session identifiers
- Original capture slices and the replay harness inputs that produce acceptance
- The exact mutation that flips the protocol from rejected to accepted, or vice versa