cognis-digital/modpot

GitHub: cognis-digital/modpot

MODPOT 是一款高交互的 Modbus/DNP3 工控蜜罐工具,用于模拟 ICS 设备并记录攻击者的寄存器读写行为为结构化 JSON。

Stars: 1 | Forks: 0

MODPOT # MODPOT ### 启动一个高交互的 Modbus/DNP3 ICS 蜜罐,将攻击者的寄存器读取/写入记录为结构化的 JSON。 [![PyPI](https://img.shields.io/pypi/v/cognis-modpot.svg?color=6b46c1)](https://pypi.org/project/cognis-modpot/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/4d572b8e70055252.svg)](https://github.com/cognis-digital/modpot/actions) [![License: COCL 1.0](https://img.shields.io/badge/License-COCL%201.0-2b6cb0.svg)](LICENSE) [![Suite](https://img.shields.io/badge/Cognis-Neural%20Suite-6b46c1.svg)](https://github.com/cognis-digital) *IoT / OT / 嵌入式 — 固件、总线和设备安全。*
``` pip install cognis-modpot modpot scan . # → prioritized findings in seconds ``` ## 使用说明 — 分步指南 `modpot` 是一个标准库的 Modbus TCP 蜜罐,它能将攻击者的寄存器读取/写入解码并分类为 JSON 威胁事件。控制台脚本:`modpot`。 1. **安装**: pipx install modpot # 或者:pip install modpot 2. **分析已捕获的 Modbus 帧 hex log**,并打印出分类后的威胁表(`--format` 参数是全局的,需放在子命令之前): modpot analyze capture.hexlog cat capture.hexlog | modpot analyze - # 从 stdin 读取帧 退出码 `1` = 至少有一个高严重性事件(写入/控制/侦察),`0` = 没有。 3. **过滤出严重事件**并为 SIEM 输出 JSON: modpot --format json analyze capture.hexlog --min-severity high | jq '.[].reasons' 4. **运行一个实时的蜜罐监听器**(高端口号无需 root 权限);每个请求都会作为一个 JSON 事件记录在 stdout 中: modpot serve --host 0.0.0.0 --port 5020 5. **将其用作 CI / 报警门禁**对捕获内容进行检查 — 当出现控制面写入时触发失败: modpot analyze capture.hexlog --min-severity high || echo "高严重性 Modbus 活动 — 正在报警" ## 目录 - [为什么选择 modpot?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [功能对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关工具](#related) · [贡献](#contributing) ## 为什么选择 modpot? OT 威胁情报内容引擎 — 将它部署在 VPS 上,分享“有人试图打开我的伪造水处理阀门”的日志。ICS 蜜罐捕获记录能在 infosec Twitter 上获得极大的关注度。 `modpot` 是单一用途、可脚本化且可自托管的:将其指向目标,以你的工作流已使用的格式(表格 · JSON · SARIF)获取优先级排序的结果,以此控制 CI,并让 agent 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ 解析帧 - ✅ 构建响应 - ✅ 分类事件 - ✅ 帧到事件 - ✅ 从 Hexlog 迭代帧 - ✅ 分析抓包 - ✅ 支持 Linux/macOS/Windows · Docker · devcontainer 运行 - ✅ 提供 Python、JavaScript、Go 和 Rust 版本移植 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-modpot modpot --version modpot scan . # scan current project modpot scan . --format json # machine-readable modpot scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ modpot scan . [HIGH ] MOD-001 example finding (./src/app.py) [MEDIUM ] MOD-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[attacker traffic] --> P[modpot
capture] P --> OUT[alerts + indicators] ```
↑ 回到顶部
## 从任何 AI 技术栈中使用 `modpot` 兼容所有主流的 AI 使用方式: - **MCP 服务器** — `modpot mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 通过管道将 `modpot scan . --format json` 传给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 只需一行代码即可将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI 流水线提供退出码 + SARIF
↑ 回到顶部
## 功能对比 | | **Cognis modpot** | conpot | |---|:---:|:---:| | 可自托管,无需账户 | ✅ | 视情况而定 | | 单条命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生 (AI agent) | ✅ | ❌ | | 多语言端口 (JS/Go/Rust) | ✅ | ❌ | | 开源许可 | ✅ COCL | 视情况而定 | *秉承 **conpot** 的精神,以 Cognis 的方式重新构建。遗漏了致谢?提交一个 PR 吧。*
↑ 回到顶部
## 集成 融入你的技术栈:用于代码扫描的 **SARIF**,适用于任何场景的 **JSON**,用于 AI agent 的 **MCP 服务器** (`modpot mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。详见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 — 各种方式,所有平台 ``` pip install "git+https://github.com/cognis-digital/modpot.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/modpot.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/modpot.git" # uv pip install cognis-modpot # PyPI (when published) docker run --rm ghcr.io/cognis-digital/modpot:latest --help # Docker brew install cognis-digital/tap/modpot # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/modpot/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | 云平台 | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/modpot` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关 Cognis 工具 - [`fwxray`](https://github.com/cognis-digital/fwxray) — 对比两个固件镜像并准确找出变动之处:新增二进制文件、更改的配置标志、添加的证书以及偏移的熵区域。 - [`canzap`](https://github.com/cognis-digital/canzap) — 使用极小的 YAML DSL 从 .pcap 或 SocketCAN 接口重放、模糊测试并断言 CAN 总线流量。 - [`sbomb`](https://github.com/cognis-digital/sbomb) — 直接从解包的固件根文件系统生成 CycloneDX SBOM,并标记出具有已知 CVE 和 EOL 内核的组件。 - [`mqttspy`](https://github.com/cognis-digital/mqttspy) — 被动映射 MQTT broker:枚举主题、检测未经身份验证的写入、发现 payload 中的 PII/机密信息,并生成风险报告。 - [`uefiscan`](https://github.com/cognis-digital/uefiscan) — 审计 UEFI 固件转储,查找缺失的 Secure Boot 密钥、未签名模块、S3 启动脚本漏洞以及已知的 SMM 威胁。 - [`keyhunt`](https://github.com/cognis-digital/keyhunt) — 扫描固件 blob 和文件系统转储,查找硬编码的私钥、API token、默认凭证以及脆弱的 RSA/ECC 密钥素材。 **探索套件 →** [🗂️ 所有 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
↑ 回到顶部
## 互操作性 `{}` 与包含 300+ 工具的 Cognis 套件协同组合 — JSON 输入/输出以及共享的 兼容 OpenAI 的 `/v1` 骨干网络。请参阅 **[INTEROP.md](INTEROP.md)** 获取 套件图谱、组合模式以及参考技术栈。 ## 许可证 源代码可见,基于 **Cognis Open Collaboration License (COCL) v1.0** — 可免费用于个人、内部评估、研究和教育用途;**商业 / 生产环境使用需要获取许可证** (licensing@cognis.digital)。详见 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 中 170+ 工具之一 · Making Tomorrow Better Today
标签:AMSI绕过, DNP3, PKINIT, Python, 可视化界面, 威胁检测, 工控安全, 数据可视化, 无后门, 日志审计, 蜜罐, 证书利用, 请求拦截, 逆向工具