$npx -y skills add zhaoxuya520/reverse-skill --skill competition-custom-protocol-replayInternal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for custom binary or text protocol recovery, handshake reconstruction, framing, sequence control, checksums, stateful replay, and accepted-session reproduction. Use when the user asks to decode an unknow
| 1 | # Competition Custom Protocol Replay |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | Use this skill when the hard part is not merely naming the protocol, but reproducing the exact message order and state needed for acceptance. |
| 6 | |
| 7 | Reply in Simplified Chinese unless the user explicitly requests English. |
| 8 | |
| 9 | ## Quick Start |
| 10 | |
| 11 | 1. Identify client and server roles, session boundaries, and reset conditions before decoding field semantics. |
| 12 | 2. Recover framing, lengths, delimiters, sequence numbers, checksums, nonces, and state transitions before broad replay attempts. |
| 13 | 3. Keep one canonical transcript of a successful exchange. |
| 14 | 4. Change one field or one message at a time while replaying. |
| 15 | 5. Reproduce the smallest accepted conversation that proves the decisive branch. |
| 16 | |
| 17 | ## Workflow |
| 18 | |
| 19 | ### 1. Map The Session State Machine |
| 20 | |
| 21 | - Identify handshake, negotiation, authentication, keepalive, command, and teardown phases. |
| 22 | - Record which fields are static, which are derived, and which depend on prior messages. |
| 23 | - Keep message order, direction, and timing tied to the same session identity. |
| 24 | |
| 25 | ### 2. Recover Framing And Integrity |
| 26 | |
| 27 | - Reconstruct lengths, delimiters, type bytes, checksums, MACs, counters, compression, or encryption boundaries. |
| 28 | - Distinguish transport framing from application-level framing. |
| 29 | - Note exactly where server acceptance changes when one field or step is mutated. |
| 30 | |
| 31 | ### 3. Build The Minimal Replay Harness |
| 32 | |
| 33 | - Reduce the path to the smallest transcript that reaches the accepted state, parser branch, command effect, or artifact. |
| 34 | - Preserve both the original captured sequence and the replayed minimal sequence. |
| 35 | - If the problem is mainly generic PCAP or stream decoding with no stateful replay requirement, switch back to the broader PCAP skill. |
| 36 | |
| 37 | ## Read This Reference |
| 38 | |
| 39 | - Load `references/custom-protocol-replay.md` for the state-machine checklist, transcript checklist, and evidence packaging. |
| 40 | |
| 41 | ## What To Preserve |
| 42 | |
| 43 | - Canonical transcript, message types, field boundaries, checksums, counters, and session identifiers |
| 44 | - Original capture slices and the replay harness inputs that produce acceptance |
| 45 | - The exact mutation that flips the protocol from rejected to accepted, or vice versa |