en0th/hermes-ai-pentest-platform
GitHub: en0th/hermes-ai-pentest-platform
面向 AI Agent 的渗透测试过程编排 API 平台,通过 SQLite 统一管理资产、任务、证据、漏洞发现与覆盖率,支持时间窗口约束和断点续测。
Stars: 1 | Forks: 0
# Hermes AI Pentest Platform
Hermes 是一个面向 AI Agent 的安全测试资产与过程编排平台 API。它把项目、目标、资产、测试任务、Agent 会话、测试轮次、执行证据、漏洞发现、覆盖率、时间窗口和断点续测统一到一个可恢复、可审计的 SQLite 数据模型中。
当前版本是工程 MVP,重点解决:
- AI Agent 持续轮询获取下一步任务
- 项目授权时间窗口约束
- 窗口结束前保存 checkpoint,避免提前总结
- 资产、任务、证据、漏洞、覆盖率解耦存储
- 窗口报告和最终报告的结构化生成
- 零第三方依赖的核心运行与测试
## 快速开始
cd /Volumes/PQEEEEEEEEE/workspace/hermes-ai-pentest-platform
python3 -m hermes_platform init
python3 -m hermes_platform demo-seed
python3 -m hermes_platform serve --port 8088
健康检查:
curl http://127.0.0.1:8088/health
获取 Hermes 下一步动作:
curl http://127.0.0.1:8088/api/agent/next-action
运行测试:
python3 -m unittest discover -s tests
## 目录结构
hermes_platform/
cli.py 命令行入口
db.py SQLite schema 与连接管理
http_server.py 零依赖 HTTP API
platform.py 领域服务编排
repository.py 数据访问层
scheduler.py 时间窗口、状态机、续测逻辑
reporting.py 报告生成
fastapi_app.py 可选 FastAPI 入口
docs/
design.md
api_spec.md
hermes_agent_protocol.md
operations.md
tests/
test_platform.py
test_scheduler.py
## API 示例
创建项目:
curl -X POST http://127.0.0.1:8088/api/projects \
-H 'Content-Type: application/json' \
-d '{"name":"年度互联网资产渗透测试","owner":"security-team","project_type":"pentest"}'
创建目标:
curl -X POST http://127.0.0.1:8088/api/projects//targets \
-H 'Content-Type: application/json' \
-d '{"name":"互联网出口","scope":{"include":["*.example.com"],"exclude":["prod-db"]}}'
创建资产:
curl -X POST http://127.0.0.1:8088/api/targets//assets \
-H 'Content-Type: application/json' \
-d '{"asset_type":"web","value":"https://app.example.com","metadata":{"port":443}}'
创建任务:
curl -X POST http://127.0.0.1:8088/api/projects//tasks \
-H 'Content-Type: application/json' \
-d '{"title":"Web 漏洞扫描","objective":"发现高危漏洞","target_id":"","phase":"scanning"}'
提交一轮测试结果:
curl -X POST http://127.0.0.1:8088/api/sessions//rounds \
-H 'Content-Type: application/json' \
-d '{
"summary":"完成目录扫描并发现可疑上传接口",
"phase":"scanning",
"actions":[{"tool":"ffuf","command":"ffuf -u https://app.example.com/FUZZ"}],
"evidence":[{"kind":"http_response","title":"上传接口响应","content":{"status":200,"path":"/upload"}}],
"findings":[{"title":"未授权上传接口","severity":"high","confidence":"medium","status":"suspected"}],
"coverage":[{"surface":"web:/upload","status":"partial","technique":"content-discovery"}]
}'
## 可选 FastAPI
核心服务无需第三方依赖。若希望用 FastAPI/uvicorn 运行:
python3 -m pip install -e '.[api]'
uvicorn hermes_platform.fastapi_app:app --reload
## 安全边界
Hermes 平台只做授权测试过程编排和证据记录,不内置真实攻击利用器。所有主动扫描、漏洞验证和外部请求能力应由受控工具执行器接入,并在任务 scope、时间窗口和证据规则下运行。
标签:SQLite, 任务调度, 安全测试编排, 状态机, 网络空间测绘, 逆向工具