Poke OT / SCADA Firewalls Without Accidentally Opening a Substation Breaker
OT firewall rules usually say "Historian may Read Holding Registers (0x03), but NEVER Write Single Register (0x06) or DNP3 Operate." Testing the block rule against a live factory PLC is a career-limiting move, and calculating IEEE 1815 DNP3 16-byte chunk CRCs by hand is pure misery.
The Catch
OT firewalls and ICS sensors (Claroty, Dragos, Nozomi, Palo Alto/Fortinet OT profiles) dissect deep inside Modbus, DNP3, S7comm, BACnet, EtherNet/IP, and OPC UA.
If your synthetic DNP3 packet has a bad link-layer or data-chunk CRC-16, or your Modbus TCP packet skips the port 502 3-way handshake, the dissector drops it as corrupt wire noise instead of testing your actual function-code policy.
Level 3 HMI -> OT Firewall -> Level 1 PLC (Read OK, Write & Operate Blocked)
Nine frames, zero physical PLCs harmed: a TCP 502 handshake (syn -> syn ack -> ack), an allowed Modbus Read Holding Registers (40001) <-> response, an unauthorized Write Single Register (value 1500), DNP3 Select + Operate (Group 12 CROB with auto CRC-16), and BACnet ReadProperty.
Adapt It for Your Network
- Point scada_hmi and plc_node at your Level 3 historian and Level 1 controller IPs.
- Open TCP 502 with syn -> syn ack -> ack, then mix modbus, dnp3, s7comm, bacnet, ethernetip, or opcua lines.
- Compile -> replay across your OT test firewall or feed offline into Claroty/Dragos/Suricata.
.frasm -> .pcap
Preview frames inline or open in Playground ->Builds a stateful TCP 502 Modbus read/write check + DNP3 Select/Operate (with automatic IEEE 1815 CRC-16) + BACnet ReadProperty.
host scada_hmi { ip 10.80.20.10 }host plc_node { ip 10.80.10.50 }flow modbus_and_ot_poll(hmi, plc) { hmi -> plc tcp syn srcport 50200 dstport 502 wait 1ms hmi <- plc tcp syn ack wait 1ms hmi -> plc tcp ack wait 1ms hmi -> plc modbus readholdingregisters txid 101 unitid 1 addr 40001 count 4 wait 5ms hmi <- plc modbus readholdingregisters txid 101 unitid 1 count 4 isresponse wait 5ms hmi -> plc modbus writesingleregister txid 102 unitid 1 addr 40001 value 1500 wait 5ms hmi -> plc transport udp dnp3 select src 1 dst 10 group 12 variation 1 wait 2ms hmi -> plc transport udp dnp3 operate src 1 dst 10 group 12 variation 1 wait 2ms hmi -> plc bacnet readproperty invokeid 10 objecttype 0 objectinstance 1 propertyid 85 wait 2ms}compile { modbus_and_ot_poll(scada_hmi, plc_node)}# 1. Build the Industrial OT / SCADA conduit capture
frameassembly scada_modbus.frasm scada_modbus.pcap
# 2. Inspect Modbus function codes, DNP3 CRC-16 frames, and BACnet properties in tshark
tshark -r scada_modbus.pcap
# 3. Replay across your OT zone firewall or passive ICS sensor SPAN port
sudo tcpreplay -i eth1 scada_modbus.pcapKeep scada_modbus.frasm in Git and compile .pcap in under 1ms
Single rootless binary + VS Code extension with live squiggles, quick-fixes, and side-by-side packet ladders ready for Wireshark.