cognis-digital/hookcraft

GitHub: cognis-digital/hookcraft

从 YAML 意图文件自动生成可直接运行的 Frida 动态插桩脚本,并提供意图校验与目标进程附加验证的移动安全工具。

Stars: 0 | Forks: 0

HOOKCRAFT # HOOKCRAFT ### 从 YAML 意图(例如“绕过 SSL pinning”、“导出加密密钥”)生成可直接运行的 Frida 插桩脚本,并验证它们是否附加到目标进程。 [![PyPI](https://img.shields.io/pypi/v/cognis-hookcraft.svg?color=6b46c1)](https://pypi.org/project/cognis-hookcraft/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/a85e47c4a1182739.svg)](https://github.com/cognis-digital/hookcraft/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) *应用与移动安全 — SAST/DAST-lite 及二进制分析。*
``` pip install cognis-hookcraft hookcraft scan . # → prioritized findings in seconds ``` ## 使用 — 分步指南 1. **安装:** pip install hookcraft 2. **从 YAML 意图生成 Frida agent** — 脚本将输出到 stdout: hookcraft generate intent.yaml 3. **将 agent 写入文件** 而不是输出到 stdout: hookcraft generate intent.yaml -o hooks.js 4. **在生成之前 lint 意图** — 验证意图并报告发现的问题(在 CI 中使用): hookcraft lint intent.yaml --format json | jq '.findings' 5. **机器可读的构建** — JSON 包含脚本、hook 数量和发现的问题;在错误级别的发现中退出代码为非零(或者传递 `--no-strict` 强制生成): hookcraft generate intent.yaml --format json | jq '.ok' ## 目录 - [为什么选择 hookcraft?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献](#contributing) ## 为什么选择 hookcraft? Frida 功能强大,但大家都在复制粘贴相同的 gist 脚本;hookcraft 是一个模板化、版本化、原生支持 MCP 的生成器,因此 AI agent 可以以声明式方式请求插桩。 `hookcraft` 是单一用途、可脚本化且可自托管的:将其指向目标,以你的工作流已经使用的格式(表格 · JSON · SARIF)获取优先排序的结果,在 CI 中对其进行门控,并让 agent 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ 解析 Yaml - ✅ 解析意图 - ✅ Lint 意图 - ✅ 包含错误报告 - ✅ 生成脚本 - ✅ 构建 - ✅ 可在 Linux/macOS/Windows · Docker · devcontainer 上运行 - ✅ 提供 Python, JavaScript, Go 和 Rust 移植版 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-hookcraft hookcraft --version hookcraft scan . # scan current project hookcraft scan . --format json # machine-readable hookcraft scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ hookcraft scan . [HIGH ] HOO-001 example finding (./src/app.py) [MEDIUM ] HOO-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[addresses + transactions] --> P[hookcraft
cluster + trace] P --> OUT[sanctions xref / report] ```
↑ 回到顶部
## 从任何 AI 技术栈中使用 `hookcraft` 可以与所有流行的 AI 使用方式互操作: - **MCP 服务器** — `hookcraft mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **OpenAI 兼容 / JSON** — 将 `hookcraft scan . --format json` 管道传输给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 用一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI pipeline 提供 exit code + SARIF
↑ 回到顶部
## 对比 | | **Cognis hookcraft** | Frida + 类似 'Universal Android SSL Pinning Bypass' 的 frida-scripts 集合 | |---|:---:|:---:| | 可自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生 (AI agent) | ✅ | ❌ | | 多语言移植 (JS/Go/Rust) | ✅ | ❌ | | 开源许可 | ✅ COCL | 视情况而定 | *秉承 **Frida + 类似 'Universal Android SSL Pinning Bypass' 的 frida-scripts 集合** 的精神,以 Cognis 的方式进行重构。遗漏了致谢?提交一个 PR 吧。*
↑ 回到顶部
## 集成 接入你的技术栈:用于代码扫描的 **SARIF**,用于任何场景的 **JSON**,用于 AI agent 的 **MCP 服务器** (`hookcraft mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。详情请见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 — 各种方式,所有平台 ``` pip install "git+https://github.com/cognis-digital/hookcraft.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/hookcraft.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/hookcraft.git" # uv pip install cognis-hookcraft # PyPI (when published) docker run --rm ghcr.io/cognis-digital/hookcraft:latest --help # Docker brew install cognis-digital/tap/hookcraft # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/hookcraft/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | Cloud | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/hookcraft` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关 Cognis 工具 - [`apkpeek`](https://github.com/cognis-digital/apkpeek) — 一键静态分析 Android APK/AAB 二进制文件:以单一 SARIF 报告的形式呈现硬编码的密钥、导出的组件、危险的权限以及不安全的 manifest 标志。 - [`ipasnitch`](https://github.com/cognis-digital/ipasnitch) — 用于 iOS .ipa 包的静态扫描器,可标记 ATS 例外、缺少的 entitlements 加固、嵌入的 URL/密钥以及薄弱的 Info.plist 传输设置。 - [`dastlite`](https://github.com/cognis-digital/dastlite) — 一个无头、配置即代码的 DAST 运行器,可抓取经过身份验证的 Web/移动 API 接口,并触发精心策划的主动扫描规则集,输出经过去重的 SARIF。 - [`semsift`](https://github.com/cognis-digital/semsift) — 轻量级的语义感知 SAST,仅对 diff 运行精心策划的污点分析规则,让 PR 获得快速的增量 SAST,而不是全仓库扫描的疲劳。 - [`cheatsense`](https://github.com/cognis-digital/cheatsense) — 反作弊遥测分析器,接收游戏会话日志,并通过可解释的单项分数标记出统计上异常的输入/瞄准/移动特征。 - [`binhunt`](https://github.com/cognis-digital/binhunt) — 游戏/桌面二进制完整性扫描器,对可执行文件进行指纹识别,检测常见的加壳器/混淆器,并与已知良好的基线进行对比以抓取篡改行为。 **探索套件 →** [🗂️ 所有 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 · 170+ 工具套件之一 Cognis Neural Suite · Making Tomorrow Better Today
标签:Docker支持, Frida, Python, 云资产清单, 可视化界面, 数据可视化, 无后门, 日志审计, 目录枚举, 移动安全, 网络调试, 自动化, 请求拦截, 逆向工具, 逆向工程