Skip to content

Add OPC-UA server detection auxiliary scanner module#21612

Open
ethan-thomason wants to merge 1 commit into
rapid7:masterfrom
ethan-thomason:opcua-clean
Open

Add OPC-UA server detection auxiliary scanner module#21612
ethan-thomason wants to merge 1 commit into
rapid7:masterfrom
ethan-thomason:opcua-clean

Conversation

@ethan-thomason

Copy link
Copy Markdown

Summary

Adds auxiliary/scanner/scada/opcua_enum, a scanner module that detects OPC-UA servers speaking the OPC-UA TCP binary transport (opc.tcp://). OPC-UA (IEC 62541) is the dominant interoperability standard across industrial automation — PLCs, SCADA platforms, historians, and gateway products — and is currently unrepresented in the framework. The scada/ scanner directory covers Modbus, BACnet, Profinet, Digi, Moxa, and Koyo, but has no OPC-UA coverage. A grep -ril "opc" modules/ returns nothing.

How it works

The module sends an OPC-UA Hello (HEL) message and inspects the response per OPC-UA Specification Part 6 (Connection Protocol message framing):

  • ACK — server accepted the connection; reports the advertised ProtocolVersion and receive/send buffer sizes.
  • ERR — also confirms an OPC-UA server; decodes and reports the StatusCode and reason string.
  • Anything else is a non-detection, keeping the fingerprint tight.

Detected servers are recorded in the database as an opc-ua service.

Notes for reviewers

  • No new dependencies. The HEL/ACK/ERR framing is built byte-by-byte with pack/unpack, in the style of the existing iec104 and modbusdetect modules. No gems added.
  • CRASH_SAFE — a single HEL probe is a read-only fingerprint; it does not open a secure channel or session.
  • RPORT defaults to 4840 (the IANA-registered OPC-UA port). The accompanying documentation notes that Inductive Automation Ignition runs its OPC-UA server on 62541 by default and binds to localhost unless reconfigured — operator detail captured in the module docs.

Testing

  • rubocop — clean
  • tools/dev/msftidy.rb — clean
  • Verified against a live Inductive Automation Ignition 8.3.4 OPC-UA server:
[+] 10.10.0.3:62541 - OPC-UA server detected (ACK) - ProtocolVersion=0 RecvBuf=65535 SendBuf=65535

Future work

This v1 is deliberately a minimal detection probe (mirroring modbusdetect's scope). Follow-up PRs will add OPC-UA GetEndpoints enumeration (security policies, endpoint listing) and anonymous-session checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants