mcpField
X
xray-scan

xray-scan

github.com/wgpsecSecurity1.8k43 installsUpdated 4d ago
Repository

About xray-scan

xray-scan is a methodology for assessing web application vulnerabilities with xray, for security testers examining URLs, crawled pages, or proxied traffic. It covers active, crawler, and passive proxy scans, with selectable plugins and POCs.

Key features

  1. 01Actively scan URLs and crawled pages
  2. 02Analyze traffic passively through a proxy
  3. 03Select detection plugins by vulnerability type
  4. 04Use built-in or custom POCs
  5. 05Export HTML or JSON results

Use cases

  1. 01Check a web page for common vulnerabilities
  2. 02Crawl a site and scan discovered pages
  3. 03Analyze proxy traffic during browser testing
  4. 04Verify vulnerabilities with selected POCs

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/wgpsec/aboutsecurity --skill xray-scan

After installing, type/xray-scanin Claude Code to confirm it loaded.

Bundled filesevals/evals.json

Details

From the project README

xray Web 漏洞扫描方法论

xray 是长亭科技出品的综合性 Web 安全评估工具,核心优势:检测精度高(语义分析引擎)+ 误报率低 + 社区 POC 丰富。支持主动扫描、被动代理扫描、爬虫扫描三种模式。

项目地址:https://github.com/chaitin/xray

Phase 1: 单 URL 扫描(最常用)

# 扫描单个 URL(全插件)
xray webscan --url http://target/?id=1 --html-output result.html

# 指定检测插件(节省时间)
xray webscan --url http://target/?id=1 --plugins sqldet,cmd-injection --html-output result.html

# JSON 输出(便于解析)
xray webscan --url http://target/?id=1 --json-output result.json

Phase 2: 爬虫扫描(自动发现页面)

# 基础爬虫 + 漏洞扫描
xray webscan --basic-crawler http://target --html-output crawl-result.html

# 指定爬虫深度和插件
xray webscan --basic-crawler http://target --plugins xss,sqldet,cmd-injection --html-output result.html

Phase 3: 被动代理扫描

适合配合浏览器手动测试,xray 自动分析经过代理的流量:

# 启动代理监听
xray webscan --listen 127.0.0.1:7777 --html-output proxy-result.html

# 然后设置浏览器/工具代理为 127.0.0.1:7777
# 所有经过代理的请求都会被自动扫描

Phase 4: 检测插件速查

插件 Key检测内容说明
xssXSS 漏洞语义分析引擎
sqldetSQL 注入报错/布尔/时间盲注
cmd-injection命令注入/代码执行/SSTI多种 payload
dirscan目录枚举备份文件、配置文件、debug 页面
path-traversal路径穿越多平台多编码
xxeXML 实体注入有回显 + 反连检测
upload文件上传常见后端语言
brute-force弱口令HTTP 基础认证 + 表单
jsonpJSONP 劫持敏感信息跨域读取
ssrfSSRF常见绕过 + 反连检测
baseline基线检查SSL 版本、HTTP 头检测
redirect任意跳转meta/30x 跳转
crlf-injectionCRLF 注入HTTP 头注入
strutsStruts2 漏洞s2-016/032/045/059/061(高级版)
shiroShiro 反序列化密钥检测(高级版)
fastjsonFastjson 漏洞系列检测(高级版)
thinkphpThinkPHP 漏洞系列检测(高级版)
按场景选择插件组合
# 快速扫描(高危优先,1-2 分钟)
xray webscan --url URL --plugins sqldet,cmd-injection,xxe,ssrf

# 全面扫描(所有插件,默认行为)
xray webscan --url URL

# Web 应用测试(聚焦 Web 漏洞)
xray webscan --url URL --plugins xss,sqldet,cmd-injection,upload,path-traversal

# Java 应用(针对性)
xray webscan --url URL --plugins struts,shiro,fastjson,sqldet

Phase 5: POC 扫描

xray 内置 POC 引擎 (phantasm),支持社区贡献的 POC:

# 使用内置 POC 扫描
xray webscan --plugins phantasm --url http://target

# 指定自定义 POC 目录
xray webscan --plugins phantasm --poc /path/to/pocs/ --url http://target

社区 POC 仓库:https://github.com/chaitin/xray-plugins

配置优化

# 生成默认配置文件
xray genca    # 生成 CA 证书(HTTPS 代理需要)

# 配置文件位置:~/.xray/config.yaml
# 常用配置项:
# - http.proxy: 设置上游代理
# - http.headers: 自定义请求头
# - plugins.xxx.enabled: 启用/禁用插件

与 nuclei 对比决策

场景推荐工具原因
已知 CVE 验证nuclei模板库更全 (9000+)
通用 Web 漏洞扫描xray语义分析,误报率更低
被动代理扫描xray原生支持代理模式
批量目标 PoC 检测nuclei批量性能更好
SQL 注入深度检测xraysqldet 引擎更精准

Comments

Markdown supported