Repository navigation
Getting Started
company edited this page Jul 31, 2026
·
1 revision
本页用于在本地开发环境启动 Attacker,并运行第一条不依赖外部 Target 的隔离评测。
- Python
>=3.12,<3.13 - uv
- Git
git clone https://github.com/juemimgcd/Attacker.git
cd Attacker
uv sync --locked --python 3.12
uv run alembic upgrade headuv run uvicorn main:app --reload默认入口:
- OpenAPI:http://127.0.0.1:8000/docs
- 健康检查:http://127.0.0.1:8000/health
内置 stateful profile 不需要连接外部 Target:
curl -X POST http://127.0.0.1:8000/runs/stateful \
-H "Content-Type: application/json" \
-d '{"profile":"hardened","dataset_path":"samples/stateful/phase3.yaml"}'可用 profile:
-
vulnerable:预置易受攻击行为; -
hardened:预置加固行为; -
regressed:预置安全回归行为。
拿到 run_id 后查询报告:
GET /runs/{run_id}/report.json
GET /runs/{run_id}/report.md
复制 .env.example 为 .env,设置:
SECURITY__API_KEY=replace-with-a-long-random-secret业务接口随后需要携带:
X-API-Key: replace-with-a-long-random-secret/health、/docs 与 /openapi.json 保持公开。