angad-kandhari/Agent-LocSmith

GitHub: angad-kandhari/Agent-LocSmith

一款由多 AI agent 驱动的自主渗透测试工具,能够发现应用漏洞、生成 PoC 并提供修复补丁。

Stars: 0 | Forks: 0

lochlan: breaks into your app, then sends you the patch

License Stars Python Status

**一个自主的 AI 渗透测试工具,它能攻破你的应用,然后将补丁发送给你。** Lochlan 运行着一组 AI agent 团队,它们会对你的应用进行侦察、利用发现的漏洞, 通过可用的概念验证(PoC)来证明它,并提交修复方案。它不是一个只会 发出告警的扫描器:而是一个向你展示漏洞利用过程并将补丁交到你手上的同事。 ``` uvx lochlan scan --target https://staging.example.com ``` ## 安装 无需安装即可运行一次(使用 uv): ``` uvx lochlan scan --target https://staging.example.com ``` 或者永久安装该 CLI: ``` pipx install lochlan # isolated global CLI # 或者,从 clone 出来的代码进行开发: pip install -e . ``` 然后配置凭据: ``` cp .env.example .env # add your ANTHROPIC_API_KEY, or run `ant auth login` ``` ## 使用 ``` # 在未调用 API 的情况下查看 plan(不需要 key): lochlan scan --target ./my-app --dry-run # 针对已部署 target 的 black-box: lochlan scan --target https://staging.example.com # 针对本地 repo 的 white-box(static + dynamic): lochlan scan --target ./my-app # 在单次 scan 中的多个授权 target: lochlan scan --target https://api.example.com --target ./api-src # 列出 skill playbook: lochlan skills ``` 只有列出的目标才会被触碰。授权的 scope 会作为权威指令 注入到每个 agent 的系统 prompt 中,任何指令都无法扩大该范围。 ## 工作原理 Lochlan 是一个**由 agent 组成的图**: - **根 agent** 负责编排,从不触碰目标。它将 工作进行拆解并委派。 - **专职子 agent** 进行实际动手测试,每个 agent 负责一个组件中的一种漏洞类别,并随着攻击面的发现而反应式生成。 - agent 的一个回合只能通过**生命周期工具**(`finish_scan` / `agent_finish`)结束, 绝不会通过纯文本的 "done"。这使得长时间自主运行变得可靠。 - 已确认的漏洞发现会**连同修复方案一起**提交:包含确切的修改前/后代码 以及 PR 正文。漏洞发现与修复是一步完成的。 Claude 是其核心大脑(使用 `claude-opus-5` 进行漏洞利用整合和补丁编写, 使用 `claude-sonnet-5` 进行高频侦察)。 ### 目录结构 ``` lochlan/ config.py scope (the authorization boundary) + settings prompts.py system prompt: scope-locking + role discipline llm.py Claude wrapper, manual loop with lifecycle discipline tools.py the agent tool surface + dispatcher reports.py vulnerability reports (proof + inline fix) sandbox.py isolated command execution [STUB: wire to a container] skills.py the on-demand playbook loader engine/ coordinator.py the agent graph (tree, statuses, inboxes) agent.py the single-agent loop runner.py brings up the engine, drives the root agent skills/ markdown playbooks (the expertise that compounds) sandbox/Dockerfile the Kali-based execution image ``` ## 存根部分(接缝) - **`sandbox.py`** 会记录预期的命令,但不会执行它们。在进行实际运行之前,请将其 连接到基于 `sandbox/Dockerfile` 构建的 container。 - **并发**:子 agent 以内联(同步)方式运行。同级 agent 应该并行运行,并设置上限(参见 `engine/runner.py` 中的 TODO)。 - **GitHub 层**:将提交的报告转化为 `lochlan[bot]` 的 pull request 是该产品的核心切入点,目前尚未构建。报告对象已经 包含了 PR 所需的一切信息(标题、严重程度、PoC、代码修复、PR 正文)。 ## 设计 该架构是一个具有角色划分的 agent 图,并带有生命周期规范、 经系统验证的 scope 锁定、内联式的发现并修复功能,以及一个能随着时间推移不断积累的 markdown 技能库。
标签:CISA项目, 实时处理, 密码管理, 漏洞修复, 网络安全培训, 自动化漏洞利用, 请求拦截, 逆向工具