xspartian/pwngraph-labs
GitHub: xspartian/pwngraph-labs
一套故意设计为易受攻击的 AI agent 靶场,配合 PwnGraph 工具用于 LLM 安全测试与漏洞演练。
Stars: 0 | Forks: 0
# PwnGraph Labs
**故意设计为易受攻击的 AI agents**,用于配合 [PwnGraph](https://github.com/xspartian/pwngraph) 练习 LLM 安全测试。
每个 lab 都是一个独立且真实的 agent,并附有漏洞文档。使用 PwnGraph 扫描它们以生成攻击图、ASR 测量结果、CVSS 评分和 HTML 报告——或者手动探测它们。
## Labs
| # | Lab | Agent | 攻击类别 | 难度 |
|---|-----|-------|----------------|------------|
| 01 | [IT Helpdesk](lab-01-helpdesk/) | HelpBot — Acme Corp IT assistant | 全部 6 种 | 初级 |
| 02 | 即将推出 | — | — | — |
| 03 | 即将推出 | — | — | — |
## 快速开始
**1. 安装 PwnGraph**
```
pip install pwngraph
```
**2. 选择一个 lab 并进行设置**
```
cd lab-01-helpdesk
pip install -r requirements.txt
cp .env.example .env # add your OpenAI API key
```
**3. 扫描**
```
pwngraph scan --target lab_agent.py:build_agent --attacks all --trials 3 --out ./results
```
**4. 打开报告**
```
open results/report.html
```
## PwnGraph 的发现
PwnGraph 会映射 agent 的工具图,使用 6 种攻击类别对其进行 fuzzing,并报告:
- **攻击图** — 可视化展示 source → propagation → sink 路径映射
- **ASR (Attack Success Rate)** — 每种攻击类别附带 Wilson 95% CI
- **发现** — 每个发现均包含 CVSS 3.1 vector、OWASP LLM Top-10 标签和 PoC
- **风险评级** — A 至 F
## 攻击类别
| 类别 | 测试内容 |
|-------|--------------|
| `indirect_injection` | 工具输出中由攻击者控制的内容 |
| `tool_poisoning` | 嵌入在 RAG / 知识库文档中的注入 |
| `prompt_exfiltration` | 通过精心构造的查询泄露系统 prompt |
| `shell_injection` | 诱导 agent 执行任意 shell 命令 |
| `file_read_injection` | 诱导 agent 读取敏感文件 |
| `memory_poisoning` | 污染 agent 的持久化 memory/notes |
## 相关资源
- [PwnGraph](https://github.com/xspartian/pwngraph) — 扫描工具
- [OWASP LLM Top 10](https://owasp.org/www-project-top-10-for-large-language-model-applications/)
- [Black Hat Arsenal](https://www.blackhat.com/us-25/arsenal.html)
MIT License — 仅用于教育和授权的安全测试。
标签:AI安全, Chat Copilot, CISA项目, DLL 劫持, HTTP工具, LLM安全测试, Petitpotam, 后端开发, 大语言模型, 漏洞靶场, 逆向工具, 防御检测