Modbus (Modbus) • Peach Pit: Modbus • Direction: Client • Supported Platforms: Windows, Linux, OS X Modbus Protocol is a messaging structure developed by Modicon in 1979. It is used to establish masterslave/client-server communication between intelligent devices. It is a de facto standard, truly open and the most widely used network protocol in the industrial manufacturing environment.
Specifications Specification
Title
http://www.modbus.org/docs/Modbus_Application MODBUS APPLICATION PROTOCOL _Protocol_V1_1b.pdf SPECIFICATION V1.1b http://www.modbus.org/docs/Modbus_over_serial_ MODBUS over serial line specification and line_V1.pdf implementation guide V1.0
Configuration Target Configuration A Modbus server listening on the Modbus port defined in configuration file is required. The network tool socat can be used as the listener.
Required Pit Configuration Changes
2
TargetIPv4 IP address of the target host machine. TargetPort Modbus port number of the target host machine. SerialPort The serial port of the local machine when using Modbus over serial. Baudrate The baud rate for the current serial port. Parity The parity bit value used for the current serial port. DataBits The number of data bits in each character for the current serial port. StopBits Number of bits sent at the end of every character for the current serial port. Handshake The current handshake protocol used by the current serial port.
Optional Pit Configuration Changes Strategy Fuzzing strategy Peach will use for testing. LoggerPath Path to folder where logs will be stored. Timeout How long to wait in milliseconds for incoming data. SendTimeout How long to wait in milliseconds when sending data. ConnectTimeout How long to wait in milliseconds for outgoing connections to complete. PitLibraryPath Path to the relative base directory where all pits are located.
3
Configure Monitoring Monitoring must be configured to provide fault detection, data collection, and automation as needed.
Running Single test debug run Listing 1. Fuzzing modbus via TCP
peach modbus_tcp.xml Listing 2. Fuzzing modbus via ASCII Serial
peach modbus_ascii_serial.xml Listing 3. Fuzzing modbus via RTU Serial
peach modbus_rtu_serial.xml
Full test run Listing 4. Fuzzing modbus via TCP
peach modbus_tcp.xml Listing 5. Fuzzing modbus via ASCII Serial
peach modbus_ascii_serial.xml Listing 6. Fuzzing modbus via RTU Serial
peach modbus_rtu_serial.xml
Examples Example 1. Sample Modbus TCP Configuration File Example configuration using socat on Linux. First we must install and run socat; for this example we assume you are running Linux. For other platforms follow the platform specific installation instructions for socat.