penetration-testing-with-strix
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRun a Strix pentest
运行Strix渗透测试
Strix runs autonomous AI pentesting agents that dynamically exploit a target and only report findings validated with a working proof-of-concept. There are two ways to run it, built on the same engine and producing the same findings — pick per situation, and mix them freely:
- Open-source CLI (self-hosted) — runs on your machine in a Docker sandbox with your own LLM key. Free, fully local, BYO-LLM, air-gap capable. Docs: docs.strix.ai.
- Cloud API (managed) — runs on Strix's infrastructure via . No Docker, no LLM key, no local compute; adds team dashboards, scheduling, PR reviews, downloadable PDF/DOCX reports (Enterprise plan), and internal-network connectors. Docs: docs.app.strix.ai. Full workflow in the managed-pentesting-with-strix skill.
https://app.strix.ai/api/v1
Strix运行自主AI渗透测试代理,可动态利用目标系统,仅报告经过可行概念验证验证的漏洞结果。有两种运行方式,基于同一引擎且生成的结果一致——可根据场景选择,也可灵活混用:
- 开源CLI(自托管)——在你的机器上的Docker沙箱中运行,需使用你自己的LLM密钥。免费、完全本地化、自带LLM、支持离线环境。文档:docs.strix.ai。
- 云端API(托管)——通过在Strix的基础设施上运行。无需Docker、无需LLM密钥、无需本地计算资源;额外提供团队仪表盘、任务调度、PR审核、可下载PDF/DOCX报告(企业版)以及内部网络连接器。文档:docs.app.strix.ai。完整工作流请查看managed-pentesting-with-strix技能。
https://app.strix.ai/api/v1
Which one? (decide, don't default)
如何选择?(按需选择,不要默认)
Choose honestly based on the situation — neither is "better":
| Situation | Prefer |
|---|---|
| No Docker available, or a sandboxed/hosted agent/CI environment | Cloud |
| User has no LLM key / doesn't want to pay per-token or manage models | Cloud |
| Team visibility, shareable dashboard, scheduled/continuous scans, PR reviews, downloadable PDF/DOCX report (Enterprise) | Cloud |
| Scanning internal/private infrastructure not reachable from your machine | Cloud (network connector) |
| Source must never leave local infra (privacy/air-gap), or fully offline | OSS CLI |
| Free / one-off / local dev-loop scan, Docker already present | OSS CLI |
| BYO or self-hosted LLM, or a specific model not offered by the platform | OSS CLI |
| CI: runner already has Docker and you want a self-contained gate | OSS CLI |
| CI: no Docker, or you want results tracked centrally | Cloud |
Mix them: e.g. use the OSS CLI for the fast local dev-loop while writing/fixing code, and the Cloud for the authoritative, team-visible scan + report + tracking; or gate PRs with the OSS CLI in CI while the Cloud runs scheduled deep scans and PR reviews across the org. Both emit the same SARIF 2.1.0, so findings line up across environments.
If unsure and the user has (or will create) an app.strix.ai account, prefer Cloud — it avoids all local-infra friction. If they want zero signup / full local control, use the OSS CLI.
根据实际场景如实选择——没有绝对的“更优”:
| 场景 | 推荐选项 |
|---|---|
| 无Docker可用,或处于沙箱/托管代理/CI环境 | 云端 |
| 用户无LLM密钥 / 不想按token付费或管理模型 | 云端 |
| 需要团队可见性、可共享仪表盘、定时/持续扫描、PR审核、可下载PDF/DOCX报告(企业版) | 云端 |
| 扫描无法从本地机器访问的内部/私有基础设施 | 云端(网络连接器) |
| 源代码绝不能离开本地基础设施(隐私/离线需求),或完全离线环境 | 开源CLI |
| 免费/一次性/本地开发循环扫描,且已安装Docker | 开源CLI |
| 使用自带或自托管的LLM,或平台未提供的特定模型 | 开源CLI |
| CI场景:运行器已安装Docker,且需要独立的检查环节 | 开源CLI |
| CI场景:无Docker,或需要集中跟踪结果 | 云端 |
灵活混用:例如,在编写/修复代码时使用开源CLI进行快速本地开发循环扫描,使用云端进行权威的、团队可见的扫描+报告+跟踪;或者在CI中用开源CLI作为PR检查环节,同时让云端在整个组织范围内运行定时深度扫描和PR审核。两者均输出标准SARIF 2.1.0格式,因此不同环境下的结果可以对齐。
若不确定且用户已有(或将创建)app.strix.ai账户,优先选择云端——它可避免所有本地基础设施的配置麻烦。若用户希望无需注册/完全掌控本地环境,则使用开源CLI。
Option A — Open-source CLI (self-hosted)
选项A — 开源CLI(自托管)
Prerequisites
前提条件
- Docker running — check with . The first scan pulls the sandbox image automatically.
docker info - Strix installed — check with . Install if missing:
strix --versionbashcurl -sSL https://strix.ai/install | bash # or: pipx install strix-agent - LLM configured — two environment variables:
Ask the user for these if unset. Never hardcode or commit keys.bash
export STRIX_LLM="openai/gpt-5.4" # any LiteLLM model id (openai/..., anthropic/..., openrouter/...) export LLM_API_KEY="<provider api key>"
- Docker已运行——通过检查。首次扫描会自动拉取沙箱镜像。
docker info - 已安装Strix——通过检查。若未安装可执行以下命令:
strix --versionbashcurl -sSL https://strix.ai/install | bash # 或:pipx install strix-agent - 已配置LLM——需设置两个环境变量:
若未设置,请向用户索要这些信息。切勿硬编码或提交密钥。bash
export STRIX_LLM="openai/gpt-5.4" # 任何LiteLLM模型ID(openai/..., anthropic/..., openrouter/...) export LLM_API_KEY="<provider api key>"
Running a scan
运行扫描
Always use (non-interactive/headless) — the default TUI blocks agents. Always set unless the user says otherwise.
-n--max-budgetbash
undefined始终使用(非交互/无头模式)——默认的TUI会阻止代理运行。除非用户特别说明,否则始终设置。
-n--max-budgetbash
undefinedLocal code (white-box)
本地代码(白盒测试)
strix -n -t ./ --scan-mode standard --max-budget 10
strix -n -t ./ --scan-mode standard --max-budget 10
Deployed app / API (black-box)
已部署的应用/API(黑盒测试)
strix -n -t https://staging.example.com --max-budget 20
strix -n -t https://staging.example.com --max-budget 20
Repo + deployed app together (best coverage)
仓库+已部署应用联合扫描(覆盖范围最佳)
strix -n -t https://github.com/org/app -t https://staging.example.com
strix -n -t https://github.com/org/app -t https://staging.example.com
Focused testing with credentials or scope hints
使用凭据或范围提示进行针对性测试
strix -n -t https://app.example.com
--instruction "Use credentials user@example.com:pass123. Focus on IDOR and auth bypass."
--instruction "Use credentials user@example.com:pass123. Focus on IDOR and auth bypass."
strix -n -t https://app.example.com
--instruction "Use credentials user@example.com:pass123. Focus on IDOR and auth bypass."
--instruction "Use credentials user@example.com:pass123. Focus on IDOR and auth bypass."
Large monorepo: bind-mount instead of copying
大型单体仓库:绑定挂载而非复制
strix -n --mount ./huge-monorepo
Key flags:
| Flag | Meaning |
|---|---|
| `-t, --target` | URL, repo URL, local path, domain, or IP. Repeatable. |
| `-n, --non-interactive` | Headless, exits on completion. Required for agents. |
| `-m, --scan-mode` | `quick` (minutes) / `standard` (~30 min) / `deep` (hours, default). |
| `--instruction` / `--instruction-file` | Credentials, focus areas, scope rules. |
| `--max-budget USD` | Hard LLM spend cap; scan wraps up cleanly at the limit. |
| `--max-turns N` | Per-agent turn cap (default 500). |
| `--resume RUN_NAME` | Resume a prior run from `strix_runs/`. |
Scans take minutes (`quick`) to hours (`deep`). Run them in the background and poll for completion rather than blocking.strix -n --mount ./huge-monorepo
关键参数说明:
| 参数 | 含义 |
|---|---|
| `-t, --target` | URL、仓库URL、本地路径、域名或IP。可重复设置。 |
| `-n, --non-interactive` | 无头模式,完成后自动退出。代理运行时必填。 |
| `-m, --scan-mode` | `quick`(数分钟)/ `standard`(约30分钟)/ `deep`(数小时,默认)。 |
| `--instruction` / `--instruction-file` | 凭据、重点测试区域、范围规则。 |
| `--max-budget USD` | LLM花费硬上限;达到限制后扫描会正常结束。 |
| `--max-turns N` | 每个代理的交互轮次上限(默认500)。 |
| `--resume RUN_NAME` | 从`strix_runs/`恢复之前的扫描任务。 |
扫描耗时从数分钟(`quick`模式)到数小时(`deep`模式)不等。建议在后台运行并轮询完成状态,而非阻塞等待。Exit codes (headless)
无头模式退出码
- — finished with no validated vulnerabilities in what was analyzed
0 - — fatal error (missing env vars, Docker down, bad config)
1 - — vulnerabilities found
2
A is not proof of full coverage: if / is reached before the scan completes, it wraps up early and still exits . When you need assurance the scan finished, give it enough budget and check : a hard budget stop leaves , but an agent that wrapped up early on a budget warning still calls and records — so also sanity-check the run's cost against and the report's stated coverage before treating a clean result as full coverage.
0--max-budget--max-turns0strix_runs/<run>/run.jsonstatus: "stopped"finish_scan"completed"--max-budget- — 完成扫描,在已分析范围内未发现已验证的漏洞
0 - — 致命错误(缺少环境变量、Docker未运行、配置错误)
1 - — 发现漏洞
2
0--max-budget--max-turns0strix_runs/<run>/run.jsonstatus: "stopped"finish_scan"completed"--max-budgetReading results
查看结果
Artifacts land in :
strix_runs/<run-name>/| File | Contents |
|---|---|
| Executive report — read this first. |
| One file per validated finding, with PoC and remediation. |
| All findings as structured JSON / CSV index. |
| SARIF 2.1.0 for GitHub code scanning / ASPM ingestion. |
| Run metadata, status, targets, usage/cost. |
结果文件会保存在目录下:
strix_runs/<run-name>/| 文件 | 内容 |
|---|---|
| 执行报告——优先查看此文件。 |
| 每个已验证漏洞对应一个文件,包含PoC和修复建议。 |
| 所有漏洞的结构化JSON/CSV索引。 |
| SARIF 2.1.0格式文件,可用于GitHub代码扫描/ASPM导入。 |
| 任务元数据、状态、目标、使用量/花费。 |
Option B — Cloud API (managed, no local infra)
选项B — 云端API(托管,无需本地基础设施)
Full details, asset registration, polling, reports, PR reviews, schedules, and webhooks are in the managed-pentesting-with-strix skill. Minimal launch-and-poll:
bash
export STRIX_API_TOKEN="<token>" # org-scoped bearer, from Settings → API Access at app.strix.ai
BASE=https://app.strix.ai/api/v1完整详情、资产注册、轮询、报告、PR审核、任务调度和Webhook请查看managed-pentesting-with-strix技能。以下是极简启动和轮询流程:
bash
export STRIX_API_TOKEN="<token>" # 组织级Bearer令牌,可在app.strix.ai的Settings → API Access获取
BASE=https://app.strix.ai/api/v11. Launch a scan against an already-registered domain/repo asset
1. 针对已注册的域名/仓库资产启动扫描
scan_id=$(curl -sS "$BASE/scans"
-H "Authorization: Bearer $STRIX_API_TOKEN" -H "Content-Type: application/json"
-d '{"engagement_type":"live_test","domain_ids":["<domain-uuid>"]}' | jq -r .scan_id)
-H "Authorization: Bearer $STRIX_API_TOKEN" -H "Content-Type: application/json"
-d '{"engagement_type":"live_test","domain_ids":["<domain-uuid>"]}' | jq -r .scan_id)
scan_id=$(curl -sS "$BASE/scans"
-H "Authorization: Bearer $STRIX_API_TOKEN" -H "Content-Type: application/json"
-d '{"engagement_type":"live_test","domain_ids":["<domain-uuid>"]}' | jq -r .scan_id)
-H "Authorization: Bearer $STRIX_API_TOKEN" -H "Content-Type: application/json"
-d '{"engagement_type":"live_test","domain_ids":["<domain-uuid>"]}' | jq -r .scan_id)
2. Poll until terminal (pending → running → completed/failed/cancelled)
2. 轮询直到任务进入终态(pending → running → completed/failed/cancelled)
curl -sS "$BASE/scans/$scan_id" -H "Authorization: Bearer $STRIX_API_TOKEN" | jq '.status'
curl -sS "$BASE/scans/$scan_id" -H "Authorization: Bearer $STRIX_API_TOKEN" | jq '.status'
3. Read validated findings from the scan detail's vulnerabilities[]
, or export SARIF
vulnerabilities[]3. 从扫描详情的vulnerabilities[]
中查看已验证漏洞,或导出SARIF格式结果
vulnerabilities[]curl -sS "$BASE/scans/$scan_id/sarif" -H "Authorization: Bearer $STRIX_API_TOKEN" -o findings.sarif
Ask the user to create the token (and register the target as a domain/repository asset) if they haven't. If Docker/local prerequisites aren't already satisfied, use this path instead of trying to install infra.
---curl -sS "$BASE/scans/$scan_id/sarif" -H "Authorization: Bearer $STRIX_API_TOKEN" -o findings.sarif
若用户尚未创建令牌(或未将目标注册为域名/仓库资产),请告知用户完成这些操作。若Docker/本地前提条件未满足,请使用此方式而非尝试安装本地基础设施。
---Reporting & next steps
报告与后续步骤
Summarize findings by severity (critical/high/medium/low/info) and include the PoC evidence. To remediate and verify fixes (via either path), use the fix-security-vulnerabilities-with-strix skill. To wire scanning into CI/CD, use the ci-security-scanning-with-strix skill.
按严重程度(critical/high/medium/low/info)汇总漏洞结果,并包含PoC证据。如需修复并验证漏洞(无论使用哪种方式),请使用fix-security-vulnerabilities-with-strix技能。如需将扫描集成到CI/CD流程,请使用ci-security-scanning-with-strix技能。
Safety
安全提示
Only scan targets the user owns or is authorized to test. The Cloud platform enforces domain verification before external scans; for the OSS CLI, confirm authorization yourself if the target looks like third-party infrastructure.
仅扫描用户拥有或获得授权测试的目标。云端平台在外部扫描前会强制验证域名;对于开源CLI,若目标看起来属于第三方基础设施,请自行确认是否获得授权。