codebytaki/webvulnscan
GitHub: codebytaki/webvulnscan
一款开源免费的网站综合扫描器,通过 150 余项自动化检查覆盖安全漏洞、SEO、性能、隐私合规与无障碍访问,无需注册即可使用。
Stars: 0 | Forks: 0
# 🔐 WebVulnScan
### 150+ 项自动化安全、SEO 与性能检测
[](https://git.io/typing-svg)
    
## 🖼️ 预览
    
**针对典型站点的扫描输出示例:**
```
┌─────────────────────────────────────────────────────────┐
│ 🔐 WebVulnScan — https://example.com │
│ Score: 74 / 100 ● 38 checks ● 312ms │
├──────────┬──────────┬──────────┬──────────┐ │
│ Critical │ High │ Medium │ Low │ │
│ 0 │ 5 │ 7 │ 4 │ │
└──────────┴──────────┴──────────┴──────────┘ │
│ │
│ ✗ HIGH Missing Content-Security-Policy │
│ ✗ HIGH Missing HSTS Header │
│ ✗ HIGH Missing X-Frame-Options │
│ ✗ MEDIUM Missing X-Content-Type-Options │
│ ✗ MEDIUM robots.txt Missing │
│ ✗ MEDIUM No Rate Limiting Detected │
│ ✓ LOW SSL Certificate Valid (365 days) │
│ ✓ LOW TLS 1.3 Active │
│ ✓ LOW Compression Enabled (br) │
│ ✓ LOW CORS: Restrictive (Good) │
└─────────────────────────────────────────────────────────┘
```








## ⚡ 扫描内容
| 类别 | 检查项 | 旨在发现的问题 |
|:---:|:---:|:---|
| 🔒 **SSL / TLS** | 6 | 证书过期、弱加密算法、TLS 版本 |
| 🛡️ **安全响应头** | 11 | CSP、HSTS、X-Frame、CORS、Referrer-Policy |
| 💉 **注入** | 15 | XSS、SQLi、NoSQL、SSTI、XXE、LDAP、命令注入 |
| 🍪 **Cookies** | 7 | Secure、HttpOnly、SameSite、过期时间 |
| 📁 **暴露的文件** | 25 | `.env`、`.git`、备份文件、SSH 密钥、phpinfo |
| 🔑 **身份验证** | 10 | 管理后台、JWT 漏洞、默认凭据 |
| 🌐 **DNS 与邮件** | 10 | SPF、DKIM、DMARC、CAA 记录 |
| 🚀 **性能** | 10 | 响应时间、压缩、缓存、CDN |
| 🔍 **SEO** | 13 | 标题、meta、canonical、OG 标签、Sitemap |
| 🔐 **隐私 / GDPR** | 8 | Cookie 同意提示、追踪器、隐私政策 |
| ♿ **无障碍访问** | 10 | WCAG 2.1、ARIA、Tab 键顺序、跳转链接 |
| 🔗 **供应链** | 5 | SRI 哈希、过时的库、GTM |
| 📊 **API 安全** | 5 | GraphQL、未授权 endpoint、Swagger |
| 🏗️ **基础设施** | 5 | HTTP 重定向、开发子域名、DNSSEC |
| ⏱️ **速率限制** | 4 | 突发流量检测、payload 大小 |
## 🚀 快速开始
```
# Clone
git clone https://github.com/codebytaki/webvulnscan.git
cd webvulnscan
# Install
npm install
# Run
npm start
```
打开 **http://localhost:3000** — 粘贴任意 URL 并点击扫描即可。
## 🖥️ API 用法
通过 REST endpoint 进行编程式扫描:
```
curl -X POST http://localhost:3000/api/scan \
-H "Content-Type: application/json" \
-d '{"url": "https://yoursite.com"}'
```
**响应结构:**
```
{
"score": 74,
"totalChecks": 38,
"passedChecks": 22,
"failedChecks": 16,
"severityCounts": { "critical": 0, "high": 5, "medium": 7, "low": 4 },
"issues": [
{
"passed": false,
"severity": "high",
"cat": "Headers",
"title": "Missing Content-Security-Policy",
"description": "No CSP header...",
"fix": "res.setHeader('Content-Security-Policy', ...)"
}
],
"responseTime": 312,
"pageSize": 14820
}
```
## 💾 可选:使用 Supabase 保存历史记录
无需账号,扫描器即可完全正常使用。如需启用登录和扫描历史记录功能:
1. 在 [supabase.com](https://supabase.com) 创建一个免费项目
2. 在你的 Supabase SQL 编辑器中运行 `supabase-schema.sql`
3. 编辑 `public/supabase-client.js`:
```
const SUPABASE_URL = 'https://your-project.supabase.co';
const SUPABASE_ANON = 'your-anon-public-key'; // public key only — never service role
```
系统已强制启用行级安全 (Row Level Security) — 用户只能查看自己的扫描记录。
## 📁 项目结构
```
webvulnscan/
├── server.js ← All 150+ scan checks (Node.js / Express)
├── supabase-schema.sql ← DB schema + RLS (optional)
├── photos/ ← Screenshots for this README
├── public/
│ ├── index.html ← Landing page + inline scanner modal
│ ├── scan.html ← Full-page results view
│ ├── dashboard.html ← Scan history (requires Supabase)
│ ├── login.html ← Auth page
│ ├── app.js ← Frontend logic + result rendering
│ ├── dashboard.js ← Dashboard data loader
│ ├── supabase-client.js ← Configure your Supabase keys here
│ └── shared.css ← Global dark theme styles
└── package.json
```
## 📐 评分机制
每项检查都会返回带有严重程度权重的 `passed: true/false` 结果:
| 严重程度 | 权重 | 示例 |
|:---:|:---:|:---|
| 🔴 严重 | 15 | 确认存在 SQL 注入 |
| 🟠 高危 | 8 | 缺失 CSP 响应头 |
| 🟡 中危 | 3 | 缺失 canonical 标签 |
| 🔵 低危 | 1 | 缺失 Twitter Card |
`score = 100 − (total_penalty / max_possible_penalty × 100)`
完美的站点得分为 **100**。现实中的站点得分通常在 40–75 之间。
## 🤝 添加新检查项
```
// 1. Write your check function
async function checkMyThing(urlStr, body, headers) {
const r = [];
// ... your logic
r.push({
passed: false,
severity: 'high', // critical | high | medium | low
cat: 'Security',
title: 'Short check name',
description: 'What it means and why it matters.',
fix: '// Optional code snippet'
});
return r;
}
// 2. Add to the Promise.all in /api/scan
// 3. Spread into allChecks
```
欢迎提交 PR。
## 🚢 部署
```
# 任意 Node.js host (Railway, Render, Fly.io, VPS)
PORT=8080 npm start
# Docker one-liner
docker run -p 3000:3000 -v $(pwd):/app -w /app node:18-alpine npm start
```
## 👤 作者
由 **[MD Taki](https://github.com/codebytaki)** 打造 — 安全研究员 · AI 开发者 · 漏洞猎人
[](https://github.com/codebytaki)
[](https://github.com/codebytaki/bug-hunter-toolkit)
## 📄 许可证
MIT — 可免费使用、修改、分叉和部署。
*由 [MD Taki](https://github.com/codebytaki) 打造 — 安全研究员 · AI 开发者 · 漏洞猎人*
标签:CISA项目, GNU通用公共许可证, MITM代理, Node.js, SEO分析, Web安全, 性能检测, 网站扫描, 网络测绘, 自定义脚本, 蓝队分析, 请求拦截