Let's Create a ModbusTest Environment: Virtual Setup, Simulators and Wireshark Analysis Fun!
Let's create a Modbus test environment: Virtual setup, simulators, and Wireshark analysis Fun!
Modbus is one of the most widely used industrial communication protocols in SCADA, PLCs, and IoT devices. Setting up a Modbus test environment allows you to simulate, analyze, and troubleshoot industrial networks.
1. Virtual Environment for Modbus Testing
To create a controlled Modbus test environment, you need a virtualized lab that includes:
- A Modbus server (simulating PLCs or sensors).
- A Modbus client (HMI or SCADA software).
- A network monitoring system (Wireshark) to capture Modbus TCP traffic.
Best Virtualization Tools for Modbus Testing
-
VMware Workstation / VirtualBox → Run multiple VMs for SCADA, PLCs, and clients.
-
Docker → Containerized Modbus server/client testing.
-
EVE-NG / GNS3 → Simulate industrial network topologies for real-world scenarios.
-
Proxmox → High-performance hypervisor for OT security labs.
Recommended Virtual Lab Setup:
-
Windows VM → Run a Modbus master/client tool.
-
Ubuntu VM → Install an open-source Modbus server (e.g., ModbusPal, pymodbus).
-
Kali Linux → Use for penetration testing & traffic analysis.
-
Raspberry Pi (optional) → Simulate a real Modbus RTU slave device.
-
Wireshark → Capture and analyze Modbus TCP packets.
2. Modbus Simulator Tools for Testing
If you don’t have a real PLC, Modbus simulators provide virtual Modbus slaves and masters.
Best Modbus Simulators:
| Tool | Modbus Type | Use Case |
|---|---|---|
| ModbusPal | Modbus TCP & RTU | Simulates Modbus slaves with real-time values. |
| Modscan32 | Modbus TCP & RTU | Reads and writes Modbus registers. |
| ModSim32 | Modbus TCP & RTU | Graphical Modbus slave simulator. |
| pymodbus (Python) | Modbus TCP & RTU | Develops custom Modbus applications. |
| QModMaster | Modbus TCP & RTU | Open-source Modbus master tool. |
| Simply Modbus | Modbus TCP, RTU, ASCII | Great for educational testing. |
| mbpoll | Modbus TCP & RTU | Linux-based command-line Modbus tester. |
How to Use a Modbus Simulator?
-
Install ModbusPal → Simulates a Modbus slave with register values.
-
Use QModMaster → Connect as a Modbus client and read/write data.
-
Capture Modbus TCP communication in Wireshark.
3. Analyzing Modbus Communication PCAP with Wireshark
Wireshark allows you to see real-time Modbus requests and responses, detect security issues, and reverse-engineer Modbus commands.
Fun Modbus Analysis Scenarios in Wireshark:
1. Decoding Modbus TCP Traffic
-
Apply the Wireshark filter: modbus
-
See Modbus function codes (Read Coils, Write Registers, etc.).
-
Analyze how PLC and SCADA systems communicate.
2. Finding Security Weaknesses in Modbus
-
Modbus lacks encryption! Look for plaintext data transfers.
-
Spot unauthorized Modbus write requests from rogue clients.
-
Identify Denial of Service (DoS) attempts against a Modbus slave.
3. Reverse-Engineering Modbus Commands
-
Capture Modbus read/write operations in a PCAP file.
-
Identify critical control signals (e.g., start/stop commands for industrial processes).
-
Understand how PLC registers are modified remotely.
4. Simulating a Man-in-the-Middle (MITM) Attack
-
Use Wireshark + Bettercap to alter Modbus packets in transit.
-
Inject false sensor values (e.g., change pressure readings).
-
Observe how a SCADA system reacts to manipulated data.
Summary: Learn & Have Fun with Modbus Security!
- Create a virtual Modbus test environment using VMs and simulators.
- Use Modbus tools like ModbusPal, QModMaster, and pymodbus.
- Capture & analyze Modbus traffic with Wireshark to detect vulnerabilities.

Comments
Post a Comment