RamadhanAlfatih/vxray
GitHub: RamadhanAlfatih/vxray
一款基于命令行的现代 Web 漏洞扫描器,通过多模块与丰富载荷实现高效、低误报的自动化安全检测。
Stars: 0 | Forks: 0
VXRay
现代 Web 漏洞扫描器
一款基于命令行的综合性 Web 渗透测试工具,具备 17 个检测模块、323+ 有效载荷、异步爬虫、深度端点发现、子域名枚举以及误报过滤功能。
灵感来源于 xray 和 Nuclei。
```
██╗ ██╗██╗ ██╗██████╗ █████╗ ██╗ ██╗
██║ ██║╚██╗██╔╝██╔══██╗██╔══██╗╚██╗ ██╔╝
██║ ██║ ╚███╔╝ ██████╔╝███████║ ╚████╔╝
╚██╗ ██╔╝ ██╔██╗ ██╔══██╗██╔══██║ ╚██╔╝
╚████╔╝ ██╔╝ ██╗██║ ██║██║ ██║ ██║
╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
```
## ✨ 功能特性
- **17 个检测模块** — SQL 注入、XSS、命令注入、模板注入、XML 外部实体、路径遍历/文件包含、SSRF、CRLF 注入、CORS 配置错误、JWT 配置错误、开放重定向、安全头信息、目录暴力破解、信息泄露、文件上传、技术指纹识别、默认凭证测试
- **323+ 有效载荷** — 包含 WAF 绕过技巧、编码变形、多引擎支持
- **深度端点发现** — 爬取 HTML、解析 JS 文件、从 robots.txt/sitemap.xml 提取、HTML 注释、`data-*` 属性
- **认证扫描** — 可传入 Cookie 与自定义标头以爬取并测试需要登录的页面
- **活跃子域名探测** — 通过 crt.sh 发现子域名并逐一探测,展示带颜色标识的状态表
- **默认凭证测试** — 针对 8 种常见产品(WordPress、Tomcat、Jenkins、phpMyAdmin、Grafana 等)测试 43 组凭证
- **误报过滤** — 金丝雀测试、基线对比、自然变异检测、双重验证
- **3 种扫描模式** — `passive`(安全、无注入)、`normal`(平衡)、`aggressive`(全载荷、更快)
- **xray 风格流程日志** — 实时载荷执行、错误报告、周期性统计
- **专业报告** — HTML(深色仪表盘)、JSON、Markdown
- **异步引擎** — 使用 `aiohttp` 并发扫描,支持配置线程数与延迟
## 🚀 快速开始
```
# 克隆仓库
git clone https://github.com/YOUR_USERNAME/vxray.git
cd vxray
# 安装依赖
pip install -r requirements.txt
# 运行首次扫描
python vxray.py -u https://target.com
```
## 📦 安装
**依赖要求:** Python 3.10+ 和 `aiohttp`
```
pip install -r requirements.txt
```
仅此一个依赖,无需复杂配置。
## 📖 使用说明
### 基础扫描(全部 17 模块)
```
python vxray.py -u https://target.com
```
### 启用子域名发现扫描
```
python vxray.py -u https://target.com --subdomain
```
### 仅启用指定模块
```
python vxray.py -u https://target.com --modules sqli,xss,rce,ssti,lfi
```
### 认证扫描(以已登录用户身份)
```
python vxray.py -u https://target.com \
--cookies "session=abc123; csrf_token=xyz789" \
--headers '{"Authorization": "Bearer eyJhbGciOi..."}'
```
### 激进模式(全力扫描)
```
python vxray.py -u https://target.com --aggressive
```
### 被动模式(安全、无注入)
```
python vxray.py -u https://target.com --passive
```
### 使用代理的隐身模式
```
python vxray.py -u https://target.com --stealth --proxy http://127.0.0.1:8080 --delay 2.0
```
### 生成报告
```
python vxray.py -u https://target.com -o report.html
python vxray.py -u https://target.com --json-output results.json --html-output report.html
```
## 🖥️ 过程输出
VXRay 在扫描期间会展示实时的 xray 风格流程信息:
```
[INFO] 2026-04-13 16:01:20 script vxray-sqli run payload error-single_quote -> https://target.com/page?id=1
[INFO] 2026-04-13 16:01:20 script vxray-sqli run payload error-or_true_sq -> https://target.com/page?id=1
[ERRO] 2026-04-13 16:01:21 script vxray-rce run payload linux_newline_expr err: timeout
[INFO] 2026-04-13 16:01:22 script vxray-lfi run payload linux_double_dot_bypass -> https://target.com/dl?f=x
[*] scanned: 12, pending: 34, requestSent: 847, latency: 124.50ms, failedRatio: 2.15%, findings: 3
[VULN] 2026-04-13 16:01:23 CRITICAL SQL Injection (Error-Based) - MySQL
URL: https://target.com/page?id=1
Param: id
Evidence: You have an error in your SQL syntax; check the manual...
[VULN] 2026-04-13 16:01:24 script vxray-rce payload linux_pipe_expr HIT https://target.com/api/ping?h=1
[*] scanned: 18, pending: 28, requestSent: 1203, latency: 118.92ms, failedRatio: 1.87%, findings: 5
```
### 子域名探测表
```
Subdomain Status Title
───────────────────────────────────────────── ──────── ──────────────────────────────
◉ api.target.com 200 API Gateway v2
◎ staging.target.com 302 Redirect to login
◎ admin.target.com 403 Forbidden
○ old.target.com 503 Service Unavailable
[INFO] Live subdomains: 3 / 47
```
### 扫描摘要
```
═════════════════════════════════════════════════════════════════
SCAN COMPLETE
═════════════════════════════════════════════════════════════════
Target: https://target.com
Duration: 14.3s
URLs Crawled: 47
Requests Sent: 1203
Avg Latency: 118.92ms
Failed Ratio: 1.87%
Technologies: Nginx 1.24, PHP 8.2, Laravel, React
┌─────────────────────────────┐
│ Findings: 13 │
├─────────────────────────────┤
│ ● Critical: 4 │
│ ● High: 4 │
│ ● Medium: 3 │
│ ● Info: 2 │
└─────────────────────────────┘
⚠ CRITICAL RISK — Immediate action required
```
## 🔍 检测模块
### 17 模块 — 323+ 有效载荷
| # | 模块 | Key | 有效载荷 | OWASP 2025 |
|---|--------|-----|----------|------------|
| 1 | SQL 注入 | `sqli` | 46(报错/布尔/时间盲,7 种数据库引擎) | A05: Injection |
| 2 | 跨站脚本 | `xss` | 26 反射型 + 30 DOM 模式 | A05: Injection |
| 3 | 命令注入 | `rce` | 43(Linux/Windows/代码绕过) | A05: Injection |
| 4 | 模板注入 | `ssti` | 14(Jinja2、Twig、FreeMarker、Pebble、ERB、Velocity) | A05: Injection |
| 5 | XML 外部实体 | `xxe` | 8(文件读取、PHP 过滤器、内容类型切换) | A05: Injection |
| 6 | 路径遍历 / 文件包含 | `lfi` | 34(编码、空字节、PHP 封装器、Java) | A01: Broken Access Control |
| 7 | SSRF | `ssrf` | 10(本地主机、AWS/GCP 元数据、IP 绕过) | A01: Broken Access Control |
| 8 | 开放重定向 | `redirect` | 12 种绕过技巧 | A01: Broken Access Control |
| 9 | CRLF 注入 | `crlf` | 5(标头注入、响应拆分、Unicode) | A05: Injection |
| 10 | CORS 配置错误 | `cors` | 5(来源反射、空值、前缀绕过) | A02: Misconfiguration |
| 11 | JWT 配置错误 | `jwt` | 4 项检查(alg:none、弱算法、敏感数据、无 exp) | A07: Auth Failures |
| 12 | 安全头信息 | `headers` | 15+ 项检查(HSTS、CSP、Cookie、CORS、Referrer) | A02: Misconfiguration |
| 13 | 目录暴力破解 | `dirbrute` | 60 个敏感路径(.env、.git、admin、actuator) | A02: Misconfiguration |
| 14 | 信息泄露 | `info` | 15 种模式(AWS 密钥、Token、IP、堆栈跟踪) | A02: Misconfiguration |
| 15 | 文件上传 | `upload` | 4(双扩展名、空字节、SVG XSS、PHTML) | A01: Broken Access Control |
| 16 | 技术指纹识别 | `techdetect` | 40+ 签名(服务器、框架、CMS、WAF) | A02: Misconfiguration |
| 17 | 默认凭证测试 | `defaultcreds` | 43 组凭证,覆盖 8 种产品 | A07: Auth Failures |
### 默认凭证目标
| 产品 | 检测点 | 测试凭证 |
|---------|-----------|-------------------|
| WordPress | `/wp-login.php` | admin/admin、admin/password、admin/123456 等 |
| Apache Tomcat | `/manager/html`(401) | tomcat/tomcat、tomcat/s3cret、admin/admin 等 |
| Jenkins | `/login` | admin/admin、admin/jenkins、admin/password 等 |
| phpMyAdmin | `/phpmyadmin/` | root/(空)、root/root、root/password 等 |
| Grafana | `/login` | admin/admin、admin/grafana、admin/password |
| Spring Actuator | `/actuator` | admin/admin、user/password、actuator/actuator |
| Adminer | `/adminer.php` | root/(空)、root/root、admin/admin |
| 通用基本认证 | `/admin/`(401) | admin/admin、root/root、test/test 等 |
## ⚡ 扫描模式
| 功能 | `--passive` | 正常(默认) | `--aggressive` |
|---------|-------------|-----------------|----------------|
| 标头分析 | ✅ | ✅ | ✅ |
| 技术检测 | ✅ | ✅ | ✅ |
| 目录暴力破解 | ✅ | ✅ | ✅ |
| 信息泄露 | ✅ | ✅ | ✅ |
| CORS / JWT | ✅ | ✅ | ✅ |
| 默认凭证 | ✅ | ✅ | ✅ |
| SQL 注入(报错/布尔) | ❌ | ✅ | ✅ |
| SQL 注入(时间盲) | ❌ | ✅ | ✅ |
| XSS / RCE / 文件包含 | ❌ | ✅ | ✅ |
| 模板注入 / XML 外部实体 /F | ❌ | ✅ | ✅ |
| 请求延迟 | 正常 | 正常 | 0.3 倍(更快) |
| 线程数 | 正常 | 正常 | 2 倍(最高 30) |
## 🛡️ 误报过滤
VXRay 采用多种技术降低误报:
1. **金丝雀验证** — 检测到潜在漏洞后,发送干净请求确认该标记是否自然出现
2. **自然变异检测** — 对布尔型注入,检查响应在自然情况下的方差,避免将差异误判为注入
3. **双重配对验证** — 布尔型 SQL 注入使用两组独立真/假条件进行验证
4. **上下文感知检测** — XSS 检查反射上下文(HTML 体、属性、JS、注释),再测试对应载荷
5. **自定义 404 基线** — DirBrute 模块先请求已知不存在的路径并与目标比较
6. **内容模式匹配** — 敏感文件检测验证实际文件内容,而不仅是 HTTP 200 状态
## 🗂️ 项目结构
```
vxray/
├── vxray.py # CLI entry point
├── requirements.txt # Dependencies (aiohttp)
├── LICENSE # MIT License
├── DISCLAIMER.md # Legal disclaimer
├── CONTRIBUTING.md # Contribution guide
│
├── core/
│ ├── engine.py # Scan orchestrator + stats + live subdomain probe
│ ├── config.py # Data models (ScanConfig, Finding, ScanResults)
│ ├── crawler.py # Deep endpoint discovery crawler
│ └── subdomain.py # Subdomain discovery (crt.sh + common prefixes)
│
├── modules/
│ ├── base.py # Base module + FP verification helpers
│ ├── sqli.py # SQL Injection (46 payloads, 7 DB engines)
│ ├── xss.py # XSS (26 payloads + DOM analysis)
│ ├── rce.py # RCE (43 payloads, Linux/Windows/code)
│ ├── lfi.py # LFI (34 payloads, encoding bypasses)
│ ├── ssrf.py # SSRF (cloud metadata, IP bypass)
│ ├── ssti.py # SSTI (8 template engines)
│ ├── xxe.py # XXE (file read, PHP wrappers)
│ ├── redirect.py # Open Redirect (12 bypass techniques)
│ ├── crlf.py # CRLF Injection
│ ├── cors.py # CORS Misconfiguration
│ ├── jwt.py # JWT Analysis
│ ├── security_headers.py # Security Headers + Cookie flags
│ ├── dir_brute.py # Directory Brute-force (60 paths)
│ ├── info_disclosure.py # Secret/Key/IP detection
│ ├── upload.py # File Upload testing
│ ├── tech_detect.py # Tech fingerprinting (40+ techs)
│ └── default_creds.py # Default credentials (8 products)
│
├── utils/
│ ├── http_client.py # Async HTTP client + stats tracking
│ ├── logger.py # xray-style logging + ScanStats
│ └── banner.py # CLI banner and summary
│
└── reports/
└── generator.py # HTML / JSON / Markdown reports
```
## 📋 CLI 参考
```
Target:
-u, --url URL Target URL (required)
--subdomain Enable subdomain discovery + live probing
Scan Options:
--modules MODULES Comma-separated modules (default: all)
--depth N Crawl depth (default: 3)
--max-urls N Max URLs to crawl (default: 200)
--timeout N Request timeout seconds (default: 15)
--delay N Delay between requests seconds (default: 0.1)
--threads N Concurrent threads (default: 10)
--js-crawl Enable JS rendering (requires playwright)
--stealth Random User-Agent, increased delays
--aggressive All payloads, 2x threads, faster
--passive Safe mode: no injection, headers/info/creds only
Output:
-o, --output FILE Output file (.html / .json / .md)
--json-output FILE JSON report path
--html-output FILE HTML report path
-v, --verbose Verbose debug output
-q, --quiet Only show findings
Advanced:
--headers JSON Custom headers: '{"Authorization": "Bearer xxx"}'
--cookies STRING Cookies: 'session=abc; token=xyz'
--proxy URL HTTP proxy: http://127.0.0.1:8080
--user-agent STRING Custom User-Agent
--scope MODE strict | subdomain | loose
--no-verify-ssl Skip SSL verification
```
## 🌐 OWASP Top 10 2025 覆盖范围
| OWASP 2025 类别 | VXRay 模块 |
|-----------------|------------|
| A01: Broken Access Control | `lfi`, `ssrf`, `redirect`, `upload`, `dirbrute` |
| A02: Security Misconfiguration | `headers`, `cors`, `dirbrute`, `info`, `techdetect` |
| A03: Software Supply Chain | 包文件检测(`.env`、`package.json`、`composer.json`) |
| A04: Cryptographic Failures | `jwt` 分析、SSL 检查、弱 Cookie 标记 |
| A05: Injection | `sqli`, `xss`, `rce`, `ssti`, `xxe`, `crlf` |
| A06: Insecure Design | 安全头信息分析、调试端点检测 |
| A07: Authentication Failures | `jwt` 配置错误、`defaultcreds`、会话分析 |
| A08: Integrity Failures | 依赖项/配置文件暴露检测 |
| A09: Logging Failures | 调试端点检测(actuator、trace、elmah) |
| A10: Exceptional Conditions | 错误消息/堆栈跟踪泄露 |
## ⚠️ 法律声明
**本工具仅供授权安全测试使用。**
在扫描任何目标之前,请务必获得明确的书面授权。未经授权的扫描可能违反计算机犯罪法。详见 [DISCLAIMER.md](DISCLAIMER.md)。
开发者不对任何滥用行为负责,请负责任地使用。
## 🤝 贡献
欢迎贡献!请参考 [CONTRIBUTING.md](CONTRIBUTING.md) 获取指南。
贡献方式包括:
- 添加新的检测模块或有效载荷
- 改进误报检测
- 添加对新的默认凭证目标的支持
- 报告错误或提出功能建议
## 📚 致谢
- 灵感来源于 [xray](https://github.com/chaitin/xray)(Chaitin Tech)
- 灵感来源于 [Nuclei](https://github.com/projectdiscovery/nuclei)(ProjectDiscovery)
- OWASP Top 10 2025 标准
- 有效载荷研究参考自 [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings)、[HackTricks](https://book.hacktricks.xyz/) 和 [PortSwigger Research](https://portswigger.net/research)
由安全研究人员为安全研究人员构建。
如果此工具对您有帮助,请考虑给它一个 ⭐
标签:CORS, CRLF注入, JWT, LFI, Open Redirect, Python, RCE, SEO, SSRF, SSTI, URL发现, WAF绕过, Web漏洞扫描, XSS, XXE, 信息泄露, 加密, 子域名枚举, 安全头部, 安全检测, 开源安全工具, 异步爬虫, 文件上传, 文件包含, 无后门, 服务端请求伪造, 漏洞情报, 漏洞扫描器, 目录暴力破解, 系统安全, 编码绕过, 误报减少, 逆向工具, 逆向工程平台, 防御框架, 默认凭证