nobuo-miura/ShieldScan

GitHub: nobuo-miura/ShieldScan

一款基于 Web 的安全扫描工具,对 HTTP 安全头进行评分评级,并集成 CORS、JWT、SSL/TLS 和 Cookie 的安全诊断功能。

Stars: 0 | Forks: 0

# ShieldScan [English](README.md) | [日本語](README.ja.md) 一个基于 Web 的安全扫描工具,用于分析 HTTP 响应头,对其进行评分并分配评级。 除了安全头评估外,它还提供了 CORS、JWT、SSL/TLS 和 Cookies 的诊断功能。 ![ShieldScan 截图](https://static.pigsec.cn/wp-content/uploads/repos/cas/0e/0e5536161b3896c3819798ef3dbbd844f0b3640f074445b163b5fafea67767f2.jpg) ## 功能 | 标签页 | 描述 | |---|---| | **Security Headers** | 对 8 个安全头进行评分,并分配从 A+ 到 F 的评级 | | **CORS Scan** | 检测 CORS 错误配置(源反射、null 源、前/后域名匹配) | | **JWT Analyzer** | JWT token 的静态分析(alg:none、kid 注入、过期时间、payload 中的敏感数据) | | **SSL/TLS Check** | 检查 TLS 版本、密码套件、证书过期时间以及主机名匹配 | | **Cookie Audit** | 审计 Secure、HttpOnly 和 SameSite 标志配置 | 附加功能: - 各个响应头评分的雷达图可视化 - 针对每个检测到的问题提供改进建议 - 扫描历史记录(最新 50 条,按最新顺序优先排列) ## 技术栈 - **后端**:Go - **前端**:React + Vite + Tailwind CSS + Recharts - **基础设施**:Docker / Docker Compose ## 快速开始 ### Docker Compose(推荐) ``` git clone https://github.com/nobuo-miura/ShieldScan cd ShieldScan docker compose up --build ``` 在浏览器中打开 `http://localhost:3000`。 ### 本地开发 ``` # Backend (端口 8080) cd backend go run ./cmd/server # Frontend (单独终端,端口 5173) cd frontend npm install npm run dev ``` 前端 `/api` 请求通过 Vite 的开发代理转发到后端。 ## API ### POST /api/analyze — 安全头扫描 ``` // Request { "url": "https://example.com" } // Response { "url": "https://example.com", "final_url": "https://example.com/", "total_score": 75, "max_score": 100, "grade": "B", "tls_enabled": true, "response_time_ms": 312, "headers": [ { "name": "Strict-Transport-Security", "present": true, "value": "max-age=31536000; includeSubDomains", "score": 15, "max_score": 20, "status": "warning", "description": "...", "advice": "..." } ] } ``` ### POST /api/cors — CORS 扫描 ``` // Request { "url": "https://example.com" } ``` ### POST /api/jwt — JWT 分析 ``` // Request { "token": "" } ``` ### POST /api/ssl — SSL/TLS 检查 ``` // Request { "host": "example.com", "port": "443" } // port is optional (default: 443) ``` ### POST /api/cookies — Cookie 审计 ``` // Request { "url": "https://example.com" } ``` ### GET /api/history — 扫描历史记录 按降序返回最新的 50 条记录。 ### GET /health — 健康检查 ``` { "status": "ok" } ``` ## 目录结构 ``` shieldscan/ ├── backend/ │ ├── cmd/server/ # Entry point │ └── internal/ │ ├── analyzer/ # Scan logic │ │ ├── analyzer.go # Security header evaluation │ │ ├── cors.go # CORS diagnostics │ │ ├── jwt.go # JWT analysis │ │ ├── ssl.go # SSL/TLS diagnostics │ │ └── cookie.go # Cookie audit │ ├── handlers/ # HTTP handlers │ └── models/ # In-memory history store ├── frontend/ │ └── src/ │ └── components/ # UI components for each scan tab └── docker-compose.yml ``` ## License MIT
标签:Cookies, CORS, Go, HTTP headers, JWT, Ruby工具, SSL/TLS, Web安全扫描, 安全审计工具, 插件系统, 日志审计, 版权保护, 网络测绘, 请求拦截