Audumber-11/guard-scanner-ai

GitHub: Audumber-11/guard-scanner-ai

一款基于 FastAPI 与 React 的全栈安全漏洞扫描与可视化仪表盘,解决网站安全配置与暴露风险的统一检测问题。

Stars: 0 | Forks: 0

# 🛡️ guard-scanner-ai — 安全漏洞扫描器与仪表板

一款实时安全分析工具,用于扫描网站的漏洞、配置错误和暴露风险。

## 🎯 概述 SecScanner 是一款全栈安全扫描应用程序,可对任何目标 URL 执行自动化检查,并在专业的网络安全主题仪表板中展示结果。 ### 扫描内容 | 类别 | 执行的检查 | |----------|-----------------| | **安全 Headers** | HSTS, Content-Security-Policy, X-XSS-Protection, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy | | **端口扫描** | 探测端口 80, 443, 8080, 8443, 21, 22, 3306, 5432 并进行服务识别 | | **SSL/TLS** | 验证端口 443 上的 SSL 证书 | | **服务器指纹识别** | 从响应 headers 检测 Web 服务器软件 | ### 评分系统 每次扫描都会基于以下条件产生满分 **100** 的得分: - **缺失的安全 headers**:根据严重程度(高/中/低)扣除 -5 到 -15 分 - **危险开放端口**(FTP、SSH、数据库):每个扣 -5 分 - **无效/缺失 SSL**:扣 -10 分 | 得分范围 | 评级 | |-------------|--------| | 80–100 | 🟢 **安全** | | 50–79 | 🟡 **警告** | | 0–49 | 🔴 **严重** | ## 🏗️ 架构 ``` ┌─────────────────────────┐ ┌─────────────────────────┐ │ React Frontend │────▶│ FastAPI Backend │ │ Vite + TypeScript + │ │ /scan /scans /health │ │ Tailwind CSS │ │ │ │ Recharts + Lucide │ │ Scanner Engine │ └─────────────────────────┘ │ ├─ Header Checker │ │ ├─ Port Scanner │ │ └─ SSL Validator │ │ │ │ SQLite (scans.db) │ └─────────────────────────┘ ``` ## ⚡ 快速开始 ### 前置条件 - **Python** 3.10+ - **Node.js** 18+ - **npm** 9+ ### 1. 后端设置 ``` cd backend # 安装 dependencies pip install -r requirements.txt # 启动 API server uvicorn main:app --host 0.0.0.0 --port 8000 --reload ``` API 将在 `http://localhost:8000` 提供。交互式文档位于 `http://localhost:8000/docs`。 ### 2. 前端设置 ``` cd frontend # 安装 dependencies npm install # 启动 dev server npm run dev ``` 仪表板将在 `http://localhost:5173` 提供。 ### 3. 环境配置 在 `frontend/` 目录中创建一个 `.env` 文件,以指向您的后端: ``` VITE_API_URL=http://localhost:8000 ``` ## 📡 API 参考 ### `POST /scan` 对目标 URL 运行安全扫描。 **请求:** ``` { "url": "https://example.com" } ``` **响应:** ``` { "id": 1, "url": "https://example.com", "hostname": "example.com", "overall_score": 45, "ssl_valid": true, "server_info": "ECAcc (dcd/7D5A)", "headers": [ { "header": "Strict-Transport-Security (HSTS)", "key": "strict-transport-security", "present": false, "value": "", "severity": "high", "description": "Enforces HTTPS connections to the server." } ], "ports": [ { "port": 80, "status": "open" }, { "port": 443, "status": "open" }, { "port": 8080, "status": "closed" } ] } ``` ## 🎨 前端功能 - **暗色网络安全主题**,带有霓虹效果和玻璃拟态卡片 - **动态评分仪表盘**,带有颜色编码的评级 - **安全 headers 表格**,带有严重性徽章和存在状态指示器 - **端口扫描网格**,带有服务识别和状态指示器 - **扫描历史记录**,带有分数预览和快速导航 - **统计栏**,汇总所有过往扫描的数据 - **响应式设计**,适用于桌面和移动设备 - **加载动画**,带有同心旋转环 ## 🧪 测试 ### 后端测试 ``` cd backend python -m pytest test_backend.py -x -q ``` 测试涵盖: - 分数计算(满分、零 headers、无 SSL、危险端口、下限为 0) - 数据库 CRUD 操作(插入、按 ID 检索、列出扫描记录) - 端口扫描器行为(关闭端口检测) - 安全 header 定义 ## 📁 项目结构 ``` guard-scanner-ai/ ├── README.md ├── backend/ │ ├── main.py # FastAPI app with CORS, routes, lifespan │ ├── scanner.py # Core scanning engine (headers, ports, SSL) │ ├── database.py # SQLite async database layer │ ├── requirements.txt # Python dependencies │ └── test_backend.py # pytest test suite └── frontend/ ├── index.html ├── package.json ├── vite.config.ts ├── tsconfig.json └── src/ ├── main.tsx ├── index.css # Tailwind + custom cyber theme ├── App.tsx # Main app with routing state ├── api/ │ └── client.ts # API client functions ├── types/ │ └── scan.ts # TypeScript type definitions └── components/ ├── ScanForm.tsx # URL input with submit ├── ScanDetail.tsx # Full scan result view ├── ScoreGauge.tsx # SVG circular score gauge ├── HeadersTable.tsx # Security headers breakdown ├── PortsGrid.tsx # Port scan results grid ├── ScanHistory.tsx # Past scans list └── StatsBar.tsx # Aggregate statistics ``` ## 🔒 安全说明 - 此工具专为**授权的安全评估**设计 - 端口扫描可能会被入侵检测系统标记 - 在扫描第三方基础设施之前,请务必获得适当的授权 - 扫描器对 HTTPS 使用 `verify=False`,以便检查具有自签名证书的站点上的 headers - 不存储任何凭据或敏感数据 — 仅存储扫描元数据 ## 📄 许可证 MIT 许可证 — 可自由用于安全研究、教育和授权测试。 由 [Audumber-11](https://github.com/Audumber-11) 构建
标签:AV绕过, FastAPI, React, SSL/TLS验证, Syscalls, TypeScript, 全栈应用, 安全插件, 安全漏洞扫描器, 实时处理, 插件系统, 数据统计, 端口扫描, 自动化攻击