AaronBread/WebChk-A-Web-app-vulnerability-scanner-using-Machine-learning-and-AI
GitHub: AaronBread/WebChk-A-Web-app-vulnerability-scanner-using-Machine-learning-and-AI
WebChk 是一款利用 BERT、TCN 和 FP-Growth 机器学习集成模型来检测 Web 应用漏洞的 AI 驱动型扫描器,配有 Next.js 可视化仪表板和 Python 扫描流水线。
Stars: 0 | Forks: 0
# WebChk
WebChk 是一款 AI 驱动的 Web 应用漏洞扫描器,它利用一套机器学习模型来检测 Web 应用中的安全问题。该项目包含一个用于运行扫描和查看结果的 Next.js 仪表板,以及用于爬取、检测和基准评估的 Python 脚本。
## 功能
- **集成 ML 检测** — 结合 BERT、TCN 和 FP-Growth 模型进行漏洞分类
- **深度 Web 爬取** — 发现页面、表单、API endpoint 和 JavaScript 路由
- **OWASP Juice Shop 支持** — 针对登录、注册、管理员和 REST API endpoint 优化扫描
- **交互式仪表板** — 实时扫描进度、漏洞报告和 ML 分析视图
- **Docker 日志收集** — 在扫描期间进行可选的基于 SSH 的容器日志监控
- **基准评估** — 用于 OWASP Benchmark 和 SmartScanner 对比测试的自动化脚本
## AI 模型
WebChk 使用的机器学习模型由 **Clyde Allen Yu** 开发。
模型实现和训练代码可在 [WebChk-Models](https://github.com/YshikageOne/WebChk-Models) 仓库中找到,其中包括:
- **BERT** — 基于 transformer 的漏洞检测
- **FP (Payload Fingerprinting)** — 针对已知攻击 payload 的模式匹配
- **TCN (Temporal Convolutional Network)** — 用于 Web 流量和攻击模式的序列建模
## 技术栈
| 层级 | 技术 |
|-------|-------------|
| 前端 | Next.js 14, React, TypeScript, Tailwind CSS, shadcn/ui |
| 后端 | Next.js API 路由, Python 脚本 |
| ML | BERT, TCN, FP-Growth 集成模型 (`scripts/ensembleModelv1.py`) |
| 测试目标 | OWASP Juice Shop, OWASP Benchmark |
## 项目结构
```
├── app/ # Next.js app router (dashboard + API)
│ └── api/
│ ├── scan/ # POST — start a vulnerability scan
│ └── results/ # GET — poll scan results
├── components/ # React UI components
├── scripts/ # Python scanning & ML pipeline
│ ├── ensembleModelv1.py # Ensemble model orchestration
│ ├── juice_shop_crawler.py # OWASP Juice Shop crawler
│ ├── owasp_benchmark_crawler.py
│ ├── vulnerability_detector.py
│ ├── docker_vulnerability_detector.py
│ └── run_scanner.py # CLI scan runner
├── juice_shop_scan_results/ # Sample Juice Shop scan output
├── owasp_benchmark_scan_results/ # OWASP Benchmark evaluation data
├── smartscanner_automation.py # SmartScanner GUI automation for benchmarks
└── smartscanner_calibration.py
```
## 快速开始
### 前置条件
- **Node.js** 18+ 和 npm(或 pnpm/yarn)
- **Python** 3.9+ 和 pip
- **OWASP Juice Shop**(可选)— 在本地运行于 `http://127.0.0.1:9000` 以进行测试
### 安装并运行仪表板
```
git clone https://github.com/AaronBread/WebChk-A-Web-app-vulnerability-scanner-using-Machine-learning-and-AI.git
cd WebChk-A-Web-app-vulnerability-scanner-using-Machine-learning-and-AI
npm install
npm run dev
```
打开 [http://localhost:3000](http://localhost:3000),输入目标 URL(例如 Juice Shop 的 `http://127.0.0.1:9000`),然后点击 **Start Deep Scan**。
### 从 CLI 运行扫描
```
cd scripts
python run_scanner.py --url http://127.0.0.1:9000
```
### Python 依赖
扫描脚本需要额外的 Python 包(PyTorch、transformers 等)。请根据 [WebChk-Models](https://github.com/YshikageOne/WebChk-Models) 仓库中的要求进行安装。
## 基准测试
该仓库包含用于评估扫描器在标准基准上性能的脚本和数据集:
- **`owasp_benchmark_scan_results/`** — 针对 OWASP Benchmark 测试套件的扫描结果
- **`juice_shop_scan_results/`** — 针对 OWASP Juice Shop 的扫描结果
- **`smartscanner_automation.py`** — 用于 SmartScanner 基准对比的 GUI 自动化
- **`owasp_benchmark_zap_dataset.jsonl`** — 用于基准校准的 ZAP 数据集
## 相关仓库
- [WebChk-Models](https://github.com/YshikageOne/WebChk-Models) — ML 模型训练和推理代码
## 许可证
本项目目前是一个正在进行中的研究工具。有关许可证的详细信息,请参阅仓库设置。
标签:AI驱动安全, Apex, CISA项目, Python, Web应用扫描, 凭据扫描, 后端开发, 无后门, 机器学习, 逆向工具