54

GitHub - chaitin/xray: xray 安全评估工具

 4 years ago
source link: https://github.com/chaitin/xray
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Welcome to xray 👋

68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6368616974696e2f787261792e737667 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f6368616974696e2f787261792e7376673f636f6c6f723d626c7565266c6162656c3d757064617465 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f676f207265706f72742d412b2d627269676874677265656e2e737667 Documentation

一款功能强大的安全评估工具 🏠主页 ⬇️下载 📚English Document

✨ Demo

🚀 快速使用

在使用之前,请务必阅读并同意 License 文件中的条款,否则请勿安装使用本工具。

  1. 使用基础爬虫爬取并对爬虫爬取的链接进行漏洞扫描

    xray webscan --basic-crawler http://example.com --html-output vuln.html
  2. 使用 HTTP 代理进行被动扫描

    xray webscan --listen 127.0.0.1:7777 --html-output proxy.html

    设置浏览器 http 代理为 http://127.0.0.1:7777,就可以自动分析代理流量并扫描。

    如需扫描 https 流量,请阅读下方文档 抓取 https 流量 部分

  3. 只扫描单个 url,不使用爬虫

    xray webscan --url http://example.com/?a=b --html-output single-url.html
  4. 手动指定本次运行的插件

    默认情况下,将会启用所有内置插件,可以使用下列命令指定本次扫描启用的插件。

    xray webscan --plugins cmd_injection,sqldet --url http://example.com
    xray webscan --plugins cmd_injection,sqldet --listen 127.0.0.1:7777
  5. 指定插件输出

    可以指定将本次扫描的漏洞信息输出到某个文件中:

    xray webscan --url http://example.com/?a=b \
    --text-output result.txt --json-output result.json --html-output report.html

    报告样例

  6. 只运行单个内置 POC

    在 xray 中,所有的 poc 隶属于插件 phantasm, 所以使用 poc 时需要开启 phantasm 插件才可生效。--poc 参数指定本次运行的 poc,如不指定,将运行所有的内置 poc。

    xray webscan --plugins phantasm --poc poc-yaml-thinkphp5-controller-rce --url http://example.com/
  7. 运行用户自定义 POC

    用户可以按需书写自己的 YAML 格式的 POC, 并通过指定 --poc 参数运行,比如运行在 /home/test/1.yaml 处的 POC。

    xray webscan --plugins phantasm --poc /home/test/1.yaml --url http://example.com/

    --poc 参数非常灵活,支持 Glob 匹配,支持从目录加载,可以从以下几个例子理解用法:

    加载 /home/test/pocs/ 所有的 POC:

    xray webscan --plugins phantasm --poc "/home/test/pocs/*"

    加载 /home/test/pocs/ 下包含 thinkphp 的 POC

    xray webscan --plugins phantasm --poc "/home/test/pocs/*thinkphp*"

    自定义 POC 请查看文档。

  8. 转发漏洞信息到数据库、邮件、IM 通知等

    用户可以使用 --webhook-output 将漏洞信息进行转发,后端需要返回 status 200 才认为发送成功,否则将打印错误日志。

    xray webscan --url http://example.com/ --webhook-output http://host:port/path

🛠 检测模块

新的检测模块将不断添加

  • XSS漏洞检测 (key: xss)

    利用语义分析的方式检测XSS漏洞

  • SQL 注入检测 (key: sqldet)

    支持报错注入、布尔注入和时间盲注等

  • 命令/代码注入检测 (key: cmd_injection)

    支持 shell 命令注入、PHP 代码执行、模板注入等

  • 目录枚举 (key: dirscan)

    检测备份文件、临时文件、debug 页面、配置文件等10余类敏感路径和文件

  • 路径穿越检测 (key: path_traversal)

    支持常见平台和编码

  • XML 实体注入检测 (key: xxe)

    支持有回显和反连平台检测

  • poc 管理 (key: phantasm)

    默认内置部分常用的 poc,用户可以根据需要自行构建 poc 并运行。文档:https://chaitin.github.io/xray/#/guide/poc

  • 文件上传检测 (key: upload)

    支持常见的后端语言

  • 弱口令检测 (key: brute_force)

    社区版支持检测 HTTP 基础认证和简易表单弱口令,内置常见用户名和密码字典

  • jsonp 检测 (key: jsonp)

    检测包含敏感信息可以被跨域读取的 jsonp 接口

  • ssrf 检测 (key: ssrf)

    ssrf 检测模块,支持常见的绕过技术和反连平台检测

  • 基线检查 (key: baseline)

    检测低 SSL 版本、缺失的或错误添加的 http 头等

  • 任意跳转检测 (key: redirect)

    支持 HTML meta 跳转、30x 跳转等

  • CRLF 注入 (key: crlf_injection)

    检测 HTTP 头注入,支持 query、body 等位置的参数

  • ..

⚡️ 进阶使用

下列高级用法请查看 http://chaitin.github.io/xray/ 使用。

  • 修改配置文件
  • 生成证书
  • 抓取 https 流量
  • 修改 https 发包配置
  • 反连平台的使用
  • ...

贡献 POC

参照: https://chaitin.github.io/xray/#/guide/contribute

📝 讨论区

提交误报漏报需求等等请务必先阅读 https://chaitin.github.io/xray/#/guide/feedback

如有问题可以在 GitHub 提 issue, 也可在下方的讨论组里

  1. GitHub issue: https://github.com/chaitin/xray/issues
  2. QQ 群: 717365081
  3. 微信群: 扫描以下二维码加我的个人微信,会把大家拉到 xray 官方微信群

68747470733a2f2f6368616974696e2e6769746875622e696f2f787261792f6173736574732f7765636861742e6a7067


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK