Three stations, one table: reading IEC-104 command traffic

3 min read188 courses on OnlySecurity

IEC 60870-5-104, usually shortened to IEC-104, carries telecontrol messages between a control centre and substations, normally over TCP port 2404. It frames each message as an APCI header and, for data, an ASDU that names a type, a cause of transmission and one or more information object addresses. A short capture of one control centre and three stations makes an unusually clean teaching set because you can read it end to end. Ours is generated for the course with invented addresses, and it follows the pattern that a public analysis of grid focused malware describes, which we link instead of reproducing.

Read in layers. First, conversations: who is the controlling station and who are the controlled stations. Second, frame kinds: IEC-104 distinguishes information frames, supervisory frames and unnumbered frames, and a healthy link shows start, test and acknowledgement frames in a regular rhythm. Third, the ASDUs: which type ids appear, with which causes of transmission, and against which information object addresses. In a normal link, measurements and status changes flow from substation to control centre, and commands flow the other way rarely and for a reason.

The point of reading this malware’s traffic is that its commands are ordinary. The protocol does what it was designed to do. A single or double command with a cause of activation, sent to an information object address that maps to a breaker, is a valid message. The only abnormal thing is who sent it, when and how often. This is why signature detection alone is weak against protocol native attacks, and why behaviour matters: a command from a host that has never sent one, a sequence of commands across several object addresses in quick succession, or a command that follows a scan of address ranges.

A useful exercise is to build one table that spans the whole capture with a row per command and columns for time, source, destination, type id, cause and object address. Add a column for the station. Then ask which addresses were commanded on which stations and which type was repeated most. The table, not any individual packet, is what answers the question.

Take care with impact claims. The capture shows messages, not breaker positions. You can say a command was sent. You cannot say the breaker opened unless a following status frame from the station reports it, and the confirmation to look for is the station’s double-point status report: iec60870_asdu.typeid == 3 && iec60870_asdu.causetx == 11 matched 17 frames on the build capture.

Handling: our capture is invented traffic with no executable, but label every capture do not run and never replay. IEC-104 commands reaching a real station are real commands.

Tools to use: capinfos, tshark -z conv,ip, -z io,stat,1, the verified dissector fields iec60870_104, iec60870_asdu and iec60870_asdu.typeid, and a spreadsheet for the table.

For structured practice on this topic, see the OnlySecurity course ICS Malware Case Files: Four Intrusions Read on the Wire.

More from this author