介绍
一个免费的安全社区工具平台
xray 社区是长亭科技推出的免费白帽子工具平台,目前社区有xray、xpoc、rad 工具,均有多名经验丰富的安全开发人员和数万名社区贡献者共同打造而成
Xray是一款半开源的功能强大的安全评估工具,前身是由多名经验丰富的一线安全从业者呕心打造而成,现被长亭收购,分为社区版、社区高级版和企业版。
xray能做什么
// 基础爬虫爬取并对爬虫爬取的链接进行漏洞扫描
xray webscan --basic-crawler http://example.com --html-output vuln.html
// 用 HTTP 代理进行被动扫描
xray webscan --listen 127.0.0.1:7777 --html-output proxy.html
// 只扫描单个 url,不使用爬虫
xray webscan --url http://example.com/?a=b --html-output single-url.html
// 手动指定本次运行的插件
// 默认情况下,将会启用所有内置插件,可以使用下列命令指定本次扫描启用的插件
xray webscan --plugins cmd-injection,sqldet --url http://example.com
xray webscan --plugins cmd-injection,sqldet --listen 127.0.0.1:7777
// 指定插件输出
xray webscan --url http://example.com/?a=b \
--text-output result.txt --json-output result.json --html-output report.html
新的检测模块将不断添加
| 名称 | Key | 版本 | 说明 |
|---|---|---|---|
| XSS漏洞检测 | xss |
社区版 | 利用语义分析的方式检测XSS漏洞 |
| SQL 注入检测 | sqldet |
社区版 | 支持报错注入、布尔注入和时间盲注等 |
| 命令/代码注入检测 | cmd-injection |
社区版 | 支持 shell 命令注入、PHP 代码执行、模板注入等 |
| 目录枚举 | dirscan |
社区版 | 检测备份文件、临时文件、debug 页面、配置文件等10余类敏感路径和文件 |
| 路径穿越检测 | path-traversal |
社区版 | 支持常见平台和编码 |
| XML 实体注入检测 | xxe |
社区版 | 支持有回显和反连平台检测 |
| poc 管理 | phantasm |
社区版 | 默认内置部分常用的 poc,用户可以根据需要自行构建 poc 并运行。文档:POC |
| 文件上传检测 | upload |
社区版 | 支持常见的后端语言 |
| 弱口令检测 | brute-force |
社区版 | 社区版支持检测 HTTP 基础认证和简易表单弱口令,内置常见用户名和密码字典 |
| jsonp 检测 | jsonp |
社区版 | 检测包含敏感信息可以被跨域读取的 jsonp 接口 |
| ssrf 检测 | ssrf |
社区版 | ssrf 检测模块,支持常见的绕过技术和反连平台检测 |
| 基线检查 | baseline |
社区版 | 检测低 SSL 版本、缺失的或错误添加的 http 头等 |
| 任意跳转检测 | redirect |
社区版 | 支持 HTML meta 跳转、30x 跳转等 |
| CRLF 注入 | crlf-injection |
社区版 | 检测 HTTP 头注入,支持 query、body 等位置的参数 |
| XStream漏洞检测 | xstream |
社区版 | 检测XStream系列漏洞 |
| Struts2 系列漏洞检测 | struts |
高级版 | 检测目标网站是否存在Struts2系列漏洞,包括s2-016、s2-032、s2-045、s2-059、s2-061等常见漏洞 |
| Thinkphp系列漏洞检测 | thinkphp |
高级版 | 检测ThinkPHP开发的网站的相关漏洞 |
| shiro反序列化漏洞检测 | shiro |
高级版 | 检测Shiro反序列化漏洞 |
| fastjson系列检测 | fastjson |
高级版 | 检测fastjson系列漏洞 |
高级用法
请查看 https://docs.xray.cool/ 使用。
- 修改配置文件
- 抓取 https 流量
- 修改 http 发包配置
- 反连平台的使用
- ...
xray安装
// 下载地址
https://download.xray.cool/xray/1.9.5
# ls
xray_linux_amd64.zip
# unzip xray_linux_amd64.zip
# ls
xray_linux_amd64 xray_linux_amd64.zip
# ./xray_linux_amd64 version
____ ___.________. ____. _____.___.
\ \/ /\_ __ \ / _ \ \__ | |
\ / | _ _/ / /_\ \ / | |
/ \ | | \/ | \ \____ |
\___/\ \ |____| /\____|_ / / _____/
\_/ \_/ \_/ \/
Version: 1.9.5/1e79235f/COMMUNITY
config (xray.yaml) not found, gen xray.yaml/module.xray.yaml/plugin.xray.yaml .
使用示例
// 示例扫描
# ./xray_linux_amd64 webscan --url 10.1.6.105:9000 --json-output result.json --html-output report.html
# ll
total 99556
-rw-r--r-- 1 root root 14607 Apr 24 13:44 config.yaml
-rw-r--r-- 1 root root 3291 Apr 24 11:21 module.xray.yaml
-rw-r--r-- 1 root root 3867 Apr 24 11:21 plugin.xray.yaml
-rw-r----- 1 root root 1830293 Apr 24 13:58 report.html //html report
-rw-r----- 1 root root 17650 Apr 24 13:58 result.json //json report
-rwxr-xr-x 1 root root 69609240 Apr 11 2023 xray_linux_amd64
-rw-r--r-- 1 root root 30451186 Apr 24 11:01 xray_linux_amd64.zip
-rw-r--r-- 1 root root 382 Apr 24 11:21 xray.yaml


异常排错
// 异常原因
# ./xray_linux_amd64 version
./xray_linux_amd64: error while loading shared libraries: libpcap.so.0.8: cannot open shared object file: No such file or directory
// 解决方式
# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
# yum install libpcap-devel
# locate libpcap
# updatedb
# ls -al /usr/lib64/libpcap.so.*
# cd /usr/lib64
# ln -s libpcap.so.1.5.3 libpcap.so.0.8
参考链接
// 官方网站
https://xray.cool/
// github介绍
https://github.com/chaitin/xray
// 使用文档
https://docs.xray.cool/Introduction
https://docs.xray.cool/tools/xray/QuickStart
// 版本下载
https://download.xray.cool/xray
// 版本对比
https://xray.cool/compare/