
# 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())
An OPC UA server is configured with the None security policy, which provides no encryption or authentication. An attacker on the network can connect and interact with industrial control system tags, causing physical damage.
pip install asyncua
python opcua_server_sim.py
python exploit_opcua_none.py
The client connects successfully.