v1.3.0 — SDK 编程接口 + 代理注入 + go:embed 模板 + 并发控制
v1 系列最终版本。全面重构为 SDK 友好架构;支持 per-instance 代理注入;模板从 base64 切换到 go:embed;新增 per-host 并发限速。后续新功能(service protocol / 模板化后渗透)将在 zombie2.0 分支开发。
New Features
SDK 编程接口
NewRunner(opt)+RunnerOption独立结构体,支持程序化调用RunWithArgs(ctx, args, options)复用 CLI 解析 + 信号处理Help()函数暴露帮助文本SetResourceProvider()/SetResourceLoader()资源注入覆盖
opt := &core.RunnerOption{
Threads: 50,
Concurrency: 4,
Timeout: 10,
Mod: "clusterbomb",
FirstOnly: true,
}
runner := core.NewRunner(opt)
runner.SetTargets(targets)
runner.SetUsers([]string{"root", "admin"})
runner.SetPasswords([]string{"123456", "admin"})
runner.RunWithContext(ctx)代理注入
ProxyDial字段注入到RunnerOption,per-execution 代理- Socket 协议(SSH/Redis/MySQL/FTP/...)和 HTTP 协议统一走注入的
DialFunc - 基于
utils/httpx统一 HTTP transport 构建
opt.ProxyDial = proxyclient.NewDialFunc("socks5://127.0.0.1:1080")go:embed 模板
- 模板从 base64 编码切换到
go:embed+ deflate 压缩的.bin文件 - 源码体积减小,编译和启动速度提升
templates_gen.go -embed模式自动生成 embed 声明
per-host 并发限速
--concurrency N(原--host-threads)限制单 host 在飞连接数- 基于 channel semaphore,避免触发 sshd MaxStartups 等服务端限速
- context 取消感知:目标命中后排队任务立即退出,不再建连
Improvements
- 目标解析支持 JSON/Gogo 文件导入、per-target 服务/凭证覆盖
- neutron 模板插件 logger 初始化守卫,防止 nil panic
- CRLF → LF 行尾统一
- 内嵌资源数据(字典/规则)更新
- 本地化 grdp 依赖,移除已归档的外部引用
CI / Dependencies
- goreleaser workflow 升级到 ubuntu-latest + actions v4/v5/v6
- dependabot 自动依赖更新
- Go 版本从 go.mod 动态获取,不再硬编码
- chainreactors 全组件依赖更新(fingers/parsers/utils/words/neutron)
Bug Fixes
- 修复 neutron 插件 logger 未初始化导致的 nil panic
- templates submodule 指向正确的 commit
Full Changelog: v1.2.2...v1.3.0