What 35 Modbus capture exercises have in common

4 min read188 courses on OnlySecurity

Public Modbus capture exercises look more alike than their authors probably intended. Take 35 exercises drawn from 13 public sources and they sort into a small number of shapes, and knowing the shapes tells you what to look for before you open a file.

The most common shape is a hidden value. Someone has put text, a number or an encoded string into a place a Modbus conversation can carry it: a holding register, a coil, a record, or the unit identifier. The capture itself is usually small, a few thousand packets, and almost everything in it is ordinary polling. The skill being tested is not decoding, it is noticing which of several hundred identical requests is not like the others.

The second shape is an odd operation. A client issues a function code that a normal supervisory system never would: a diagnostic request, a device identification read, a file record access or a code in the user defined range. The data may be trivial. The finding is that the operation exists at all, and what it implies about who sent it.

The third is behaviour over time. A scan that walks addresses, a burst at night, a second master that only speaks when the first is quiet. These sets are larger, and they reward working from conversation statistics first. A protocol hierarchy and a conversation table will usually point to the interesting host in under a minute.

The fourth shape is a capture where Modbus is only part of the story. An engineering session rides inside it, or a gateway sits between a serial segment and an Ethernet one. The Modbus content is real but the question is about topology or intent.

Three observations apply across all of them. First, most are small. Small captures are forgiving, which is why they make good teaching material, and also why a learner can finish one without learning a method. Second, licences are mostly unstated. Where a repository carries a licence, it often covers the repository and not the files, so the practice is to credit the owner, link to the source, and let each learner fetch the file there rather than redistributing it. Third, answers are often reachable by shortcut: a strings search, a file name, a hint in the challenge text. A well designed exercise makes the shortcut unrewarding by requiring a second step, such as reassembling values in order or converting them from a register encoding.

For a learner, the takeaway is a routine that fits all four shapes. Identify the file, count the packets and list the hosts. Build a protocol hierarchy. List the function codes seen and their counts. Then ask what is rare. The rare thing, by function code, by host, by value or by timing, is nearly always the lead.

For an instructor, the takeaway is the reverse: if you reuse an upstream exercise, record which shape it is, what the intended step two is, and whether the licence lets you host it. Our own generated captures exist precisely so that those three answers are known and the licence question disappears. Where we point to the real set, the course lists its source URL, size and SHA-256, so a learner can check they fetched the same file.

None of these exercises teach, or should teach, sending Modbus traffic to a device. They teach reading it. Everything in this series stays on the reading side of that line.

Sources. The exercises come from public capture-the-flag events, training repositories and write-up collections, and the credit belongs to the people and teams who built them. The course’s dataset table lists each source, the file we point to, its size and its SHA-256 (course URL added at build), so you can fetch the file from its owner and check you have the same one. We do not host or mirror them, and we do not quote their answers.

A note on how to use this review. If you are choosing which exercises to attempt, start with one from each shape rather than five from the same shape, because the skills differ. A hidden value exercise trains you to spot the rare item in a uniform stream. An odd operation exercise trains you to know the protocol well enough to say what is unusual. A behaviour over time exercise trains you to summarise before you read, and a topology exercise trains you to ask what a device is for. Keep a simple log for each: the shape, how long it took, the step that cost the most time, and what you would check first next time. After four or five entries the log will show you which habit you are missing, which is more useful than a score.

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

More from this author