# Poke OT / SCADA Firewalls Without Opening a Substation Breaker

> **FrameAssembly v3.3.0** · Operational Playbook (Telemetry, VoIP & OT) · Canonical URL: https://frameassembly-lang.dev/use-cases/industrial-ot-modbus-dnp3

Prove your OT firewall allows Modbus reads while blocking writes and DNP3 operate commands—far away from real spinning machinery.

- **Category:** Telemetry, VoIP & OT
- **Capture Filename:** `scada_modbus.frasm` (9 Ethernet frames)
- **Protocols Exercised:** `tcp`, `modbus`, `dnp3`, `bacnet`

## Operational Problem

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.

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.

## Scenario & Topology: Level 3 HMI -> OT Firewall -> Level 1 PLC (Read OK, Write & Operate Blocked)

- **Topology:** `SCADA HMI (10.80.20.10) -> OT Conduit Firewall -> Plant PLC / RTU (10.80.10.50)`

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.

## FrameAssembly Workflow

Builds a stateful TCP 502 Modbus read/write check + DNP3 Select/Operate (with automatic IEEE 1815 CRC-16) + BACnet ReadProperty.

### Adapt It for Your Network

1. Point scada_hmi and plc_node at your Level 3 historian and Level 1 controller IPs.
2. Open TCP 502 with syn -> syn ack -> ack, then mix modbus, dnp3, s7comm, bacnet, ethernetip, or opcua lines.
3. Compile -> replay across your OT test firewall or feed offline into Claroty/Dragos/Suricata.

## Runnable Capture Specification (`scada_modbus.frasm`)

```frameassembly
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)
}
```

## Equivalent CLI Commands

```bash
# 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.pcap
```

## Protocol Reference Links

- [`tcp` — Transmission Control Protocol & RFC 7323 Options](https://frameassembly-lang.dev/docs/protocols/tcp) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/tcp.md))
- [`modbus` — Modbus TCP / UDP Industrial Application Protocol](https://frameassembly-lang.dev/docs/protocols/modbus) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/modbus.md))
- [`dnp3` — Distributed Network Protocol 3 (Electric & Water Utilities)](https://frameassembly-lang.dev/docs/protocols/dnp3) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/dnp3.md))
- [`bacnet` — BACnet/IP Building Automation & Control Networks](https://frameassembly-lang.dev/docs/protocols/bacnet) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/bacnet.md))
