Releases: chainreactors/proton
Releases · chainreactors/proton
v0.3.0
proton v0.3.0
proton 从文件扫描工具重构为纯匹配引擎 SDK。所有数据采集、CLI、Runner 等高级功能已迁移至 found。
Breaking Changes
- 移除
Scanner.Scan()— 不再内置目录遍历 - 移除
ProcessFile()— 替换为ReadFile()+ScanData() - 移除 CLI 入口、
pkg/runner/、sysinfo/(迁移至 found) - FFI 移除内置模板,
ProtonNewScanner改为 path-based template.Execute切换到 Scanner 后端
SDK API
| 接口 | 模式 | 用途 |
|---|---|---|
ScanData([]byte, label, group) |
一次性,按行 | 文本匹配 |
ScanBlock([]byte, label, group) |
一次性,滑动窗口 | 二进制匹配 |
NewLineWriter(label, cb) |
流式 io.WriteCloser | 持续文本流 |
NewBlockWriter(label, cb) |
流式 io.WriteCloser | 持续二进制流 |
ReadFile(path, group) |
文件读取 | 返回 []FileContent |
三层匹配管线
prefilter (bytes.Contains) → Aho-Corasick DFA → RE2 regex
FFI (C ABI)
int ProtonNewScanner(const char* templatePath);
char* ProtonScanData(int handle, const void* data, int len, const char* label);
char* ProtonScanBlock(int handle, const void* data, int len, const char* label);
void ProtonFreeScanner(int handle);
void ProtonFreeString(char* s);支持 Python/Rust/C/C++ 等任何 C FFI 语言集成。
Template API
tmpl.Compile(opts)
tmpl.Execute(path) // 文件扫描
tmpl.ScanData(data, label) // 文本匹配
tmpl.ScanBlock(data, label) // 二进制匹配v0.2.0
found v0.2.0
found CLI 已从独立仓库迁入 proton,后续 proton 将改名为 found。此版本起请从本仓库获取 release。
🆕 New Features (vs found v0.1.1)
Template Management
--validate— 验证模板语法、必填字段、正则编译,支持 CI 集成(非零退出码)-d/--template-display— 按 ID 或文件路径查看模板内容--update-templates— 从 git 仓库(支持私有仓库)clone/pull 模板--template-url— 指定模板仓库 URL(自动保存到~/.config/found/config.yaml)--update-template-dir— 自定义模板安装目录- 本地模板自动发现:
~/.config/found/templates/存在时自动加载,无需-t
Extract Rules
- 新增
extract/模板分类(36 条规则),使用 nuclei file 协议格式替代旧版extract.yaml - 分类覆盖:cloud、crawl、credential、info-leak、token
🔧 Engine Improvements (proton core)
- Unified Scanner — 单次遍历多模板评估,三层过滤流水线(bytes.Contains → Aho-Corasick → RE2)
- Aho-Corasick 迁移 — 使用 chainreactors/utils/ahocorasick,支持 LeftMostLongestMatch
- 归档文件透明扫描(tar/tar.gz/zip/7z/rar)
- 扩展目录裁剪规则(node_modules、pycache、.gradle 等)
- 行号与字节偏移量追踪
📦 Architecture
- found CLI 合并到 proton,统一为单一仓库
templates/改为 Go 包template/(单数),templates/路径用于数据 submodulepkg/data/*.bin和pkg/templates.go由go generate生成,不再纳入 git 管理- CI:自动测试(push/PR)+ GoReleaser 自动发布(tag)
⬆️ Upgrade Notes
- 所有 CLI 用法不变,二进制名仍为
found - 从本仓库 release 页面下载替换即可
- 如使用
go install:go install github.com/chainreactors/proton@latest