arcdatasystems/pentest-ai-agents_gui
GitHub: arcdatasystems/pentest-ai-agents_gui
为 AI 驱动的渗透测试工作流提供持久化发现数据库、Flask Web 管理界面及 CLI 自动写入能力的综合管理平台。
Stars: 1 | Forks: 0
# pentest-ai-db
**pentest-ai-agents 的持久化发现数据库和 Web GUI。**
[](https://www.python.org/)
[](https://sqlite.org/)
[](LICENSE)
pentest-ai-db 为 [pentest-ai-agents](https://github.com/0xSteph/pentest-ai-agents) 生态系统提供了一个可以跨 Claude Code 会话存储发现的场所。SQLite 数据库存储主机、服务、漏洞、凭证和攻击链。Flask Web GUI 允许你浏览、编辑和导出所有内容。一组 Bash CLI 让代理能够自动向其写入数据。
## 包含内容
| 组件 | 描述 |
|-----------|-------------|
| `gui.py` | Flask Web 服务器 — 提供仪表板和 REST API |
| `gui.html` | 单文件前端(无需构建步骤,无需 npm) |
| `findings.sh` | 用于添加和查询主机、服务、漏洞、凭证、链的 CLI |
| `engagement.sh` | 创建、切换、归档和清除授权测试项目 |
| `report.sh` | 从任何授权测试项目生成独立的 HTML 报告 |
| `report-template.html` | 报告模板(使用 `report.conf` 进行自定义) |
| `handoff.sh` | 打印 Markdown 会话交接摘要 |
| `doctor.sh` | 审计此机器上安装了哪些底层的渗透测试工具 |
| `migrate.sh` | 将现有数据库前向迁移至当前的 schema |
| `schema.sql` | SQLite schema(参考 / 手动初始化) |
| `lib/common.sh` | 所有 CLI 共用的共享 shell 库 |
| `hooks/session-start.sh` | Claude Code hook — 在会话开始时显示当前的授权测试项目 |
## 快速开始
```
# 1. Clone
git clone https://github.com/arcdatasystems/pentest-ai-agents_gui.git
cd pentest-ai-db
# 2. 安装唯一的 Python 依赖
pip install flask
# 3. 创建你的第一个 engagement
bash findings.sh init acme-2024 --client "ACME Corp" --type internal --scope "10.0.0.0/24"
# 4. 启动 GUI
python3 gui.py
```
GUI 会自动在 `http://127.0.0.1:5173` 打开。
## CLI 参考
### findings.sh
```
# Engagements
findings.sh init [--client NAME] [--type TYPE] [--scope CIDR]
# Hosts
findings.sh add-host --ip 10.0.0.1 --hostname dc01.corp.local --os "Windows Server 2022"
# Vulnerabilities
findings.sh add-vuln --title "MS17-010 EternalBlue" --severity critical \
--host-ip 10.0.0.1 --cve CVE-2017-0144 --description "..." --remediation "..."
# Credentials
findings.sh add-cred --username administrator --secret "P@ssw0rd" \
--host-ip 10.0.0.1 --secret-type cleartext
# Query
findings.sh stats # Engagement totals
findings.sh list vulns # All vulnerabilities, severity-sorted
findings.sh list hosts # All discovered hosts
findings.sh export # Full JSON dump
```
### engagement.sh
```
engagement.sh list # All engagements with record counts
engagement.sh current # Active engagement
engagement.sh use # Switch active engagement
engagement.sh archive [] # Mark complete, preserve data
engagement.sh purge --yes # Hard-delete everything
```
### gui.py
```
python3 gui.py # Default port 5173, auto-opens browser
python3 gui.py --port 8080 # Custom port
python3 gui.py --no-browser # Skip auto-open
python3 gui.py --db /path/to/db # Custom DB path
```
### report.sh / handoff.sh
```
bash report.sh # Export HTML report for active engagement
bash report.sh --engagement acme-2024 # Specific engagement
bash handoff.sh # Print Markdown session summary
```
## GUI 功能
- **授权测试项目切换器** — 从侧边栏管理多个并发的授权测试项目
- **主机选项卡** — IP、主机名、OS、角色、状态、每个主机对应的服务和漏洞数量
- **漏洞选项卡** — 按严重性排序的表格,包含 CVSS、CVE、PoC 输出、MITRE ID、修复建议
- **服务选项卡** — 每个主机的端口、协议、服务、版本、banner
- **凭证选项卡** — 捕获的凭证及其来源和访问级别
- **攻击链选项卡** — 包含 MITRE ATT&CK ID 和评分的多步骤链
- **报告导出** — 具有可配置品牌的单文件独立 HTML
- **实时数据** — 所有更改立即反映;无需重新加载页面
## 自定义报告品牌
在生成之前编辑 `report.conf`:
```
ORG_NAME="Your Company Name"
PRIMARY_COLOR="#1e3a5f"
ACCENT_COLOR="#1e40af"
LOGO_PATH="/path/to/logo.png"
REPORT_FOOTER="Confidential — Prepared for Client"
```
## Claude Code 集成
将 `hooks/session-start.sh` 放入你的 Claude Code 项目 hook 中,以便在每次会话开始时自动显示当前的授权测试项目。
在 `.claude/settings.json` 中:
```
{
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash /path/to/hooks/session-start.sh"
}
]
}
]
}
}
```
当 `findings.sh` 位于你的 `PATH` 中时,来自 [pentest-ai-agents](https://github.com/0xSteph/pentest-ai-agents) 的代理会自动写入此数据库。
## 数据库位置
默认情况下,数据库位于 `~/.pentest-ai/findings.db`。使用环境变量覆盖:
```
export PENTEST_AI_HOME="/custom/path"
export PENTEST_AI_DB="/custom/path/findings.db"
```
## 升级
如果你拥有来自以前版本的现有数据库:
```
bash migrate.sh
```
该脚本是幂等的 — 可以安全地重新运行。
## 运行测试
```
bash tests/test_findings.sh
bash tests/test_integration.sh
```
## 许可证
[MIT](LICENSE)
标签:后端开发, 多模态安全, 应用安全, 逆向工具