Scan, flood, write: three shapes a building attack leaves in a capture

4 min read188 courses on OnlySecurity

Most building network incidents that leave packet evidence fall into three shapes: someone is looking, someone is overloading, or someone is changing something. Learning to tell them apart in a capture is more useful than memorising any one protocol, because the same three shapes appear in BACnet, Modbus and the rest.

The first shape is the scan, and its signature is breadth. One source contacts many destinations, or one gateway is asked about many device addresses, in a short window with little else in the conversation. On KNXnet/IP the discovery conversation on UDP 3671 asks a gateway to describe itself, and a walk of the bus asks one device after another for a short answer. A normal supervisory server does ask these questions, but it asks them once at start up and then settles into a steady rhythm. A sweep is a burst with a regular step between targets. In tshark the first tool is a conversation table, then a field extraction of source, destination and relative time, sorted by time. If the destinations increase one after another with a near constant gap, it is a sweep.

The second shape is the flood, and its signature is rate. The same request or the same telegram repeats at an interval far below what any schedule would produce, often once a second or faster, from one source or a few. The effect depends on the target: a gateway may stop answering, reboot, or drop its tunnelling connection, and a lighting group may flicker. What you can prove from the capture is the rate, the duration and the point at which answers stop. What you cannot prove is the physical effect, because the lamp is not in the pcap. Report the rate and the loss of answers, and label the physical effect as inferred. A one second bucket count (the io,stat statistic with a one second interval) shows the step change clearly.

The third shape is the write, and its signature is a change of value from a source that has never written before. In a building the same group address is normally written by one or two known devices: a switch, a scheduler, a controller. A write to that address from a new individual address is the finding. This is the hardest shape to see because a single write is one packet in a long capture. It needs a baseline: list the sources that write to each group address in a clean period, then diff the attack period against it. The tool is a table, not a filter.

Two cautions. Ordinary commissioning looks like a scan and a burst of writes at once, because an installer is doing exactly that, so tie the evidence to a change window before calling anything hostile. And never let a label from a dataset stand in for this reasoning: say what the packets show, then say what you infer.

A short checklist for the report: source and destination, first and last frame time, rate, what answered and what stopped answering, whether the source is new, and what you could not see.

A worked example of the method: take a ten minute slice of a quiet capture and a ten minute slice around a suspected event, and build the same three tables for each, one for destinations per source, one for packets per second, and one for writers per address. The quiet slice gives you the range of normal. The event slice is interesting only where it leaves that range. Often one of the three tables shows nothing and another shows everything, which tells you which of the three shapes you are looking at. Resist the urge to force an event into a shape it does not fit: some captures hold two shapes at once, such as a sweep followed by a write, and the report should say so and give the time order.

For structured practice on this topic, see the OnlySecurity course Building Automation Security: KNXnet/IP, BACnet and Friends.

More from this author