Kuboid
Open Luck·Kuboid.in

There and Back Again: Detecting OT Devices Across Protocol Gateways

DEFCONConference145 views21:536 months ago

This talk demonstrates techniques for identifying and enumerating Operational Technology (OT) devices hidden behind protocol gateways. It focuses on exploiting the inherent design of industrial protocols like Modbus/TCP, DNP3, and EtherNet/IP to perform device discovery and attribute extraction. The presentation highlights how these protocols often lack authentication and rely on predictable addressing, allowing for remote reconnaissance of industrial control systems. The speaker provides a methodology for using these protocol-specific features to map complex industrial networks.

How Protocol Gateways Expose Your OT Infrastructure to Remote Reconnaissance

TLDR: Industrial protocol gateways often lack authentication and rely on predictable addressing, allowing attackers to map hidden OT devices across Modbus/TCP, DNP3, and EtherNet/IP networks. By exploiting these protocol-specific discovery mechanisms, researchers can enumerate internal assets and their configurations without needing specialized hardware. Security teams must prioritize network segmentation and visibility to prevent these gateways from becoming easy entry points for lateral movement.

Operational Technology (OT) environments are no longer the isolated, air-gapped islands they were twenty years ago. The push for efficiency has forced a convergence between IT and OT, leading to the widespread deployment of protocol gateways that bridge legacy serial-based devices with modern IP networks. While these gateways solve the connectivity problem, they frequently introduce a massive, unauthenticated attack surface that most security teams overlook. If you are performing a penetration test on an industrial facility, these gateways are your primary target for mapping the internal network.

The Illusion of Isolation

Many industrial protocols were designed in an era where physical access was the only threat model. Modbus/TCP, for instance, is essentially a serial Modbus frame wrapped in a TCP header. It lacks any concept of authentication or authorization. If you can reach the gateway, you can talk to the devices behind it. The danger lies in the fact that these gateways often act as transparent proxies. When you send a request to a specific unit ID, the gateway forwards it to the corresponding serial device. This design allows an attacker to perform T1595 Active Scanning to identify and enumerate every device on the downstream serial bus from the comfort of the IT network.

Exploiting Protocol-Specific Discovery

The research presented at DEF CON highlights that discovery is not just possible; it is often a built-in feature of the protocols themselves. Take Modbus/TCP as an example. While the base protocol is simple, the Modbus Application Protocol Specification includes an extended function code for "Read Device Identification." By sending an encapsulated interface transport request, you can force the gateway to return vendor names, product codes, and firmware revisions. This is not a vulnerability in the traditional sense; it is a feature of the protocol that was never intended to be exposed to the public internet.

DNP3 presents a different challenge. Because it uses a more complex addressing scheme, you cannot simply brute-force the entire address space without triggering alarms or causing instability. However, many DNP3 devices send unsolicited responses when they are first connected or when their internal state changes. By sniffing these responses, you can identify the device's source address and its primary master, allowing you to spoof the master and query the device for its full attribute list.

Mapping the EtherNet/IP Attack Surface

EtherNet/IP and the Common Industrial Protocol (CIP) are perhaps the most interesting targets for a researcher. CIP is an object-oriented protocol, and it exposes a vast array of objects that describe the device's identity, status, and configuration. The "List Identity" command is a goldmine. When sent as a UDP broadcast, every EtherNet/IP device on the segment will respond with its identity object.

# Example of a CIP List Identity request structure
# Command: List Identity (0x0063)
# Data: None
# Response: Returns Vendor ID, Device Type, Product Code, Revision, and Status

The real power comes when you combine this with source routing. If you have a gateway that connects an EtherNet/IP network to a backplane containing multiple modules, you can use CIP's path construction to route requests through the gateway to the individual modules. You are essentially performing a man-in-the-middle attack on the internal backplane communication. You can query the identity of a motor controller or a PLC module that has no direct IP address, effectively mapping the entire rack from a single entry point.

Practical Engagement Strategy

During a penetration test, your first step should be to identify these gateways. Use tools like runzero to perform a discovery scan of the network. Look for open ports associated with industrial protocols, such as 502 for Modbus/TCP, 20000 for DNP3, or 44818 for EtherNet/IP. Once you identify a gateway, do not just stop at the gateway itself. Use the discovery techniques described above to enumerate the devices behind it.

The impact of this reconnaissance is significant. By mapping the OT network, you can identify critical assets like PLCs that control physical processes. If you can read the device configuration, you can often find hardcoded credentials or identify vulnerable firmware versions that are susceptible to known exploits. This information is the foundation for any successful lateral movement or privilege escalation within an industrial environment.

Defensive Hardening

Defending against this type of reconnaissance requires a shift in how we manage OT networks. First, never expose these gateways directly to the internet. If they must be accessible, use a VPN or a jump host with strict access controls. Second, implement network segmentation to isolate the OT network from the IT network. Use an industrial firewall that can perform deep packet inspection (DPI) to block unauthorized function codes or discovery requests. Finally, ensure that your monitoring tools are configured to alert on unusual traffic patterns, such as a sudden surge in "List Identity" requests or unexpected communication between the IT network and the OT backplane.

The goal is to make the network as opaque as possible to unauthorized users. If you can see the devices, an attacker can too. Start by auditing your gateways and ensuring that you are not broadcasting your internal architecture to anyone who knows how to send a simple CIP request.

Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in