One capture, six protocols: a worked inventory

3 min read188 courses on OnlySecurity

Imagine a single capture from a plant floor network. It holds Siemens S7, Modbus/TCP, EtherNet/IP, BACnet, IEC-104 and OPC traffic, plus the usual IT background. The task is to say, in under an hour, which protocols are present, which hosts speak them, and whether anything looks wrong.

Step one is the hierarchy: tshark -r mixed.pcap -q -z io,phs. This prints a tree of protocols with frame and byte counts. If the tree shows only tcp and data under a port you expected to decode, the dissector did not fire, and you will need Decode As.

Step two is the port map. Industrial protocols mostly keep to well known ports, so a list of destination ports is a quick guess at protocol. Default ports, with 102, 135, 502, 2404 and 47808 as listed in the local services file and 44818 and 2222 still to be checked against the IANA registry at build: Modbus/TCP 502, S7comm 102 (also used by MMS, which is a trap), IEC-104 2404, EtherNet/IP 44818 for explicit messaging and UDP 2222 for implicit I/O, BACnet UDP 47808, and OPC DA over DCOM using dynamic high ports behind an RPC endpoint mapper on 135. The 102 clash is worth remembering because both S7comm and MMS ride on ISO transport over TCP port 102. The dissector chosen depends on the content, not the port.

Step three is a per-protocol display filter, one at a time, with a count. tshark -r mixed.pcap -Y modbus | wc -l gives a quick tally, and the filter names for the others are s7comm, iec60870_104, enip, bacnet and mms, all of which compile in Wireshark 4.2.0. Check each against your own version by typing it into the filter bar and checking that it turns green. OPC DA has no dedicated dissector in 4.2.0, so its traffic shows as dcerpc, and a few vendor protocols show only as plain TCP data on their own port, and need the vendor documentation to name. A flow on a port nobody expects needs Decode As before anything else: tshark -r mixed.pcap -d tcp.port==41002,tpkt -Y s7comm, which prints a warning that tpkt matched two dissectors and still decodes.

Step four is the dangerous-operation scan. For each protocol, list the function codes or services that change state. In Modbus that is the write family. In S7comm it is the download and stop functions. In EtherNet/IP it is the services that write attributes or reset a device. In BACnet it is write property and reinitialize. You are not asking whether they are present, because a working plant uses them. You are asking who sent them and when.

Step five is the odd one out. Anything that speaks a protocol on the wrong port, or a protocol from a host that has never spoken it before, goes on a short list. That list is the output of the hour.

The point of the exercise is the order of work. Inventory by protocol, then by host, then by operation, then by oddity. Most beginners go straight to the oddity, find a packet that looks interesting, and cannot tell whether it is normal because they never built the inventory.

For structured practice on this topic, see the OnlySecurity course ICS Forensics from the CTF Circuit II: Other Protocols and Live-Lab Triage.

More from this author