Lion Cipher Lab
Reverse a custom network protocol from a capture and write your own client for it
- Threat Intel Analyst
- Intermediate
- ~75 min
- Free · no account required
Why it matters
Analysts meet custom protocols everywhere: a vendor appliance, an industrial device, a home-grown service, or malware talking to its controller. Often there is no documentation and no source. The method is the same each time: record the bytes, look for repetition, form a guess for each field, test each guess against all the traffic, then prove your understanding by speaking the protocol yourself. This lab runs the whole method on a protocol you build on your own machine, so you can check every answer. You will also see why home-made protocols are easy to read and forge, which is the…
What you'll learn
- recording the bytes of a TCP conversation with a small tap you write yourself (no root needed)
- finding message boundaries from a magic byte, a length field and a repeating pattern
- telling a command byte, a sequence number and a status code apart by comparing messages
- identifying a checksum by testing candidate algorithms against every frame
- writing a decoder and then a client that talks to the server, to prove you understand the protocol
- judging a custom protocol: what an on-path attacker can read, forge and replay
Steps in this lab
- The situation, and the plan
- Save the sealed boxes
- Write a tap that records the bytes
- Run the server, the tap and the client
- Find the frame: magic, command, sequence, length
- Identify the last byte: test checksum guesses
- Write the decoder
- Prove it: write your own client
- Read it like a defender: what is wrong with this protocol
- Clean up
Open the full interactive lab →