ICS Protocol Security: Modbus, DNP3, S7, EtherNet/IP, OPC UA
Why Modbus/TCP, DNP3, S7comm and EtherNet/IP are insecure by design, which secure variants exist, how OPC UA security modes work and how to monitor them.
Industrial protocols were designed to move process data reliably between controllers, HMIs and field devices on isolated networks. Authentication, encryption and authorization were not part of the requirements. Most of these protocols now run over TCP/IP, often on networks that are reachable from IT, and their original design still dominates installed bases.
This guide explains what is wrong with the most common protocols, what their secure variants offer, how to read them in a packet capture, and what you can do today. Port numbers below are taken from the IANA service name registry.
The common weakness
Classic ICS protocols share four properties:
- No authentication of the sender. A device accepts a valid command from anyone who can reach it on the network.
- No integrity protection. Messages can be modified in transit by anyone in the path.
- No authorization model. If you can read, you can usually write, and often also download logic or stop the CPU.
- Powerful engineering functions on the same port as normal operations. The service used to poll a register is often the one used to reprogram the controller.
So the practical security boundary for most ICS protocols is network reachability. Anyone who can send packets to TCP 502 on a PLC can, in most cases, change its outputs. MITRE ATT&CK for ICS describes this as Unauthorized Message: Command Message (T1692.001), and the impact as Manipulation of Control (T0831).
Modbus/TCP
Modbus dates from 1979 and remains the most widely supported industrial protocol. Modbus/TCP wraps the protocol data unit in a 7-byte MBAP header (transaction ID, protocol ID, length, unit ID) and runs on TCP 502.
Function codes you will see most often:
| Code | Function | Risk |
|---|---|---|
| 1, 2 | Read Coils, Read Discrete Inputs | Reconnaissance |
| 3, 4 | Read Holding Registers, Read Input Registers | Reconnaissance |
| 5, 6 | Write Single Coil, Write Single Register | Direct process change |
| 15, 16 | Write Multiple Coils, Write Multiple Registers | Direct process change |
| 43 (MEI 14) | Read Device Identification | Fingerprinting |
There is no session, no login and no notion of user. Many vendors add proprietary function codes for programming, which also run over port 502.
Secure variant: the Modbus Organization published Modbus/TCP Security, which wraps Modbus in TLS with mutual X.509 certificate authentication and can carry a role in the certificate for authorization. IANA assigns it TCP 802 (mbap-s). Support in field devices is still limited, so plan for unauthenticated Modbus for years.
Monitoring: in Wireshark, show all writes with:
modbus.func_code in {5 6 15 16}
With Zeek, the built-in Modbus analyzer logs function codes in modbus.log. Alert on writes from any host that is not an approved HMI or SCADA server, and on any traffic to TCP 502 from outside the control zone.
DNP3
DNP3 (IEEE 1815) is common in electric, water and oil and gas SCADA, where masters at a control center poll outstations (RTUs, IEDs) over serial links, radios and IP. Over IP it uses TCP or UDP 20000.
DNP3 has richer semantics than Modbus: event buffers, timestamps, unsolicited reporting, and a two-step select-before-operate for controls. Security-relevant application layer function codes include:
| Code | Function |
|---|---|
| 0x03, 0x04 | Select, Operate |
| 0x05 | Direct Operate |
| 0x0D, 0x0E | Cold Restart, Warm Restart |
| 0x12 | Stop Application |
| 0x15 | Disable Unsolicited Messages |
Without additional security, any device that can reach an outstation can issue these.
Secure variants: DNP3 Secure Authentication (version 5 is included in IEEE 1815-2012) adds HMAC-based challenge and response for critical functions such as operates and restarts, with key management for update keys. It authenticates, it does not encrypt. For confidentiality and transport integrity, DNP3 can run over TLS following IEC 62351-3. IANA also registers port 19999 (dnp-sec). Check what your RTUs actually support before designing around it.
Monitoring:
dnp3.al.func in {0x03 0x04 0x05 0x0d 0x0e 0x12}
Zeek ships a DNP3 analyzer that writes dnp3.log. A sudden restart or a burst of direct operates from an unexpected master is worth an immediate call to operations.
S7comm and S7CommPlus
The S7 protocol family is used by one major vendor's controllers. Classic S7comm (protocol ID 0x32) runs over ISO-on-TCP (RFC 1006, TPKT and COTP) on TCP 102. Its job functions include reading and writing variables, uploading and downloading program blocks, and starting or stopping the CPU. Older CPUs accept these from any client unless a protection level password is set, and even then early password schemes were weak.
Useful Wireshark filters:
s7comm.param.func == 0x05 # Write Var
s7comm.param.func in {0x1a 0x1b 0x1c} # block download sequence
s7comm.param.func == 0x29 # PLC Stop
Newer controller families use S7CommPlus (protocol ID 0x72), which added integrity protection and session handling, and current firmware and engineering versions support TLS-protected communication for programming and HMI connections. Researchers have repeatedly found weaknesses in earlier S7CommPlus versions, so the vendor's current hardening guide, firmware and access protection settings matter. Stuxnet abused this family by replacing the engineering library that talks S7 to the PLC, described in ICS attack case studies.
Note that IEC 61850 MMS also uses TCP 102, so a port number alone does not identify the protocol.
EtherNet/IP and CIP
EtherNet/IP carries the Common Industrial Protocol (CIP) over Ethernet. It has two traffic types:
- Explicit messaging (request and response, configuration, tag reads and writes) on TCP 44818, with UDP 44818 used for discovery such as ListIdentity.
- Implicit (I/O) messaging, cyclic real-time data, on UDP 2222.
Encapsulation commands include ListIdentity (0x0063), RegisterSession (0x0065), SendRRData (0x006F) and SendUnitData (0x0070). Inside, CIP service codes define the action, for example Get Attribute Single (0x0E), Set Attribute Single (0x10), Forward Open (0x54) and Reset (0x05). Controller families add their own services for tag reads and writes and for program changes.
As with Modbus, standard EtherNet/IP has no authentication. Anyone reaching TCP 44818 can enumerate the device, and often reset it or change configuration.
Secure variant: ODVA's CIP Security adds TLS for explicit messaging and DTLS for implicit messaging, device identity through certificates or pre-shared keys, and later profiles for user authentication and authorization. IANA lists ethernet-ip-s on TCP 2221 (TLS) and UDP 2221 (DTLS). Adoption depends on controller and module support, and many sites deploy it through a CIP Security proxy in front of legacy devices.
Monitoring:
enip.command == 0x0063 # ListIdentity, discovery or scanning
cip.sc in {0x05 0x10} # Reset, Set Attribute Single
CISA's ICSNPP project provides Zeek parsers for EtherNet/IP and CIP, S7comm, BACnet and other protocols. See OT asset inventory with passive network monitoring for deployment.
OPC UA: security built in, if you turn it on
OPC UA was designed with security from the start, which makes it different from the protocols above. The binary protocol uses TCP 4840 by default (opcua-tcp), with 4843 registered for OPC UA over TLS. Security is defined in OPC 10000-2 (Security Model) and the security policies in the profiles part.
Three layers matter.
Message security mode (per endpoint):
None: no signing, no encryption. Anyone on the path can read and modify.Sign: messages are signed, so tampering is detected, but content is readable.SignAndEncrypt: messages are signed and encrypted.
Security policy (the algorithm suite):
Basic128Rsa15andBasic256: deprecated because of SHA-1 and weak padding. Disable them.Basic256Sha256: widely supported current baseline.Aes128_Sha256_RsaOaepandAes256_Sha256_RsaPss: newer RSA-based policies, preferred where both sides support them.- Elliptic curve policies such as
ECC_nistP256exist in recent specification versions; check stack support.
User authentication (separate from the secure channel): Anonymous, UserName and password, X.509 user certificate, or an issued token. The application instance certificate authenticates the application, not the person.
Common misconfigurations found in assessments:
- Servers that still expose a
Noneendpoint "for compatibility", which clients then pick. - Clients configured to auto-accept any server certificate, which removes protection against man-in-the-middle.
- Anonymous user access enabled with write permissions on nodes.
- Default or shared certificates across devices, and no process to renew expiring certificates.
A hardened server configuration expresses the same intent across stacks:
Endpoints: opc.tcp://<host>:4840
SecurityModes: SignAndEncrypt (Sign only where needed)
SecurityPolicies: Basic256Sha256, Aes256_Sha256_RsaPss
UserTokens: UserName, X509 (Anonymous disabled)
Trust: explicit trust list, rejected certificates reviewed
In Wireshark, opcua.MessageSecurityMode and opcua.SecurityPolicyUri show what a session actually negotiated, which is the quickest way to find clients that fall back to None.
Even correctly configured OPC UA is only as strong as its credentials. In the 2022 CISA advisory on the tool set tracked as PIPEDREAM or INCONTROLLER, the OPC Foundation pointed out that the OPC UA module used the protocol as designed with credentials obtained by other means. Protect accounts and certificates as you would any privileged credential.
Other protocols you will meet
| Protocol | Typical use | Transport |
|---|---|---|
| IEC 60870-5-104 | Power grid telecontrol | TCP 2404 |
| IEC 61850 MMS | Substation automation | TCP 102 |
| IEC 61850 GOOSE, SV | Substation protection | Layer 2 multicast |
| BACnet/IP | Building automation | UDP 47808 |
| PROFINET | Factory automation | Layer 2 real-time, plus UDP 34964 for context management |
IEC 62351 defines security extensions for several power system protocols, including TLS profiles and authentication for GOOSE. Like the others, adoption is gradual.
What to do now
You will not replace insecure protocols quickly, so build defenses around them:
- Restrict reachability. Only approved HMIs, SCADA servers and engineering workstations should reach controller ports. Enforce it with zone firewalls. See OT network segmentation.
- Use protocol-aware filtering where it is safe. Industrial firewalls and deep packet inspection can allow reads but block writes, programming or stop commands from all but one engineering workstation.
- Use controller protections. Physical key switches in RUN, CPU access protection levels, write-protect settings and disabled unused services (web servers, FTP, SNMP write).
- Enable secure variants on new projects. Specify Modbus/TCP Security, DNP3 SA or TLS, CIP Security, S7 with TLS and OPC UA SignAndEncrypt in procurement requirements, mapped to IEC 62443-4-2 component requirements. See IEC 62443 explained.
- Monitor passively. Baseline which hosts talk which protocols and function codes, then alert on writes, program downloads, mode changes and new talkers. Map detections to MITRE ATT&CK for ICS.
- Never actively fuzz or scan production controllers to "test" protocol exposure. Use a bench device. The reasons are covered in OT vs IT security.
References
- IANA Service Name and Transport Protocol Port Number Registry
- Modbus Application Protocol Specification V1.1b3 (Modbus Organization)
- DNP Users Group
- ODVA: CIP Security
- OPC 10000-2: OPC UA Security Model (OPC Foundation reference)
- BSI: Security Analysis of OPC UA (2022)
- CISA ICSNPP: Zeek parsers for ICS protocols
- Zeek Modbus analyzer documentation
- Wireshark display filter reference: S7comm
- CISA AA22-103A: APT Cyber Tools Targeting ICS/SCADA Devices