Skip to content

Fix DNP3 detection: duplicate transport kwarg breaks every DNP3 packet#1

Open
fatihpurtas wants to merge 1 commit into
Krishcalin:mainfrom
fatihpurtas:fix/dnp3-detection-transport-kwarg
Open

Fix DNP3 detection: duplicate transport kwarg breaks every DNP3 packet#1
fatihpurtas wants to merge 1 commit into
Krishcalin:mainfrom
fatihpurtas:fix/dnp3-detection-transport-kwarg

Conversation

@fatihpurtas

Copy link
Copy Markdown

Problem

DNP3 is never detected. On any DNP3 capture, devices on port 20000 are
reported with the generic finding "OT-GEN-003 Device on OT Ports,
Protocol Unidentified" instead of DNP3, and none of the DNP3-specific
vulnerability rules (RTU-DNP3-*) fire.

Root cause

In ot_scanner/scanner/protocols/dnp3.py, analyze() builds a details
dict that already contains "transport": proto (line 158), then calls
_make_detection() passing transport=proto explicitly (line 171) plus
**details (line 172). Python raises:

TypeError: _make_detection() got multiple values for keyword argument 'transport'

on every DNP3 packet. The call is wrapped in a try/except in core.py, so
the error is silently swallowed and DNP3 detection produces nothing.

Fix

Remove the redundant explicit transport=proto argument; the value is
already carried in **details.

Verification

Tested against a normal DNP3 capture (opendnp3 full exchange).
Before: protocol_summary is empty, device only carries OT-GEN-003.
After:
protocol_summary = {"DNP3": 1}
device protocols = ["DNP3"]
vulnerability rule RTU-DNP3-001 fires as expected

DNP3Analyzer.analyze() passed `transport` both explicitly and via
**details to _make_detection(), raising TypeError on every DNP3 packet.
core.py swallows the exception, so DNP3 was never detected and devices
fell back to the generic "OT-GEN-003 Protocol Unidentified" finding.
Dropping the redundant transport=proto argument restores DNP3 detection
and the DNP3-specific vulnerability rules (RTU-DNP3-*).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant