TheSecuredAnalyst/security-suite

GitHub: TheSecuredAnalyst/security-suite

一个集成了 OSINT 侦察、Web/API 安全测试与 AI 分析的综合型开源安全评估套件。

Stars: 71 | Forks: 11

# 安全套件 [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/6e2dcfda25102337.svg)](https://github.com/53cur3dL34rn/security-suite/actions/workflows/ci.yml) [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/) [![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) 一个综合性的开源安全工具套件,用于 OSINT 侦察、Web 安全测试、API 安全评估和合规性检查,并提供 AI 驱动的分析。 ``` ____ ____ _ __ / __/__ ___ / __/_ __(_) /____ _\ \/ -_) __/ _\ \/ // / / __/ -_) /___/\__/\__/ /___/\_,_/_/\__/\__/ =[ SecSuite v0.1.0 ]= + -- --=[ 11 OSINT modules | 6 Web scanners | 4 API security tools ]=-- + -- --=[ AI-powered analysis with Ollama/Anthropic/OpenAI ]=-- + -- --=[ SIEM integration | Scheduled scans | REST API ]=-- ``` ## 快速设置(一条命令) 克隆仓库,然后运行适用于您的操作系统的设置脚本。它会自动安装 Python、所有依赖项、Ollama 以及本地 AI 模型。 ### Linux / macOS ``` git clone https://github.com/53cur3dL34rn/security-suite.git cd security-suite bash setup.sh ``` 选项: ``` bash setup.sh --model qwen2.5 # choose a different AI model bash setup.sh --no-ollama # skip Ollama / AI setup bash setup.sh --no-extras # skip nmap / searchsploit ``` ### Windows 以普通用户身份打开 PowerShell(无需管理员权限)并运行: ``` git clone https://github.com/53cur3dL34rn/security-suite.git cd security-suite powershell -ExecutionPolicy Bypass -File setup.ps1 ``` 选项: ``` # 选择不同的 AI 模型 powershell -ExecutionPolicy Bypass -File setup.ps1 -Model qwen2.5 # 跳过 Ollama powershell -ExecutionPolicy Bypass -File setup.ps1 -NoOllama # 跳过 nmap powershell -ExecutionPolicy Bypass -File setup.ps1 -NoExtras ``` 设置完成后,每当您打开新的终端时,请激活环境: ``` # Linux / macOS source venv/bin/activate # Windows PowerShell .\venv\Scripts\Activate.ps1 ``` ## 核心功能 | 模块 | 功能 | 工具 | |--------|-------------|-------| | **OSINT** | DNS、WHOIS、子域名、端口、技术检测、标头、电子邮件 | nmap, Shodan, VirusTotal | | **Web Scanner** | XSS、SQLi、目录暴力破解、SSL/TLS 分析、爬虫 | Nuclei | | **API Security** | OpenAPI 解析、身份验证绕过、JWT 测试、BOLA/IDOR、模糊测试 | REST API | | **AI Analysis** | 发现结果关联、执行摘要、交互式 LLM 修复 | Ollama, Anthropic, OpenAI | | **REST API** | 通过 HTTP 以编程方式触发扫描并检索结果 | FastAPI | | **SIEM** | Splunk、Elasticsearch、Syslog、webhooks (Slack/Discord/PagerDuty) | CEF/LEEF | | **Scheduler** | 基于 Cron 的定期扫描,具有持久化历史记录 | — | | **Compliance** | OWASP Top 10、CIS Controls 评估 | — | | **Exploit** | 漏洞利用搜索和 CVE 查找 | SearchSploit, Exploit-DB | | **Phishing** | 安全意识活动和模拟 | — | ## 演示 ### DNS 枚举 ``` $ secsuite osint dns example.com DNS Enumeration: example.com ╭──────────────────────── [INFO] IPv4 Addresses Found ─────────────────────────╮ │ Domain resolves to 2 IPv4 address(es) │ ╰──────────────────────────────────────────────────────────────────────────────╯ addresses: ['104.18.27.120', '104.18.26.120'] ... Completed in 0.68s ``` ### SSL/TLS 分析 ``` $ secsuite scan ssl example.com SSL/TLS Analysis: example.com ╭──────────────────────────── [HIGH] SSLv3 Enabled ────────────────────────────╮ │ SSLv3 is enabled - vulnerable to POODLE attack │ ╰──────────────────────────────────────────────────────────────────────────────╯ Completed in 0.78s ``` ### REST API(交互式文档) ``` $ secsuite serve Starting Security Suite API on http://0.0.0.0:8000 Interactive docs: http://localhost:8000/docs ``` 然后在浏览器中打开 `http://localhost:8000/docs`,以交互方式探索和测试所有 endpoint。 ## 架构 ``` ┌──────────────────────────────────────────────────────────────────┐ │ User Interface │ ├───────────────────────────┬──────────────────────────────────────┤ │ CLI (Typer) │ REST API (FastAPI) │ │ secsuite │ /api/v1/scans │ │ │ /api/v1/apisec ← API sec testing │ │ │ /api/v1/results │ │ │ /api/v1/modules │ └───────────────────────────┴──────────────────────────────────────┘ │ ▼ ┌──────────────────────────────────────────────────────────────────┐ │ Core Infrastructure │ │ Target Model · Config · Logging · Caching · Error Handling │ │ HTTP Client · Exporters (JSON/CSV/HTML/Markdown) │ └──────────────────────────────────────────────────────────────────┘ │ ▼ ┌──────────────────────────────────────────────────────────────────┐ │ Scanning Modules │ │ OSINT (11) · Web Scanner (6) · API Security (4) │ │ AI Analysis · SIEM (4) · Scheduler · Compliance │ │ Exploit · Phishing · Vuln Scan · Threat Intel │ └──────────────────────────────────────────────────────────────────┘ ``` ## 手动安装 如果您不想使用设置脚本: ``` git clone https://github.com/53cur3dL34rn/security-suite.git cd security-suite # 创建并激活虚拟环境 python3 -m venv venv source venv/bin/activate # Linux/macOS # .\venv\Scripts\Activate.ps1 # Windows PowerShell # 安装(选择其一) pip install -e . # base only pip install -e ".[all]" # everything (recommended) pip install -e ".[dashboard]" # adds FastAPI/uvicorn for the REST API pip install -e ".[ai]" # adds Anthropic/OpenAI SDK ``` ## 配置 将 `.env.example` 复制到 `.env` 并添加您的 API 密钥(全部可选): ``` cp .env.example .env ``` | 变量 | 服务 | 是否必需 | |----------|---------|----------| | `SECSUITE_SHODAN_API_KEY` | Shodan 主机情报 | 否 | | `SECSUITE_VIRUSTOTAL_API_KEY` | VirusTotal 恶意软件分析 | 否 | | `SECSUITE_ANTHROPIC_API_KEY` | Claude AI 分析 | 否 | | `SECSUITE_OPENAI_API_KEY` | GPT AI 分析 | 否 | | `SECSUITE_API_KEY` | 使用密钥保护 REST API | 否 | 核心功能无需任何 API 密钥即可运行。对于无需密钥的本地 AI,请使用 Ollama(已包含在设置脚本中)。 ## 用法 ### OSINT 侦察 ``` secsuite osint dns example.com # DNS enumeration secsuite osint whois example.com # WHOIS lookup secsuite osint subdomains example.com # Subdomain discovery secsuite osint headers https://example.com # HTTP security headers secsuite osint ports 192.168.1.1 # Port scan (requires nmap) secsuite osint tech https://example.com # Technology detection secsuite osint emails example.com # Email harvesting secsuite osint vt example.com # VirusTotal lookup secsuite osint shodan 8.8.8.8 # Shodan lookup secsuite osint full example.com # Run all OSINT modules ``` ### Web 安全扫描 ``` secsuite scan crawl https://example.com secsuite scan xss "https://example.com/search?q=test" secsuite scan sqli "https://example.com/product?id=1" secsuite scan dirs https://example.com secsuite scan ssl example.com secsuite scan nuclei https://example.com ``` ### API 安全测试 — 您需要首先了解的内容 如果您对 API 不太熟悉,以下是简短说明: **如何为您自己的应用程序查找规范:** 如果您使用 FastAPI、Django REST Framework 或类似框架构建应用程序,规范通常是自动生成的。可以在浏览器中尝试访问的常见位置: ``` http://localhost:8000/openapi.json ← FastAPI default http://localhost:8000/swagger.json http://localhost:8000/api-docs http://localhost:8000/swagger/v1/swagger.json ← .NET / ASP.NET http://localhost:8000/v2/api-docs ← Spring Boot ``` 或者让 Security Suite 自动为您搜索: ``` secsuite serve # 然后: curl -X POST http://localhost:8000/api/v1/apisec/discover \ -H "Content-Type: application/json" \ -d '{"base_url": "http://localhost:YOUR_APP_PORT"}' ``` **完整示例 — 测试您自己的 FastAPI 应用程序:** ``` # 终端 1:启动你的应用(示例) uvicorn myapp:app --port 5000 # 终端 2:针对它运行 Security Suite source venv/bin/activate secsuite api scan http://localhost:5000/openapi.json ``` ### API 安全测试 (CLI) ``` # 指向 OpenAPI/Swagger spec URL 并运行所有测试 secsuite api scan https://api.example.com/openapi.json # 为经过身份验证的 endpoints 使用 bearer token secsuite api scan https://api.example.com/openapi.json --token eyJhbGci... # 对所有 endpoints 进行 Fuzz secsuite api fuzz https://api.example.com/openapi.json --max 200 # 专门测试身份验证 secsuite api auth-test https://api.example.com/openapi.json ``` ### REST API 服务器 ``` # 启动服务器(在 http://localhost:8000/docs 打开文档) secsuite serve # 自定义端口 secsuite serve --port 9000 # 带有 API 密钥保护(调用者必须发送 X-API-Key header) secsuite serve --api-key mysecretkey # Dev 模式(代码更改时自动重载) secsuite serve --reload ``` **通过 REST 进行 API 安全测试:** ``` # 1. 探测目标 API 上 OpenAPI spec 的位置 curl -X POST http://localhost:8000/api/v1/apisec/discover \ -H "Content-Type: application/json" \ -d '{"base_url": "https://api.example.com"}' # 2. 解析 spec 以查看存在哪些 endpoints curl -X POST http://localhost:8000/api/v1/apisec/parse \ -H "Content-Type: application/json" \ -d '{"base_url": "https://api.example.com/openapi.json"}' # 3. 运行完整的 API 安全扫描 curl -X POST http://localhost:8000/api/v1/apisec/scan \ -H "Content-Type: application/json" \ -d '{ "spec_url": "https://api.example.com/openapi.json", "modules": ["endpoints", "auth", "fuzzer"], "auth_token": "eyJhbGci..." }' # 4. 使用第 3 步的 scan_id 轮询结果 curl http://localhost:8000/api/v1/scans/{scan_id} ``` **可用的 apisec 模块:** | 模块 | 检查内容 | |--------|---------------| | `endpoints` | BOLA/IDOR、SQL/NoSQL/命令注入、批量赋值、信息泄露 | | `auth` | 身份验证绕过、损坏的身份验证、JWT 漏洞(none-alg、缺少 exp)、速率限制 | | `fuzzer` | 边界值、注入 payload、格式错误的 body — 查找崩溃和泄露 | ### AI 驱动的分析 ``` # 使用本地 AI 模型分析目标(无需 API key) secsuite ai analyze example.com --provider ollama --model llama3.2 # 使用 Claude 或 GPT(需要在 .env 中提供 API key) secsuite ai analyze example.com --provider anthropic secsuite ai analyze example.com --provider openai # 提出安全问题 secsuite ai ask "How do I harden SSH on Ubuntu?" --provider ollama --model llama3.2 # 面向管理层的执行摘要 secsuite ai executive example.com --provider ollama --model qwen2.5 # 关联发现并识别攻击链 secsuite ai correlate example.com # 交互式修复 —— 先扫描,然后引导你完成修复 secsuite ai remediate localhost --provider ollama --model qwen2.5 secsuite ai remediate localhost --dry-run # preview without executing ``` ### 报告 ``` secsuite report html example.com -o report.html secsuite report html example.com -o report.html --ai --provider ollama --model llama3.2 secsuite report json example.com -o report.json secsuite report remediation "sql injection" ``` ### 其他命令 ``` secsuite vuln scan 192.168.1.0/24 # Network vulnerability scan secsuite threat ip 8.8.8.8 # IP threat intelligence secsuite password audit "MyPassword123" # Password strength check secsuite password generate --length 24 # Generate secure password secsuite schedule create "Weekly" --target example.com --frequency weekly secsuite exploit search "apache 2.4" secsuite phish templates secsuite config # Show current configuration secsuite wordlists # Show wordlist status ``` ## 本地 LLM 设置 (Ollama) 如果您使用了设置脚本,则已安装 Ollama 并下载了模型。 要添加更多模型: ``` # 小/快速(适用于大多数系统) ollama pull llama3.2 # 3B params, ~2 GB, fast ollama pull qwen2.5:3b # 3B params, excellent instruction following # 更高质量(需要约 6 GB RAM) ollama pull qwen2.5:7b ollama pull llama3.1:8b ollama pull mistral:7b # 将任何模型与 secsuite 配合使用 secsuite ai ask "Explain SSRF" --provider ollama --model qwen2.5:7b ``` ## AI 驱动的修复 `secsuite ai remediate` 会扫描目标,然后使用本地 LLM 以交互方式引导您完成每个发现结果的修复。无需云端环境。 ``` secsuite ai remediate localhost -p ollama -m qwen2.5:7b ``` ``` SecSuite AI Remediation — localhost Scan complete — 4 finding(s) Finding 1/4 ────────────────────────────────── [HIGH] Redis running without authentication ✗ /etc/redis/redis.conf writable → Run with sudo ✓ sudo access available ✓ redis service running Suggested commands (qwen2.5:7b): [CHECK] redis-cli -h 127.0.0.1 ping [FIX] sudo sed -i 's/^# requirepass .*/requirepass ChangeMe123/' /etc/redis/redis.conf [VERIFY] sudo systemctl restart redis Apply? [y/n/e/s/q]: _ ``` | 键 | 操作 | |-----|--------| | `y` | 执行建议的修复 | | `n` | 跳过 | | `e` | 在运行前编辑命令 | | `s` | 向 LLM 提出后续问题 | | `q` | 退出 | ## 外部依赖项 某些功能需要外部工具(全部可选): | 工具 | 功能 | 安装 | |------|---------|---------| | nmap | 端口扫描 | `apt install nmap` / `winget install Insecure.Nmap` | | nuclei | 漏洞扫描 | [github.com/projectdiscovery/nuclei](https://github.com/projectdiscovery/nuclei) | | searchsploit | 漏洞利用搜索 | `apt install exploitdb` | | Ollama | 本地 AI | 包含在设置脚本中 | ## 项目结构 ``` security-suite/ ├── setup.sh ← Linux/macOS one-command setup ├── setup.ps1 ← Windows one-command setup ├── cli/ # CLI commands (Typer) ├── core/ # Shared models, config, logging, caching ├── api/ # REST API (FastAPI) │ └── routers/ │ ├── scans.py # Scan CRUD endpoints │ ├── results.py # Export / summary endpoints │ ├── modules.py # Module info │ ├── health.py # Health check │ └── apisec.py # API security testing endpoints ├── modules/ │ ├── osint/ # 11 OSINT modules │ ├── webscanner/ # 6 web security scanners │ ├── apisec/ # 4 API security modules │ ├── ai/ # AI analysis + remediation │ ├── siem/ # SIEM integration (4 backends) │ ├── vulnscan/ # Network vulnerability scanner │ ├── threat_intel/ # IP threat intelligence │ ├── password/ # Password audit + generation │ ├── scheduler/ # Scheduled scans │ ├── compliance/ # OWASP/CIS compliance │ ├── exploit/ # Exploit search │ └── phishing/ # Phishing simulation ├── dashboard/ # Web UI ├── tests/ # Test suite ├── .env.example # Environment template ├── pyproject.toml # Package config └── USAGE.md # Detailed usage examples ``` ## 开发 ``` pip install -e ".[dev]" pytest # Run all tests pytest --cov=core --cov=modules # With coverage ruff check . # Lint mypy core modules # Type check ``` ## 文档 | 文档 | 描述 | |----------|-------------| | [QUICK_START.md](QUICK_START.md) | 包含前 5 次扫描的分步入门指南 | | [USAGE.md](USAGE.md) | 带有示例的完整 CLI 参考 | | [TROUBLESHOOTING.md](TROUBLESHOOTING.md) | 常见问题的修复方法,包括 Windows 特定的问题 | | [ARCHITECTURE.md](ARCHITECTURE.md) | 系统设计和数据流 | ## 免责声明 本工具仅供**授权的安全测试和教育用途**使用。 - 在测试您不拥有的系统之前,请务必获得书面许可 - 钓鱼模拟必须是已批准的安全意识计划的一部分 - 开发者不对滥用行为负责 ## 许可证 AGPL-3.0 — 请参阅 [LICENSE](LICENSE)。
标签:AI风险缓解, API安全, GitHub, JSON输出, Python, SIEM集成, Web安全, 人工智能, 安全工具箱, 实时处理, 密码管理, 属性图, 无后门, 构建工具, 用户模式Hook绕过, 蓝队分析, 逆向工具