S7comm versus S7comm-plus: what Wireshark can and cannot show you

4 min read188 courses on OnlySecurity

Two protocols share the same transport on Siemens PLCs, and learners often confuse them. Both ride on ISO over TCP, which means TCP port 102, TPKT and COTP. Inside that, the first byte of the application payload tells you which one you have.

The older S7comm header begins with protocol identifier 0x32. After it come a message type (the ROSCTR field), reserved bytes, a PDU reference, and the lengths of the parameter and data sections. The common message types are Job (1), Ack (2), Ack_Data (3) and Userdata (7). Parameters begin with a function code. Reading and writing variables use 0x04 and 0x05. Setting up the communication uses 0xF0. The block transfer functions, request download, download block, download ended, start upload, upload and end upload, use 0x1A to 0x1F. Program invocation (Wireshark’s “PI-Service”, which covers start, restart and insert or delete of a block) uses 0x28 and PLC stop uses 0x29. Wireshark decodes all of these into named fields, which means you can filter on them directly.

S7comm-plus begins with protocol identifier 0x72. It was introduced for the S7-1200 and S7-1500 families and adds session handling, a different object model and integrity checking in later versions. Stock Wireshark 4.2.0 has no S7comm-plus dissector, so the frames show only as COTP data after TPKT. A separate third party plugin exists that decodes more. It is built for particular Wireshark versions, so check the plugin’s own release notes for the Wireshark versions it targets. Without it you can still test the protocol identifier directly with the display filter tcp.payload[7] == 0x72, which matched 2468 frames on one of our invented S7comm-plus captures. Newer protected sessions are opaque beyond the header even with a plugin. That limitation is not a bug in your workflow. It is a property of the protocol.

What this means in practice. For S7comm you can answer questions such as which variables were read, which were written with what value, and whether a download or a stop was issued. For S7comm-plus you can often answer who connected, when, how long, and how many messages passed, but not always what was written. Your conclusions must be scaled to your evidence. “A session of 400 messages occurred between these hosts at 02:10” is a fact. “A program was downloaded” is a claim that needs more.

A useful habit is to begin with a protocol identifier census. Count frames by the byte after the COTP header. If you find both 0x32 and 0x72 between the same pair of hosts, check whether one is a fallback. Finding a legacy session on a device that otherwise uses the newer protocol is worth noting, because the older protocol has fewer protections.

Some captures place S7 traffic on unusual ports. A capture that appears to contain no S7 on port 102 may still hold it on another. Use Decode As to tell Wireshark to treat that port as TPKT. In tshark the same thing is -d tcp.port==<port>,tpkt, written with your port: on an invented capture with S7 on port 34000 it turned 484 decoded S7comm frames into 807.

Finish with a decision table in your notes: for each session, which protocol, what you could read, what you could not, and what you would need to say more. This is also how you write a report that holds up when someone asks how you know.

A short checklist helps when you open an unfamiliar capture. Confirm the transport by looking for TPKT and COTP. Find the first application byte. Count frames by protocol identifier. Look for setup messages that negotiate the PDU size, because that tells you the largest message the pair will exchange and explains the size of later frames. Look at whether sessions are long lived or short and repeated, since engineering tools tend to hold a session open, while an HMI often reconnects.

Version differences are a real source of confusion. The S7 families have changed their security behaviour across firmware generations, and a capture from one generation may look quite different from another with the same hosts. When you compare captures, note the device family and firmware if the source gives them, and do not assume that a behaviour seen in one applies to all.

Finally, keep Wireshark current. Dissector support for newer protocol variants has improved across releases, and a capture that looks opaque in an old build can decode better in a recent one. Note the build you used in your report, so that anyone reproducing your work sees the same output.

For structured practice on this topic, see the OnlySecurity course Siemens S7comm and S7comm-plus Traffic Analysis.

More from this author