
# opcua_server_sim.py - OPC UA server accepting None security policy
from asyncua import Server
import asyncio
async def main():
server = Server()
await server.init()
server.set_endpoint('opc.tcp://0.0.0.0:4840/freeopcua/server/')
server.set_security_policy([ua.SecurityPolicyType.NoSecurity]) # Allows unencrypted, unauthenticated
async with server:
while True:
await asyncio.sleep(1)
asyncio.run(main())
OPC UA 服务器配置了 None 安全策略,该策略不提供任何加密或身份验证。网络上的攻击者可以连接并操控工业控制系统标签,从而造成物理损坏。
pip install asyncua
python opcua_server_sim.py
python exploit_opcua_none.py
客户端连接成功。