OT Protocol Analysis Report: Modbus, OPC DA & S7

 


Protocol Analysis Report: Modbus, OPC DA, and S7 Communication

1. Introduction

This report provides a detailed analysis of three common industrial communication protocols: Modbus, OPC DA, and S7 Protocol (Siemens S7) using Wireshark and PCAP data. The report includes protocol headers, payload structures, and key features observed during traffic analysis.


2. Modbus Protocol Analysis

2.1 Overview

Modbus is a serial communication protocol widely used in SCADA and ICS networks. It operates over TCP (Modbus/TCP) or serial communication (Modbus RTU/ASCII).

2.2 Key Modbus Header Fields (Modbus/TCP)

  • Transaction ID (2 bytes): Unique ID for request-response mapping.

  • Protocol ID (2 bytes): Always 0x0000 for Modbus.

  • Length (2 bytes): Specifies length of the message.

  • Unit ID (1 byte): Identifies the target device.

  • Function Code (1 byte): Defines the operation (e.g., read, write).

2.3 Common Function Codes

Function CodeOperation
0x01Read Coils
0x02Read Discrete Inputs
0x03Read Holding Registers
0x04Read Input Registers
0x05Write Single Coil
0x06Write Single Register
0x0FWrite Multiple Coils
0x10Write Multiple Registers

2.4 Payload Analysis

  • Request Payload: Contains function code and data (e.g., register addresses, values).

  • Response Payload: Contains function code and requested data or error codes.

2.5 Sample Wireshark Capture

Example packet from a Modbus Read Holding Registers (0x03) request:

Transaction ID: 0x0001
Protocol ID: 0x0000
Length: 0x0006
Unit ID: 0x01
Function Code: 0x03 (Read Holding Registers)
Start Address: 0x0000
Register Count: 0x0002

3. OPC DA (OLE for Process Control - Data Access) Analysis

3.1 Overview

OPC DA is a Microsoft COM/DCOM-based protocol for real-time data exchange between SCADA, HMI, and PLCs.

3.2 Key OPC DA Communication Features

  • Uses DCOM for communication, making it difficult to analyze directly in Wireshark.

  • Implements Remote Procedure Calls (RPC) over TCP port 135.

  • Relies on CLSID (Class Identifiers) to locate OPC servers.

  • Traffic is often encrypted, requiring decryption for deep analysis.

3.3 OPC DA Header Fields

  • Interface UUID: Identifies OPC services.

  • Opnum: Defines operation (e.g., read, write, browse).

  • Object References: Indicates OPC server or data point reference.

  • Timestamps & Data Quality: Ensures real-time accuracy.

3.4 Sample Wireshark Capture

Example OPC DA Read Item Value request:

UUID: 9dd0b56c-ad9e-43ee-8305-487f3188bf7a (OPC Data Access Server)
Opnum: 6 (Read)
Item ID: \Server\Tag1
Quality: Good (0xC0)
Timestamp: 2024-03-27T14:23:55.000Z
Value: 125.5

4. Siemens S7 Protocol Analysis

4.1 Overview

S7 Protocol is used for communication between Siemens PLCs and SCADA systems over TCP/IP (port 102).

4.2 Key S7 Header Fields

  • Message Type: Identifies request/response type.

  • ROSCTR (Request-Response Control):

    • 1 (Job Request)

    • 3 (Ack)

    • 7 (User Data)

  • PDU Reference: Used for tracking request-response pairs.

  • Parameter Data: Defines read/write operations.

  • Payload Data: Contains actual PLC register values.

4.3 Common S7 Operations

Function Code
Operation Type
0x04Read Variable
0x05Write Variable
0x28PLC Control
0x29PLC Stop

4.4 Sample Wireshark Capture

Example packet for an S7 Read Request:

Message Type: Job Request (0x32)
ROSCTR: 0x01 (Request)
PDU Reference: 0x1234
Function Code: 0x04 (Read Variable)
Variable Type: DB (Data Block)
DB Number: 1
Start Address: 10
Length: 4 bytes

5. Conclusion

This analysis provides key insights into Modbus, OPC DA, and S7 traffic patterns. Understanding their headers and payload structures allows for:

  • Efficient troubleshooting of industrial network issues.

  • Intrusion detection and anomaly identification in ICS networks.

  • Better cybersecurity defense against protocol-specific attacks.

For further investigations, advanced packet filtering, deep packet inspection (DPI), and IDS rules should be implemented to detect unauthorized or malicious activity in OT environments.


Appendices

  • Wireshark Display Filters:

    • modbus (Modbus/TCP traffic)

    • tcp.port==135 (OPC DA traffic)

    • s7comm (Siemens S7 traffic)

Comments

Popular posts from this blog

Don't confuse DCS, PLC and SCADA in front of OT specialists

Top 20 Threat Scenarios & Playbooks for OT Security

Let's create our own ICS Labs in the VMs!