Files
ARTEX/README.md
T
2026-08-07 10:20:56 +08:00

154 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div align="center">
# ARTEX
AI 自主渗透测试系统(Go 后端 + Next.js 前端)
🌐 **在线 Demo**: [https://artex-demo.vercel.app/](https://artex-demo.vercel.app/)
</div>
---
## 截图预览
> 完整交互见[在线 Demo](https://artex-demo.vercel.app/)。
| 仪表盘(总览 / Token 消耗 / 活动流) | 任务列表 |
| :---: | :---: |
| ![仪表盘](screenshots/dashboard.png) | ![任务](screenshots/tasks.png) |
| 任务 · 执行过程(会话 / 工具调用) | 探索链路 |
| :---: | :---: |
| ![执行过程](screenshots/sessions.png) | ![探索链路](screenshots/graph.png) |
| 发现 | 资产 |
| :---: | :---: |
| ![发现](screenshots/findings.png) | ![资产](screenshots/assets.png) |
| 流量录制 | 人在环路对话 |
| :---: | :---: |
| ![流量](screenshots/traffic.png) | ![对话](screenshots/chat.png) |
| Agent 管理 | LLM 配置 |
| :---: | :---: |
| ![Agent](screenshots/agents.png) | ![LLM](screenshots/llm.png) |
| 拦截审批 | 后端日志 |
| :---: | :---: |
| ![拦截](screenshots/intercept.png) | ![日志](screenshots/logs.png) |
---
## 资产同步(ScopeSentry)
支持从 [ScopeSentry](https://github.com/Autumn-27/ScopeSentry) 直接同步资产数据,免去重复收集:
- 在「**资产同步**」页填 ScopeSentry 的地址与 API Key,接入数据源;
- 按**项目**或**任务**维度选择要同步的目标与资产类型(域名 / 子域 / IP / 端口 / 站点 / 端点…);
- 一键导入并按公司资产范围归并,直接进入 ARTEX 的资产图供 agent 探索使用。
---
## 安装
> 依赖数据库 **PostgreSQL**;探索需配置 **LLM**(`ANTHROPIC_API_KEY` 或 `OPENAI_API_KEY`,也可在 UI 里配)。
### 方式一:一键安装脚本(推荐)
```bash
git clone https://github.com/Autumn-27/ARTEX.git
cd ARTEX
./install.sh
```
脚本会:检测 / 自动安装 Docker → 让你选 **① 全部 Docker** 或 **② 本地编译运行**:
- **① 全部 Docker**:填一个 Postgres 密码(可回车随机)→ 自动写 `.env` → `docker compose up -d`。
- **② 本地运行**:选数据库(连已有 / 用 Docker 起一个)→ 生成 `config.json` → `go` 编译内嵌单二进制 → 启动。
装好后打开 **http://localhost:8787**(首次进入 `/setup` 设置管理员密码)。
### 方式二:Docker Compose(手动)
```bash
git clone https://github.com/Autumn-27/ARTEX.git
cd ARTEX
cp .env.example .env # 填 POSTGRES_PASSWORD、可选 ANTHROPIC_API_KEY
docker compose up -d # 拉取 autumn27/artex 镜像 + postgres
# → http://localhost:8787
```
镜像已含常用工具(ripgrep/curl/vim/npm/nmap…);`./skills` 与 `./data` 以绑定挂载持久化。
### 方式三:下载预编译二进制(Releases)
到 [Releases](https://github.com/Autumn-27/ARTEX/releases) 下载对应平台的 zip,解压后得到 `artex` + `skills/` + `config.example.json`:
```bash
cp config.example.json config.json # 填好 database 连接
./artex # → http://localhost:8787
```
### 方式四:从源码编译单二进制
```bash
# 1) 前端静态导出
cd web && npm ci && npm run build:static && cd ..
# 2) 拷进内嵌目录
cp -r web/out server/webui/dist
# 3) 编译(-tags embedui 才内嵌前端)
CGO_ENABLED=0 go build -tags embedui -o artex ./cmd/artex
./artex
```
---
## 配置
**数据库**(`config.json`,或用环境变量 `ARTEX_PG_DSN` 覆盖):
```json
{
"database": {
"host": "127.0.0.1", "port": 5432,
"user": "artex", "password": "yourpass",
"dbname": "artex", "sslmode": "disable"
}
}
```
**LLM**:`export ANTHROPIC_API_KEY=sk-...`(或 `OPENAI_API_KEY`),也可在 UI 的「LLM 配置」页填写。
可选:`ARTEX_LLM_PROVIDER` / `ARTEX_LLM_MODEL` / `ARTEX_LLM_BASE_URL` / `ARTEX_LLM_PROXY`。
**并发**:每个任务的 work agent 数在「系统设置」里配置(默认 3)。
**常用参数**:`./artex -addr :8787 -proxy :8788`(`-addr` 前端+API,`-proxy` 流量录制代理)。
---
## 开发
```bash
./dev.sh # 后端(:8787) + 流量代理(:8788) + 前端 next dev(:5173) → http://localhost:5173
```
- 后端:`go run ./cmd/artex`(不带 `-tags embedui` 则不内嵌前端)
- 前端:`cd web && npm run dev`(`/api` 反代到后端,带热更新)
- 测试:`go test ./...`
- Mock 预览(无后端):`cd web && NEXT_PUBLIC_MOCK=1 npm run dev`
---
## 参考
任务的核心理念来源于:https://github.com/oritera/Cairn
## 许可
仅供授权测试与研究使用。