iburres/ics-simulator

GitHub: iburres/ics-simulator

免费开源的 ICS/SCADA 网络安全培训平台,基于 Electron 和 Docker 在笔记本上构建真实工控协议流量的攻防演练环境。

Stars: 0 | Forks: 0

# ICS Simulator [![Build](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/db00e3aef7035120.svg)](https://github.com/iburres/ics-simulator/actions/workflows/build.yml) [![Docker Images](https://static.pigsec.cn/wp-content/uploads/repos/2026/05/546dea63d2035120.svg)](https://github.com/iburres/ics-simulator/actions/workflows/docker.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) 一个面向研究人员、教育工作者和学生的免费开源 ICS/SCADA 网络安全培训平台。在您的笔记本电脑上构建真实的工业控制系统环境 —— 无需硬件、无需订阅、完全免费。 由德克萨斯大学圣安东尼奥分校 (UTSA) 实践教授 **Ian Burres** 开发,旨在支持 ICS/SCADA 安全教育与研究。 ## 功能简介 ICS Simulator 允许您使用可视化的拖拽画布来设计、部署和攻击真实的 ICS/SCADA 环境。场景中的每个设备都在隔离的虚拟网络上作为真实的 Docker 容器运行 —— 协议流量是真实的,而不是在应用层模拟的。 **编写场景** → 将 PLC、RTU、IED、传感器和网络设备拖放到画布上,用协议边将它们连接起来,编写 IEC 61131-3 梯形图逻辑,配置防火墙 —— 然后点击 **Run**。Docker Compose 会在几秒钟内启动完整的环境。 **攻击场景** → 打开内嵌的 Kali Linux 终端或完整的 Xfce4 桌面(包含 Wireshark、Armitage、Metasploit)并执行攻击任务。 **监控与分析** → 实时的 Grafana 仪表盘会显示 Suricata IPS 告警和 Zeek 协议日志,并与 InfluxDB 过程历史数据库同步展示。 ## 功能特性 ### 可视化场景构建器 - 支持拖拽的 SCADA 画布,包含 ISA-5.1 / IEC 81346 标准 P&ID 符号 - 四区域 Purdue Model 网络拓扑 (OT / IT / DMZ / External) - 区域感知的防火墙规则编辑器 - 将场景导出为 `.icslab` 文件 —— 可与学生或社区共享 ### PLC IDE - 带有语法高亮的 Structured Text (ST) 编辑器 - SVG 梯形图逻辑查看器 - 通过 web API 实时部署到正在运行的 OpenPLC Runtime 容器 - 兼容 IEC 61131-3 标准 (Ladder、ST、FBD、SFC、IL) ### 攻击机 — 混合终端 - **Terminal 选项卡:** 在 Electron 窗口中提供基于 xterm.js 的交互式 bash 会话 - **Desktop 选项卡:** 通过内嵌的 noVNC 提供完整的 Xfce4 桌面(包含 Wireshark GUI、Armitage、Firefox) - 预装 Kali Linux 及完整的 ICS 专用工具包(见下文) ### 安全监控 - 带有 Emerging Threats ICS 规则集的 Suricata IPS(支持 Modbus、DNP3、EIP 异常检测) - 带有 ICS 协议脚本的 Zeek 深度数据包分析 - 用于实时告警可视化的 Grafana 仪表盘 - InfluxDB 1.8 过程历史数据库 ## 协议支持 在 Docker 虚拟网络上会传输真实的协议数据包 —— 扫描工具和漏洞利用框架可以获取到真实的服务指纹。 | Protocol | Implementation | Port | |---|---|---| | Modbus TCP / RTU / ASCII | pymodbus (Python) | TCP 502 | | DNP3 | OpenDNP3 (C++) | TCP 20000 | | OPC UA | node-opcua (Node.js) | TCP 4840 | | BACnet/IP | bacpypes (Python) | UDP 47808 | | Ethernet/IP CIP | cpppo (Python) | TCP 44818 | | IEC 61850 | libiec61850 (C) | TCP 102 | ## 攻击工具包 (Kali Linux 容器) | Category | Tools | |---|---| | Reconnaissance | nmap, masscan, netdiscover, arp-scan | | Packet analysis | Wireshark (GUI), tshark, tcpdump, Scapy | | Exploitation | Metasploit Framework, Armitage (GUI) | | Credentials | Hydra, Medusa, Patator, John the Ripper, Hashcat | | ICS/OT specific | pymodbus, dnp3-python, opcua, bacpypes3, python-snap7, impacket, ike-scan | | Desktop | Xfce4 via noVNC — accessible directly in the Electron app | ## 系统要求 | Requirement | Minimum | |---|---| | OS | Windows 10/11, macOS 13+, Ubuntu 22.04+ | | RAM | 8 GB (建议 16 GB,以运行包含攻击机的场景) | | Disk | 20 GB 可用空间 (Docker 镜像将在首次运行时下载) | | Docker Desktop | Latest stable | | Node.js | 20+ (仅用于开发) | ## 快速开始 ### 从源码运行 ``` git clone https://github.com/iburres/ics-simulator.git cd ics-simulator npm install npm run dev ``` 在启动应用程序之前,必须确保 Docker Desktop 正在运行。 ### 构建可分发程序 ``` # Windows npm run build:win # macOS npm run build:mac # Linux npm run build:linux ``` ## 项目结构 ``` ics-simulator/ ├── packages/ │ ├── app/ # Electron application │ │ └── src/ │ │ ├── main/ # Node.js main process (IPC, Docker, OpenPLC API) │ │ ├── preload/ # contextBridge API surface │ │ └── renderer/ # React + TypeScript UI │ │ └── src/ │ │ ├── canvas/ # React Flow SCADA canvas │ │ ├── palette/ # Device palette (ISA-5.1 symbols) │ │ ├── properties/ # Device inspector panel │ │ ├── terminal/ # Attack terminal modal (xterm.js + noVNC) │ │ └── icons/ # SVG device icons │ ├── orchestrator/ # Docker Compose generator + DockerClient │ └── schema/ # Shared TypeScript types (ICSLabScenario, DeviceConfig…) ├── containers/ # Docker image source (one per device category) │ ├── attack-base/ # Kali Linux — attack machine │ ├── modbus/ # pymodbus Modbus server │ ├── dnp3/ # OpenDNP3 outstation │ ├── openplc/ # OpenPLC Runtime │ ├── suricata/ # Suricata IPS with ICS rules │ ├── zeek/ # Zeek network monitor │ ├── firewall/ # nftables firewall │ ├── router/ # Inter-zone router │ └── switch/ # Layer-2 switch └── .github/ └── workflows/ # CI: build, Docker image publish, CodeQL, secret scan ``` ## 场景格式 场景会被保存为 `.icslab` JSON 文件,包含以下四个层级: ``` { "meta": { "name": "Water Treatment Plant", "sector": "water", "version": "1.0" }, "visual": { "nodes": [...], "edges": [...] }, "network": { "segments": [...], "protocolEdges": [...] }, "devices": { "devices": { "plc-1": { ... }, "rtu-1": { ... } } }, "security": { "firewallRules": [...], "idsConfig": { ... } } } ``` 欢迎与社区共享您的场景 —— 请向 [ics-sim-scenarios](https://github.com/iburres/ics-sim-scenarios) 仓库提交 Pull Request(即将推出)。 ## 开发状态 | Phase | Feature | Status | |---|---|---| | 0 | Electron shell, Docker check, first-launch flow | ✅ Complete | | 1 | Orchestration engine (Compose generator, LevelDB, resource estimator) | ✅ Complete | | 2 | SCADA canvas (React Flow, ISA-5.1 icons, zones, drag-drop) | ✅ Complete | | 3 | Container images (9 GHCR images, GitHub Actions CI/CD) | ✅ Complete | | 4 | PLC IDE (ST editor, ladder viewer, variable bindings, live deploy) | ✅ Complete | | — | Attack terminal (xterm.js + noVNC Xfce4 desktop) | ✅ Complete | | 5 | DNP3 IED auto-config + security stack UI (FirewallPanel, IDSPanel, nftables/Suricata/Zeek orchestration) | ✅ Complete | | — | Connection validation — Purdue Reference Model matrix (IEC 62443-3-2 / NIST SP 800-82); invalid targets dimmed + educational tooltip | ✅ Complete | | 6 | Monitoring panels — Grafana ICS Lab Overview dashboard (Electron webview) + native Loki log viewer with Suricata/Zeek per-source colour coding and Promtail sidecar | ✅ Complete | | 7 | FUXA HMI embed + student mission brief panel | 🔜 Next | | 8 | Author / Student mode split + locked scenario distribution | 🔜 Planned | | 9 | Community scenario pack format | 🔜 Planned | | 10 | Conpot legacy device emulation (Siemens S7, IEC 104) | 🔜 Planned | | 11 | Physical process simulation (tank, pump, valve dynamics) | 🔜 Planned | | 12 | macOS + Linux packaging and distribution | 🔜 Planned | ## 开源组件 如果没有以下这些开源工具,这个项目将无法实现: | Component | Role | License | |---|---|---| | [OpenPLC Runtime](https://github.com/thiagoralves/OpenPLC_v3) | IEC 61131-3 PLC execution engine | GPL-3.0 | | [FUXA](https://github.com/frangoteam/FUXA) | Web-based SCADA/HMI | MIT | | [Suricata](https://github.com/OISF/suricata) | Network IPS / IDS | GPL-2.0 | | [Zeek](https://github.com/zeek/zeek) | Network traffic analysis | BSD-3 | | [Grafana](https://github.com/grafana/grafana) | Dashboards and visualization | AGPL-3.0 | | [Loki](https://github.com/grafana/loki) | Log aggregation | AGPL-3.0 | | [InfluxDB 1.8](https://github.com/influxdata/influxdb) | Time-series process historian | MIT | | [React Flow](https://github.com/xyflow/xyflow) | SCADA canvas | MIT | | [xterm.js](https://github.com/xtermjs/xterm.js) | Terminal emulator | MIT | | [noVNC](https://github.com/novnc/noVNC) | Browser-based VNC client | MPL-2.0 | | [Kali Linux](https://www.kali.org) | Penetration testing OS | Various | Third-party Docker images are pulled from public registries at runtime and are not bundled in this repository. ## 贡献 欢迎各种形式的贡献 —— Bug 报告、新的设备类型、场景包、协议实现以及文档改进都非常有价值。 1. Fork 该仓库 2. 创建一个功能分支 (`git checkout -b feature/dnp3-master-station`) 3. 提交您的更改,并附带清晰的提交信息 4. 发起一个 Pull Request 对于较大的更改,请先提出 Issue 以讨论实现方案。 ## 许可证 Application source code: [MIT](LICENSE) Runtime Docker images are governed by their own licenses — see the [LICENSE](LICENSE) file for a full list. ## 作者 **Ian Burres** Professor of Practice — Cybersecurity, University of Texas at San Antonio (UTSA) Former: Sandia National Laboratories ORCID: [0009-0006-1320-9956](https://orcid.org/0009-0006-1320-9956)
标签:Docker, Electron, Grafana, ICS, IEC 61131-3, impacket, InfluxDB, IP 地址批量处理, Metaprompt, MITM代理, MIT协议, NTLM Relay, PKINIT, PLC, Rootkit, SCADA, Suricata, TGT, Wireshark, Zeek, 句柄查看, 哈希传递, 安全培训, 安全防御评估, 密码管理, 工业互联网, 工控协议, 工控安全, 开源, 攻防演练, 普渡模型, 梯形图, 现代安全运营, 系统分析, 网络分析, 网络安全教育, 网络安全靶场, 自动化攻击, 虚拟化, 请求拦截, 逆向工具, 防御绕过