Four ways to find a rogue command in an IEC-104 capture

3 min read188 courses on OnlySecurity

An IEC-104 capture usually holds thousands of monitoring messages and a handful of commands. Finding the one command that does not belong is a different task from describing the traffic, and four methods are worth comparing.

The first is the direction filter. Monitoring types travel from the outstation to the controlling station, and commands travel the other way. List every ASDU type that the controlling station sent, with -e iec60870_asdu.typeid and a source filter. In most captures the list is short. Each type on it is a candidate, and you can tick off the known routine ones, such as general interrogation and clock synchronisation, which you will see regularly.

The second is the rarity method. Count each combination of source, type and cause and sort ascending. A command type that appears once in an hour of traffic is more interesting than one that appears every minute. Rarity is not guilt, because legitimate operators do issue occasional switching commands, but it ranks your attention.

The third is the confirmation chain. A properly handled command produces an activation, then an activation confirmation, and often an activation termination. A command with no confirmation, a confirmation from the wrong station, or a negative confirmation tells you something happened to the exchange. Pair requests with responses by common address and information object address, and look at the gaps.

The fourth is the identity method. Who sent the command, from where and when? Compare the source IP and the time of day with the baseline for that master. A command from an address that has never sent one, or at an hour the master has never been active, stands out even when the command itself looks ordinary. This is the method that finds a legitimate looking command sent by an illegitimate sender.

No single method is enough. The direction filter misses a command hidden in a type you ruled routine. The rarity method misses a flood of repeats, because repetition makes a command common. The confirmation chain misses a command that was handled normally. The identity method misses a compromised master. Together they cover each other’s gaps, and where they disagree you have found the spot worth a closer look.

A practical routine: run the direction filter first because it is cheap, then rank by rarity, then examine confirmations for the survivors, then check identity. Write each candidate in a short table with time, source, type, cause, object and your confidence. Keep the table, because a finding that cannot be reproduced from the capture is only an opinion.

Document what you ruled out as well as what you found. A report that says “twelve command types seen, nine routine and explained, three examined” shows that the search was complete, and it lets the next analyst pick up where you stopped.

It helps to rehearse the four methods on a capture where you already know the answer, such as a quiet baseline file with a single command in it. If the methods do not all point at that command, adjust your filters before using them on an unknown file. A method you have never tested on a known case is a method whose silence you cannot interpret. When a filter returns nothing, find out whether that means no command was sent or that the field name was wrong, by running it on a file where a command certainly exists.

Finally, keep the table small enough to read. Five columns that a colleague can scan in ten seconds beat twenty columns nobody opens, and a short table makes the odd row obvious.

For structured practice on this topic, see the OnlySecurity course IEC 60870-5-104 Traffic Analysis: ASDU Anatomy to Command Abuse.

More from this author