Skip to the content ForoHackers
Log inJoin

Protocol analysis: start here

Protocol analysis
#3295 · · Quote · Report

Protocol analysis is reading what two systems actually say to each other: capturing messages, decoding their fields and checking them against the specification. It is how engineers debug networks, how defenders spot odd traffic, and how researchers find ambiguities and weaknesses in designs. Capture only networks you own or are authorised to observe.

Key concepts

  • Layering: each layer wraps the one above in a header; analysis means peeling them in order.
  • Message structure: fixed fields, lengths, type codes and options, in binary or text form, with a byte order.
  • State machines: a protocol is a set of allowed sequences; a message is valid only in the right state.
  • Specification versus reality: real implementations differ from the standard, and the gaps are where bugs live.
  • Capture and privacy: captures hold other people's data, so keep them minimal and protected.

Vocabulary

  • Dissector: code that decodes a protocol's bytes into named fields.
  • PCAP: the common file format for packet captures.
  • Handshake: the opening exchange that sets up parameters and state.
  • Endianness: the order in which a multi-byte number's bytes are stored.

What to study, in order

  1. Capture your own traffic with Wireshark and follow a web request through Ethernet, IP, TCP, TLS and HTTP.
  2. Read the specification of a simple protocol and match each field to bytes in a capture.
  3. Write a small parser for it in a language you know and test it on your own captures.
  4. Draw the state machine of a protocol, such as TCP, and find where a capture follows or breaks it.
  5. Write a dissector for a toy protocol you designed, then try to confuse it with malformed input in your lab.

Related tags

#tcp-ip #network-security #protocols #fuzzing #reverse-engineering

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply