Skip to content
Pwnversity
OT-PROTOCOLOSadvanced · 6 min · upd. 2026-10

Industrial protocols (Modbus)

MITRE ATT&CK ICS

Industrial protocols (Modbus, DNP3, S7comm, EtherNet/IP, Profinet, BACnet, OPC UA) were designed decades ago for isolated, trusted networks: most have no authentication or encryption. Understanding this explains why access to the OT network is so critical: whoever reaches the network can often read and write the process directly. This card extends the architecture context from SCADA / ICS.

  • No authentication or integrity: any peer on the network can send write commands that change the physical state; the protocol can’t tell a “legitimate operator” from an “attacker”.
  • No encryption: a passive capture reveals the process state and logic; values, register addresses, and setpoints travel in clear.
  • Legacy and unpatchable: many devices don’t support the secure variants even when they exist (DNP3-SA, OPC UA with security).
  • Fragility: an aggressive active scan or an unexpected function code can hang a PLC; the risk is operational and physical.
  • Direct Internet exposure: Shodan/Censys list thousands of ICS devices with control ports open (see Shodan and search engines); never interact with third parties.

Modbus is request/response over TCP on port 502 (or serial, Modbus RTU). A master queries a slave via function codes (FC) that read or write coils (bits) and registers (16-bit words). There is no session, no authentication, and no integrity check.

sequenceDiagram
    participant M as Master (HMI/SCADA)
    participant S as Slave (PLC) :502
    M->>S: FC 03 Read Holding Registers (addr, qty)
    S-->>M: Register values
    M->>S: FC 06 Write Single Register (addr, value)
    S-->>M: Write echo (physical change applied)

Main function codes:

  • FC 01 / 02: read coils / discrete inputs.
  • FC 03 / 04: read holding / input registers.
  • FC 05 / 06: write a coil / a register — a command straight to the process!
  • FC 15 / 16: write multiple coils / registers.

With no authentication, a write FC from the network changes the physical state with no control other than network access.

  • S7comm — Siemens S7, over ISO-TSAP on TCP 102; Stuxnet abused it to reprogram PLCs.
  • DNP3 — utilities (energy/water), TCP/UDP 20000; with optional, rarely deployed Secure Authentication (DNP3-SA).
  • EtherNet/IP — Rockwell/Allen-Bradley CIP, TCP/UDP 44818 (explicit messaging) and UDP 2222 (implicit I/O).
  • BACnet/IP — building automation (BMS), UDP 47808 (0xBAC0).
  • OPC UA — modern interoperability, TCP 4840; it does support security (signing/encryption), but it’s often deployed in None mode.
  • IEC 60870-5-104 — electric telecontrol, TCP 2404; alongside IEC 61850 (MMS/GOOSE) in substations.
  • Profinet — Siemens automation; discovery via DCP at the link layer (layer 2) and real-time traffic on UDP 34962-34964.

The goal is to map what is spoken and to whom, with minimal impact.

  • Passive capture first: Wireshark with Modbus/DNP3/S7/EtherNet-IP dissectors to inventory peers, FCs, and register addresses without touching the PLC (see Sniffing and capture).
  • Active enumeration only in a lab: nmap NSE identity scripts (banner), never writes.
  • Controlled prototyping: pymodbus to read registers on your own lab PLC.
Ventana de terminal
# ONLY in your own lab: identity/enumeration, no writes
nmap -Pn -n -p 502 --script modbus-discover <lab_plc>
nmap -Pn -n -p 44818 --script enip-info <lab_plc>
# pymodbus 3.x — READING registers on your own lab PLC
from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient("192.0.2.10", port=502) # lab host
client.connect()
rr = client.read_holding_registers(address=0, count=10, slave=1)
print(rr.registers) # never run write_* against production systems
client.close()
  • Map to MITRE ATT&CK for ICS: e.g. Point & Tag Identification (mass register reads), Unauthorized Command Message (writes).
  • Since the protocols don’t authenticate, the defense is network-based: Purdue segmentation and controlling who talks to the PLCs (SCADA / ICS).
  • Allowlisting of authorized peers (only the HMI/historian talks to each PLC), not anyone.
  • Passive monitoring alerting on unexpected write function codes, new peers, or mass reads.
  • Enable secure variants where they exist (DNP3-SA, OPC UA with a security profile); never expose :502, :102, :20000, :44818, or :47808 to the Internet.
  • Industrial deep-packet-inspection firewalls that understand the FCs and block unplanned writes.
  • Stuxnet manipulated S7comm to reprogram PLCs without the HMI noticing (Siemens Step7).
  • Thousands of Modbus/BACnet devices exposed on the Internet (Shodan) with no authentication.
  • Industroyer/Industroyer2 speak electric protocols (IEC 60870-5-104, IEC 61850) to operate breakers and cause outages.
  • Identify protocols in use (Modbus 502, S7 102, DNP3 20000, EtherNet/IP 44818, BACnet 47808)
  • Passive capture to map peers, FCs, and registers (avoid active scanning in prod)
  • Verify no ICS ports are exposed to the Internet
  • Allowlisting: only authorized peers talk to the PLCs
  • Passive monitoring of unexpected writes/commands
  • Enable secure protocol variants where they exist
  • Tests only in a lab/authorized window