agungprasastia/shield-cli

GitHub: agungprasastia/shield-cli

一个结合 19 个安全工具与多 AI 提供商的渗透测试自动化框架,通过多代理架构实现智能工具选择和自适应测试策略。

Stars: 1 | Forks: 0

``` ███████████████████████ ██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██ ███████╗██╗ ██╗██╗███████╗██╗ ██████╗ ██▓▓▓▓▓▓▓▓███▓▓▓▓▓▓▓▓██ ██╔════╝██║ ██║██║██╔════╝██║ ██╔══██╗ ██▓▓▓▓▓▓▓█████▓▓▓▓▓▓▓██ ███████╗███████║██║█████╗ ██║ ██║ ██║ ██▓▓▓█████████████▓▓▓██ ╚════██║██╔══██║██║██╔══╝ ██║ ██║ ██║ ██▓▓▓▓▓▓▓█████▓▓▓▓▓▓▓██ ███████║██║ ██║██║███████╗███████╗██████╔╝ ██▓▓▓▓▓▓▓▓███▓▓▓▓▓▓▓▓██ ╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚═════╝ ██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██ ██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██ AI-Powered Pentest Framework ███▓▓▓▓▓▓▓▓▓▓▓███ ███▓▓▓▓▓▓▓███ Providers: Gemini • GPT-4 • Claude • OpenRouter ███▓▓▓███ Features: 19 Tools • Smart Workflows • Multi-Agent █████ Shield — Your Digital Armor 🛡️ ```
# 🛡️ Shield CLI [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) **Shield** 是一个由 AI 驱动的渗透测试自动化框架,它结合了多个 AI 提供商(OpenAI GPT-4、Claude、Google Gemini、OpenRouter)与 19 个久经考验的安全工具,以提供智能、自适应的安全评估。 [功能](#-features) • [安装](#-installation) • [快速开始](#-quick-start) • [架构](#️-architecture) • [路线图](#️-roadmap)
## 🚀 功能 ### 🤖 多提供商 AI 智能 - **4 个 AI 提供商**: OpenAI (GPT-4o)、Anthropic (Claude)、Google (Gemini)、OpenRouter - **多代理架构**: 专业的 AI 代理(规划器、工具选择器、分析师、报告器) - **自适应测试**: AI 根据发现的漏洞调整策略 ### 🛠️ 19 个集成安全工具 | 类别 | 工具 | |----------|-------| | **网络** | Nmap、Masscan | | **Web 侦察** | httpx、WhatWeb、Wafw00f | | **子域名** | Subfinder、Amass、DNSRecon | | **漏洞扫描** | Nuclei、Nikto、SQLMap、WPScan | | **SSL/TLS** | TestSSL、SSLyze | | **发现** | Gobuster、FFuf、Arjun | | **分析** | XSStrike、GitLeaks | ### 📊 专业报告 - 面向非技术利益相关者的**执行摘要** - 包含证据和修复步骤的**技术深度分析** - **多种格式**: Markdown、HTML、JSON - **AI 决策追踪**确保完全透明 ### 🔒 安全与合规 - **安全模式**: 防止破坏性工具参数 - **范围验证**: 自动将私有网络列入黑名单 - **人工介入**: 可配置的确认提示 - **完整审计日志** ## 📦 安装 ### 前置条件 - **Python 3.11+** ([下载](https://www.python.org/downloads/)) - **AI 提供商 API 密钥**(至少一个): - [OpenAI](https://platform.openai.com/api-keys) - [Anthropic](https://console.anthropic.com/) - [Google AI Studio](https://makersuite.google.com/app/apikey) ← 有免费套餐 - [OpenRouter](https://openrouter.ai/keys) ### 设置 ``` # 克隆仓库 git clone https://github.com/agungprasastia/shield-cli.git cd shield-cli # 创建虚拟环境 python -m venv venv # 激活 (Windows) .\venv\Scripts\activate # 激活 (Linux/macOS) source venv/bin/activate # 安装 pip install -e . # 初始化 python -m cli.main init ``` ### 配置 API 密钥 编辑 `config/shield.yaml` 或使用环境变量: ``` # Windows PowerShell $env:GOOGLE_API_KEY="your-api-key" # Linux/macOS export GOOGLE_API_KEY="your-api-key" ``` ## ⚡ 快速开始 ``` # 检查设置 python -m cli.main --help # 查看 AI 提供商状态 python -m cli.main models # 列出可用工作流 python -m cli.main workflow list # 运行 Web 渗透测试 python -m cli.main workflow run --name web_pentest --target https://example.com # 快速侦察扫描 python -m cli.main recon https://example.com # 从会话生成 HTML 报告 python -m cli.main report --session 20260405_080000 --format html # 切换 AI 提供商 python -m cli.main workflow run --name recon --target example.com --provider openai ``` ## 🏗️ 架构 ``` ┌─────────────────────────────────────────┐ │ AI Provider Layer │ │ (OpenAI, Claude, Gemini, OpenRouter) │ └─────────────────────────────────────────┘ │ ┌─────────────────────────────────────────┐ │ Multi-Agent System │ │ Planner → Tool Agent → Analyst → │ │ Reporter │ └─────────────────────────────────────────┘ │ ┌─────────────────────────────────────────┐ │ Workflow Engine │ │ - Parameter Priority │ │ - Evidence Capture │ │ - Session Management │ └─────────────────────────────────────────┘ │ ┌─────────────────────────────────────────┐ │ Tool Integration Layer │ │ (19 Security Tools) │ └─────────────────────────────────────────┘ ``` ## 📋 配置 编辑 `config/shield.yaml`: ``` ai: provider: gemini # openai, claude, gemini, openrouter gemini: model: gemini-2.5-pro api_key: null # Or set GOOGLE_API_KEY env var pentest: safe_mode: true # Prevent destructive actions require_confirmation: true output: format: markdown # markdown, html, json save_path: ./reports ``` ## 🐳 Docker ``` # 构建并运行 docker-compose up --build # 运行扫描 docker-compose run shield workflow run --name web_pentest --target example.com ``` ## 🗺️ 路线图 | 版本 | 状态 | 描述 | |---------|--------|-------------| | **v0.1.0** | ✅ 当前 | 核心框架、19 个工具封装、6 个工作流、多 AI 支持 | | v0.2.0 | 🔜 下一个 | 19 个工具端到端测试、改进的错误处理 | | v0.5.0 | 📋 计划中 | HTML 报告仪表盘、实时扫描进度 UI | | v1.0.0 | 🎯 目标 | 生产就绪、Docker 优化、完整文档 | ## 📄 许可证 MIT 许可证 — 详见 [LICENSE](LICENSE)。
标签:AI助手, AI驱动, Claude, CTI, CVE检测, Gemini, GPT-4, OpenRouter, SOC, 多代理, 多模型支持, 文档结构分析, 智能工作流, 渗透测试框架, 网络安全, 自动化渗透, 请求拦截, 运行时操纵, 防御, 隐私保护