frangelbarrera/IndustrialScanner-Lite
GitHub: frangelbarrera/IndustrialScanner-Lite
一款面向工业控制系统(ICS/OT)的模块化安全扫描工具,支持 Modbus、S7Comm 和 DNP3 协议的只读扫描与被动流量分析,并生成结构化报告与高管仪表板。
Stars: 9 | Forks: 0
# IndustrialScanner-Lite
## 简介
**IndustrialScanner-Lite** 是一个专为**工业控制系统 (ICS)** 和**运营技术 (OT)** 环境设计的模块化网络安全与自动化工具包。
这些系统是**变电站、制造工厂、水处理设施和关键基础设施**的骨干,它们使用 **Modbus/TCP、Siemens S7Comm 和 DNP3** 等专用通信协议,而非传统的 IT 协议。
与传统的 IT 网络不同,ICS/OT 环境将**可用性和安全性**置于速度或便利性之上。一次单一的配置错误或恶意指令就可能导致生产线中断、变电站停运,或危及操作人员的安全。
本项目通过提供一套**安全、只读且自动化的分析套件**来应对这一挑战,该套件能够:
- 扫描并模拟工业设备(例如,用于 Modbus/TCP 的 **ModbusPal**)。
- 处理来自真实 ICS 流量的 S7Comm 和 DNP3 **数据包捕获 (PCAPs)**。
- 生成标准化的 **JSON 和 HTML 报告**,供取证和合规使用。
- 构建**高管仪表板**,提供汇总的指标和可视化效果,以便快速做出决策。
其目标是**弥合网络安全实践与工业自动化现实之间的差距**,让专业人士清楚地了解如何调整现代安全工具以保护关键基础设施系统。
## 快速开始
```
# Clone repository
git clone https://github.com//IndustrialScanner-Lite.git
cd IndustrialScanner-Lite
# Install dependencies
pip install -r requirements.txt
# Example: Run a Modbus scan (with ModbusPal)
python -m modbus_scanner.modbus_scan --targets 127.0.0.1 --unit 1
# Example: Process S7 PCAPs and build dashboard
python run_dnp3_all.py
python build_s7_index.py
Dashboards will be generated in the `reports/` folder as HTML files.
---
## Features and Modules
| Module | Purpose | Input type | Output | Run style |
|---|---|---|---|---|
| `modbus_scanner` | Active, read-only Modbus/TCP scanner (safe probes) | Live targets (IP/port), ModbusPal | JSON + HTML | Python CLI |
| `s7_comm_analyzer` | Passive analyzer for S7Comm traffic | PCAP files | JSON + HTML | Batch runner + Python |
| `dnp3_monitor` | Passive analyzer for DNP3 traffic | PCAP files | JSON + HTML | Batch runner + Python |
| `build_*_index.py` | Per-protocol dashboards with charts | Folder of JSON reports | HTML dashboard | Python script |
| `build_global_index.py` | Minimal executive meta-dashboard | Per-protocol indices | HTML dashboard | Python script |
> The suite intentionally separates **“report generation”** from **“dashboard building.”**
> Scanners/analyzers produce per-file reports. Index builders read those reports and create consolidated views.
---
## Project Structure
```text
IndustrialScanner-Lite/
├─ modbus_scanner/
│ ├─ modbus_scan.py # Active read-only scanner
│ └─ utils.py
├─ s7_comm_analyzer/
│ ├─ s7_analyze.py # PCAP → JSON/HTML reports
│ └─ parsers.py
├─ dnp3_monitor/
│ ├─ dnp3_analyze.py # PCAP → JSON/HTML reports
│ └─ parsers.py
├─ pcaps/ # Sample PCAPs for testing
│ ├─ s7/
│ ├─ dnp3/
│ └─ modbus/
├─ reports/ # JSON + HTML outputs
│ ├─ modbus_batch/
│ ├─ s7_batch/
│ ├─ dnp3_batch/
│ ├─ templates/
│ ├─ modbus_index.html
│ ├─ s7_index.html
│ ├─ dnp3_index.html
│ └─ index.html
├─ docs/images/ # Screenshots for README
├─ build_modbus_index.py
├─ build_s7_index.py
├─ build_dnp3_index.py
├─ build_global_index.py
└─ requirements.txt
```
## 截图
### 全局高管仪表板

### Modbus
**全局仪表板**

**单份报告**

### Siemens S7Comm
**全局仪表板**


**单份报告**

### DNP3
**全局仪表板**


**单份报告**

## 设置与前置条件
- **Python:** 3.11(推荐)。
- **依赖项:** 从 `requirements.txt` 安装。
pip install -r requirements.txt
- **目录约定:**
- Modbus 报告 → `reports/modbus_batch/`
- S7 报告 → `reports/s7_batch/`
- DNP3 报告 → `reports/dnp3_batch/`
- **模板:** Jinja2 模板位于 `reports/templates/`。
## 按协议使用说明
### Modbus(主动,只读)
```
python -m modbus_scanner.modbus_scan --targets 127.0.0.1 --port 502 --unit 1
```
- 将 JSON + HTML 输出到 `reports/modbus_batch/`。
- 安全探测:线圈、离散输入、寄存器。
- 包含延迟和暴露信号。
### S7Comm(被动,来自 PCAPs)
```
run_s7_all.bat
python build_s7_index.py
```
- 将每个 PCAP 的 JSON/HTML 输出到 `reports/s7_batch/`。
- 汇总仪表板:`reports/s7_index.html`。
### DNP3(被动,来自 PCAPs)
```
run_dnp3_all.bat
python build_dnp3_index.py
```
- 将每个 PCAP 的 JSON/HTML 输出到 `reports/dnp3_batch/`。
- 汇总仪表板:`reports/dnp3_index.html`。
### 全局高管仪表板
```
python build_global_index.py
```
- 生成包含总计数据和快捷链接的 `reports/index.html`。
## 测试数据
本代码库包含:
- 用于 S7Comm 和 DNP3 的**示例 PCAPs**(位于 `pcaps/` 下)。
- 用于 Modbus/TCP 模拟的 **ModbusPal** JAR 文件。
这允许您在没有外部依赖的情况下立即测试该工具包。
关于语言构成的说明:GitHub 提供的语言分析(显示高比例的 HTML)是由于该工具包生成的高管仪表板和报告所致。这些报告以 HTML 文件的形式输出,以便于查看和共享。IndustrialScanner-Lite 的核心逻辑、扫描模块和分析引擎完全由 Python 编写。有关应用程序逻辑的真实语言构成,请参阅源代码。
## 许可证
本项目基于 MIT 许可证授权 - 详情请参阅 [LICENSE](LICENSE) 文件。
标签:后端开发, 多模态安全, 逆向工具