pandey-saket/cms-vuln-scanner
GitHub: pandey-saket/cms-vuln-scanner
一款模块化的 CMS 安全评估工具,专为 WordPress、Joomla 和 Drupal 的授权渗透测试提供侦察、枚举与漏洞扫描能力。
Stars: 3 | Forks: 1
# CMS 侦察与漏洞扫描器
### 由 Saket Pandey 开发 | Red Team 版本 v1.0.0
```
⚠ AUTHORIZED SECURITY TESTING ONLY — Unauthorized use is illegal.
```
## 概述
一款专为红队行动打造的专业级、模块化 CMS 安全评估工具。支持 WordPress、Joomla 和 Drupal,并提供被动/主动/全面扫描模式。
## 架构
```
cms_scanner/
├── main.py # CLI entry point, orchestrator
├── cms_detector.py # CMS fingerprinting (WP, Joomla, Drupal)
├── passive_recon.py # Stealth recon: headers, robots, sitemap, metadata
├── enum_module.py # Active: dir bruteforce, user enum, login detection
├── crawler.py # Deep crawl: links, forms, params, JS analysis
├── vuln_scanner.py # Safe vuln checks: XSS/SQLi/SSRF detection
├── exploit_intel.py # CVE matching for detected versions/plugins
├── report.py # JSON + console reporting
├── utils.py # Shared helpers: requests, UA rotation, rate limiting
├── requirements.txt
└── sample_report.json # Example scan output
```
## 安装
```
git clone https://github.com/saketpandey/cms-scanner
cd cms-scanner
pip install -r requirements.txt
```
## 用法
### 被动(隐蔽)扫描 — 最小痕迹
```
python main.py -u https://target.com --mode passive
```
### 主动扫描 — 枚举 + 暴力破解
```
python main.py -u https://target.com --mode active --threads 10
```
### 全面扫描 — 所有模块
```
python main.py -u https://target.com --mode full --output report.json
```
### 通过代理进行全面扫描(Burp Suite / SOCKS)
```
python main.py -u https://target.com --mode full --proxy http://127.0.0.1:8080
```
### 自定义字典 + 详细输出
```
python main.py -u https://target.com --mode full --wordlist /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt --verbose -o findings.json
```
### 设置延迟(规避速率限制)
```
python main.py -u https://target.com --mode full --delay 1.5 --threads 3
```
## CLI 参数
| 参数 | 描述 | 默认值 |
|---------------|--------------------------------------------------|----------------|
| `-u, --url` | 目标 URL(必填) | — |
| `--mode` | `passive` / `active` / `full` | `full` |
| `-o, --output`| 输出 JSON 报告路径 | 自动生成 |
| `-t, --threads`| 并发线程数 | `5` |
| `--timeout` | 请求超时(秒) | `10` |
| `--delay` | 请求间延迟(秒) | `0.5` |
| `--proxy` | HTTP 代理(如 `http://127.0.0.1:8080`) | 无 |
| `--wordlist` | 用于目录暴力破解的自定义字典 | 内置 |
| `--user-agent`| 自定义 User-Agent 字符串 | 随机 |
| `--no-crawl` | 跳过深度爬取阶段 | False |
| `-v, --verbose`| 详细的调试输出 | False |
## 模块
### 1. CMS 检测 (`cms_detector.py`)
- 检测 WordPress、Joomla、Drupal、Magento、Shopify
- 从 meta 标签、readme、feeds、script 参数中提取版本号
- 枚举 WP 主题/插件、Joomla 扩展
- 检查 XML-RPC 和 REST API 状态
### 2. 被动侦察 (`passive_recon.py`)
- HTTP 响应头分析
- 安全标头审计(HSTS、CSP、X-Frame-Options...)
- Cookie 安全标志检查
- robots.txt / sitemap.xml 解析
- HTML meta 标签和注释提取
- JS 文件发现与 API endpoint 提取
- 技术指纹识别(PHP、nginx、jQuery、React...)
### 3. 主动枚举 (`enum_module.py`)
- 多线程目录和文件暴力破解
- 敏感文件探测(.env、wp-config.php.bak、debug.log...)
- 登录面板检测(WP、Joomla、通用 admin 路径)
- WordPress 用户枚举:作者 ID、REST API
- XML-RPC 检测
### 4. 深度爬虫 (`crawler.py`)
- 递归跟踪内部链接(最多 150 页)
- 表单提取(包括方法、输入框、CSRF 检测)
- GET/POST 参数发现
- 获取 JS 文件并从 JS 源码中提取 API endpoint
- 外部链接映射
### 5. 漏洞扫描器 (`vuln_scanner.py`)
- 易受 XSS 攻击的参数标记 + 反射探测(安全的测试字符串)
- SQL 注入报错探测(单引号、错误模式匹配)
- 易受 SSRF 攻击的 URL 参数检测
- 开放重定向参数识别
- POST 表单的 CSRF 检测
- 文件上传表单标记
- 安全标头缺失分析
- 针对 CMS 的专项检查(XML-RPC、REST API 用户信息暴露)
### 6. 漏洞利用情报 (`exploit_intel.py`)
- 包含 25 多条记录的离线 CVE 数据库(WordPress、Joomla、Drupal)
- 基于 semver 比较的版本匹配
- 针对插件的特定 CVE 匹配
- 按 CVSS 分数排序
- 提供指向 NVD 和厂商安全公告的参考链接
## 输出
### 控制台摘要
```
══════════════════════════════════════════════════════════════════════
SCAN SUMMARY
══════════════════════════════════════════════════════════════════════
Target : https://target.com
Mode : FULL
Duration : 0:06:37
── CMS Info ─────────────────────────────────────────────────
CMS : WordPress v6.2.1 (confidence: 95%)
Themes : twentytwentythree, divi
Plugins : 5 detected — woocommerce, contact-form-7, yoast-seo...
── Risk Summary ─────────────────────────────────────────────
● High : 2 ██████
● Medium : 7 █████████████████████
● Low : 1 ██
```
### JSON 报告
有关完整的输出示例,请参阅 `sample_report.json`。
## 伦理使用
此工具仅限用于您已获得**明确书面授权**的系统。开发者 Saket Pandey 对任何未经授权或恶意的使用不承担任何责任。
- 不发送破坏性 payload
- 不进行自动漏洞利用
- 所有 SQL 探测仅使用只读的单引号测试
- 内置速率限制以避免服务中断
标签:Swiss Knife, Web安全, 字符串匹配, 密码管理, 文档结构分析, 蓝队分析, 逆向工具