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
- You have SSH access to the EWS (engineer@10.0.3.20)
- The Process network is at 10.0.4.x
- Kali can’t reach 10.0.4.x directly - firewall blocks it
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:
- Decode the message from the counter ASCII values
- Calculate the DNP3 CRC-16 of that message
- Write the CRC value back to the outstation
The tool does NOT calculate CRC for you - you must write your own.