
# GHOSTCREW
### AI 渗透测试智能体
[](https://www.python.org/) [](LICENSE.txt) [](https://github.com/GH05TCREW/ghostcrew/releases) [](https://github.com/GH05TCREW/ghostcrew) [](https://github.com/GH05TCREW/ghostcrew)
[🇺🇸 English](README.md) | [🇨🇳 中文文档](README_zh.md)
https://github.com/user-attachments/assets/a67db2b5-672a-43df-b709-149c8eaee975
## 要求
- Python 3.10+
- OpenAI, Anthropic 或其他支持 LiteLLM 的提供商的 API 密钥
## 安装
```bash
# 克隆仓库
git clone https://github.com/GH05TCREW/ghostcrew.git
cd ghostcrew
# 设置 (创建虚拟环境, 安装依赖)
.\scripts\setup.ps1 # Windows
./scripts/setup.sh # Linux/macOS
# 或者手动安装
python -m venv venv
.\venv\Scripts\Activate.ps1 # Windows
source venv/bin/activate # Linux/macOS
pip install -e ".[all]"
playwright install chromium # 浏览器工具需要
```
## 配置
在项目根目录创建 `.env` 文件:
```
ANTHROPIC_API_KEY=sk-ant-...
GHOSTCREW_MODEL=claude-sonnet-4-20250514
```
或者使用 OpenAI:
```
OPENAI_API_KEY=sk-...
GHOSTCREW_MODEL=gpt-5
```
任何 [LiteLLM 支持的模型](https://docs.litellm.ai/docs/providers) 都可以使用。
## 运行
```bash
ghostcrew # 启动 TUI (终端用户界面)
ghostcrew -t 192.168.1.1 # 启动并指定目标
ghostcrew --docker # 在 Docker 容器中运行工具
```
## Docker
在 Docker 容器中运行工具,以实现隔离并使用预安装的渗透测试工具。
### 选项 1: 拉取预构建镜像 (最快)
```bash
# 基础镜像 (包含 nmap, netcat, curl)
docker run -it --rm \
-e ANTHROPIC_API_KEY=your-key \
-e GHOSTCREW_MODEL=claude-sonnet-4-20250514 \
ghcr.io/gh05tcrew/ghostcrew:latest
# Kali 镜像 (包含 metasploit, sqlmap, hydra 等)
docker run -it --rm \
-e ANTHROPIC_API_KEY=your-key \
ghcr.io/gh05tcrew/ghostcrew:kali
```
### 选项 2: 本地构建
```bash
# 构建
docker compose build
# 运行
docker compose run --rm ghostcrew
# 或者使用 Kali
docker compose --profile kali build
docker compose --profile kali run --rm ghostcrew-kali
```
容器运行 GhostCrew 并可以访问 Linux 渗透测试工具。代理可以通过终端工具直接使用 `nmap`, `msfconsole`, `sqlmap` 等。
需要安装并运行 Docker。
## 模式
GhostCrew 有三种模式,可通过 TUI 中的命令访问:
| 模式 | 命令 | 描述 |
|------|---------|-------------|
| 辅助 (Assist) | (默认) | 与代理聊天。你控制流程。 |
| 代理 (Agent) | `/agent <任务>` | 自主执行单个任务。 |
| 团队 (Crew) | `/crew <任务>` | 多代理模式。协调器生成专门的工作者。 |
### TUI 命令
```
/agent