Sysrupt Portable OT Range

ICS/SCADA Cybersecurity Training Platform

View on GitHub

Challenge 5 - Deep Protocol: DNP3

Points: 400
Protocol: DNP3 (Distributed Network Protocol 3)
Difficulty: Advanced


The Story

You’ve reached the SCADA zone. From the Engineering Workstation, you can see the Process network where the actual PLCs run. One of them speaks a protocol used in power grids and water systems worldwide. It’s time to go deep into industrial protocol territory.

What You Know

Step 1: Scan the Process Network

You need to scan from the EWS, or set up tunnels from Kali.

Hint: Set up a double SSH tunnel - Kali → Jump Host → EWS.

Tunnel commands? ```bash # Tunnel 1: Reach EWS SSH through Jump Host sshpass -p 'maint2024!' ssh -f -N -L 2222:10.0.3.20:22 maintenance@10.0.2.20 # Now you can SSH to EWS via localhost:2222 sshpass -p 'eng2024!' ssh -p 2222 engineer@127.0.0.1 'nmap -sT 10.0.4.0/24 2>/dev/null' ```

What to look for: Multiple PLCs on different ports. One of them is on port 20000.

Step 2: Identify the Protocol

Port 20000 isn’t standard for Modbus (502) or EtherNet/IP (44818). Research what SCADA protocol uses port 20000.

Hint: It’s a protocol designed by GE for electric utilities, now used worldwide in water and power.

Answer DNP3 (Distributed Network Protocol 3) - commonly on port 20000. Used in the Ukraine power grid attack (2015).

Step 3: Set Up a Tunnel and Connect

Forward port 20000 through the EWS to Kali.

Tunnel command? ```bash sshpass -p 'eng2024!' ssh -f -N -L 20000:10.0.4.103:20000 -p 2222 engineer@127.0.0.1 ```

Now use the DNP3 tool to scan and read:

python3 ~/tools/dnp3-tool.py -t 127.0.0.1 -c scan
python3 ~/tools/dnp3-tool.py -t 127.0.0.1 -c read

Step 4: Analyze the Data

The read command returns binary inputs, analog inputs, and counters. Look at the counter values carefully.

Hint: The counter values are small numbers. Could they represent something other than counts?

Another hint Look at the ASCII column next to each counter value. What do the characters spell?

Step 5: The CRC Challenge

DNP3 uses CRC-16 checksums for data integrity. The counter values encode a message. To prove you understand the protocol, you need to:

  1. Decode the message from the counter ASCII values
  2. Calculate the DNP3 CRC-16 of that message
  3. Write the CRC value back to the outstation

The tool does NOT calculate CRC for you - you must write your own.

CRC-16-DNP algorithm ```python python3 -c " data = b'' crc = 0 for byte in data: crc ^= byte for _ in range(8): if crc & 1: crc = (crc >> 1) ^ 0xA6BC else: crc >>= 1 crc = (crc ^ 0xFFFF) & 0xFFFF print('CRC:', crc) " ``` </details> ## Step 6: Send the CRC Use the DNP3 tool's operate command with your calculated CRC value.
Command? ```bash python3 ~/tools/dnp3-tool.py -t 127.0.0.1 -c operate -v ``` </details> If the CRC is correct, the outstation returns the flag in its response. --- ## What You Learned - SSH tunneling chains let you reach isolated networks - DNP3 is used in power grids, water systems, oil/gas pipelines - DNP3 organizes data as binary inputs, analog inputs, and counters - CRC-16 provides data integrity but NOT security - No authentication on control commands - anyone can operate equipment ## Scoreboard Updates when the correct CRC value is written to the outstation.