Ten mistakes people make reading Modbus captures

3 min read188 courses on OnlySecurity

These are mistakes that show up repeatedly in learner notes and in the way exercises are written. Each is cheap to avoid once you have seen it.

  1. Assuming port 502 means Modbus. Many exercises use another port, and some captures put other protocols on 502. If nothing decodes, use the Decode As feature, but first check the protocol hierarchy.
  2. Trusting the dissector for everything. Where the Modbus dissector cannot parse a frame, it may show it as raw data or as malformed. Malformed is a finding, not an error to ignore.
  3. Reading only requests. The response carries the data in a read, and the request carries it in a write. Look at both directions.
  4. Sorting by address rather than time. A message hidden across several registers is in the order the packets were sent, not the order of the register addresses.
  5. Forgetting that register values are 16 bit. Two registers may form one 32 bit value or four characters. The byte order depends on the device convention, so try both.
  6. Ignoring the unit identifier. In a gateway setup, one IP address can front many devices, and the unit identifier is what separates them.
  7. Counting only function code 3. Writes, file records and diagnostics are often where the interest lies, and they are a small fraction of the packets.
  8. Missing retransmissions. A repeated packet can look like a repeated command. Check the TCP sequence numbers before concluding a client issued a request twice.
  9. Searching the file for the flag text before analysing. A strings search is quick and sometimes works, but an exercise designed well hides the answer in an encoding. Treat a hit as a lead to explain, not a result.
  10. Not writing down the method. When you find the answer, record the filter, the fields, the conversion and the evidence. In a real report the method is the deliverable.

One more habit is worth building: say what you do not know. If a capture has no timestamps you can trust because it was processed by a tool that rewrote them, say so. If you could not decode a value, report the raw bytes with a hash of the file rather than inventing an interpretation.

The mistakes above are about reading. The more serious mistake, which our courses never teach, is acting on a live system because a capture suggested a theory. Verify theories on a capture or on a lab you own, and keep production devices out of the picture.

It is worth adding a short checklist you can keep next to the keyboard. Confirm the protocol before decoding. List function codes before reading values. Read both directions. Sort by time. Check the unit identifier. Check retransmissions. Convert only after you have shown a place is unusual. Record the filter and the Wireshark version. Describe what you did not determine. Teams that use a checklist like this tend to find that the number of wrong turns falls quickly, mostly because the mistakes in this article are habits rather than gaps in knowledge. If you teach this material, ask learners to say which item on the list they skipped when they got stuck. The answer is usually one of the first four.

To practise, take any small capture and deliberately make each mistake on the list once, then correct it and note how the result changed. Seeing a message come out scrambled because you sorted by address, or a repeated write vanish once you check sequence numbers, makes the habit stick far better than reading about it. Keep the before and after commands in your notes so you can show the difference to a colleague.

For structured practice on this topic, see the OnlySecurity course Modbus Packet Forensics: Hidden Data, Odd Operations and Covert Channels.

More from this author