catownsley/ariadne

GitHub: catownsley/ariadne

一个以「可信自主性」架构为核心的实验性 AI 渗透测试工具,让语言模型在代码强制的安全边界内自主规划并执行测试。

Stars: 1 | Forks: 0

# Ariadne Ariadne 是一个自主的 AI 渗透测试工具,在其底层,它是一个为进攻性安全工具构建可信自主性的工程实验。一个语言模型负责规划并驱动整个测试过程,但它运行在一个无法逾越的边界内,而这个边界(而非模型本身)才是核心所在。 ``` flowchart TD OP[Operator] -->|objective and scope| PL subgraph BOUND[The boundary the model cannot cross] PL[Planner, the language model] --> TB[Tool layer, typed and least privileged] TB --> SG[Scope guard, allowlist enforced in code] TB --> AU[(Append only audit log)] CX[Context, the exploration graph] --> PL TB --> CX end SG -->|in scope requests only| TGT[Authorized target] TGT -->|untrusted responses, treated as data| TB ```

A loop from the original short film that accompanies Ariadne, click to watch

Ariadne 配套了一首原创钢琴曲和一部短片,这两者均由我原创、演奏和制作,没有使用任何 AI。神话、音乐、视觉和软件是从四个侧面讲述的同一个故事:在迷宫中探索以及那条引导你走出的引线。上面的循环动图就出自这部短片。观看完整影片并了解相关艺术创作,请访问 [艺术](ART.md)。 ## 这里的有趣之处 有趣的地方并不在于模型能够发起 HTTP 请求。而在于模型被限制在一个明确的安全和测试边界内行动,同时仍能在此边界内进行自主规划。测试范围通过代码强制执行,而不是在 prompt 中请求;每个动作都会经过安全层,并最终记录在只追加的审计日志中;工具数量少且经过严格类型定义;agent 会在一张明确的地图上进行推理,标记出它已涉足和未涉足的区域。 规划器是唯一可替换的部分。它今天可能是某个模型,明天可能换成了另一个模型,但在替换时架构并不会改变,因为安全保证存在于模型周围的代码中,而不是在模型本身之中。正是这一点赋予了该设计比任何单一模型都更长的生命周期,这也是本项目真正的主题所在:一种用于构建受约束的自主安全 agent 的原则性架构。 ## 请求的流转过程 每个动作都会向下穿过各层并返回,而模型永远不会直接接触网络。 ``` Planner decides the next move from the exploration map ↓ Tool layer the only way to act, typed and least privileged ↓ Scope guard enforces the host and port allowlist in code ↓ HTTP the request finally reaches the authorized target ↓ Observation the response comes back as untrusted data ↓ Context the exploration graph and findings are updated ↓ Planner reads the new map and asks where it has not been ``` ## 自主循环 操作员设定一个目标。然后,规划器会在一个循环中进行反思、行动并更新其地图,直到边界(即它尚未涉足的地点集合)被完全覆盖。 ``` flowchart TD O[Operator states the objective] --> P[Planner reflects and asks where it has not been] P --> T[Tool calls run concurrently through the safety layer] T --> U[Context update, the exploration graph and frontier grow] U --> P U --> F[Finding confirmed from the evidence and typed by class] F --> R[Report rendered from the typed findings] ``` ## 端到端 这是一个从目标设定到报告生成的完整测试过程。 测试目标是位于 http://127.0.0.1:3000 的本地 OWASP Juice Shop,这是范围内唯一的主机和端口。 agent 在发现问题瞬间的推理过程(由 reflect 工具记录并写入审计日志)如下所示。 ``` goal: map the API surface and find an endpoint that leaks data evidence: discover_content found /api/Feedbacks returning 200 confidence: medium unknowns: whether /api/Feedbacks requires authentication next_hypothesis: the endpoint returns records to an unauthenticated caller ``` 生成的报告(直接根据带类型的发现生成)如下所示。 ``` # Penetration Test 报告 Target: http://127.0.0.1:3000 Confirmed findings: 1 Candidate findings: 0 ## [CONFIRMED] HIGH 敏感信息泄露 Weakness: CWE-200 URL: http://127.0.0.1:3000/api/Feedbacks Evidence: the endpoint returned every feedback record without authentication, including partially masked emails and content referencing wallet seed phrases. Remediation: Require authentication and authorization on the endpoint, and remove sensitive data from responses that do not need to carry it. ## Exploration 地图 http://127.0.0.1:3000 / [200] /api/Feedbacks [200] sqli not tested xss not tested finding [confirmed] Sensitive Information Disclosure CWE-200 ``` agent 得出这一发现的过程是:映射攻击面,询问自己哪里还没去过,读取 endpoint,将响应当作数据进行处理,并根据证据确认了信息泄露;而报告之所以能够自动生成,是因为发现类型本身已经携带了弱点和修复建议。 ## 迷宫 这个名字并非纯粹的装饰。Ariadne 提供了那条让你能够深入迷宫并找到出路引线,而这正是该架构所做的事情:它让 agent 能够深入探索目标,并始终安全地返回边界内。伴随的音乐也走在同样的路径上:步入小调,攀升至高亢而显露的中段,达到高潮,最后安静地回归。短片则以视觉的方式呈现了这一过程,片中成倍的舞者代表了并发的 agent——多条引线同时铺设在迷宫中,且每一条都能找到回来的路。这个项目不仅仅关乎利用机器,它更关乎在迷宫中探索并找到归途,并通过四种方式同时讲述出来。 ## 延伸阅读 文章 [设计一个可信的自主渗透测试 Agent](ARTICLE.md) 深入探讨了架构选择。关于架构和图表,请参阅 [DESIGN.md](DESIGN.md);关于 agent 威胁模型,请参阅 [THREAT_MODEL.md](THREAT_MODEL.md);关于影片和音乐,请访问 [艺术](ART.md)。 ## 运行 需要 Python、一个已授权的目标,以及环境变量中设置好的 ANTHROPIC_API_KEY。 ``` python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt export ANTHROPIC_API_KEY=... python -m pentester.main ``` ## 免责声明 本软件按“原样”提供,不提供任何形式的明示或暗示的保证,包括但不限于适销性、特定用途的适用性和非侵权性的保证。请仅针对您拥有或获得明确授权进行测试的系统使用本软件。 ## 许可证 Copyright (C) 2026 Charlotte Townsley. 本程序是自由软件。您可以根据自由软件基金会发布的 GNU General Public License 第 3 版的条款重新分发或修改它。完整的许可证文本请参见 LICENSE 文件以及 https://www.gnu.org/licenses/gpl-3.0.html。 分发本程序的初衷是希望它能够有用,但不提供任何保证;甚至不包含适销性或特定用途适用性的暗示保证。有关更多详细信息,请参阅 GNU General Public License。
标签:DLL 劫持, GitHub, XXE攻击, 人工智能, 大语言模型, 实时处理, 密码管理, 用户模式Hook绕过, 自主智能体, 逆向工具