Convert Figma logo to code with AI

chaitin logoxray

一款完善的安全评估工具,支持常见 web 安全问题扫描和自定义 poc | 使用之前务必先阅读文档

10,329
1,824
10,329
51

Top Related Projects

20,301

Fast and customizable vulnerability scanner based on simple YAML based DSL.

32,268

Automatic SQL injection and database takeover tool

8,470

Nikto web server scanner

8,559

WPScan WordPress security scanner. Written for security professionals and blog maintainers to test the security of their WordPress websites. Contact us via contact@wpscan.com

12,618

The ZAP by Checkmarx Core project

13,141

Most advanced XSS scanner.

Quick Overview

Xray is an advanced security assessment tool designed for web applications and networks. It offers comprehensive vulnerability scanning, penetration testing, and security analysis capabilities, making it a versatile solution for identifying and addressing potential security risks in various digital environments.

Pros

  • Comprehensive scanning capabilities covering a wide range of vulnerabilities
  • Active community support and regular updates
  • User-friendly interface and easy-to-understand reports
  • Supports both web application and network security assessments

Cons

  • Limited documentation in English, as the primary language is Chinese
  • May require significant system resources for large-scale scans
  • Some advanced features may have a learning curve for new users

Getting Started

To get started with Xray:

  1. Download the latest release from the GitHub repository.
  2. Extract the files to a directory of your choice.
  3. Open a terminal and navigate to the Xray directory.
  4. Run the following command to start a basic web scan:
./xray webscan --basic-crawler http://example.com --html-output vuln.html
  1. For more advanced usage, refer to the documentation (primarily in Chinese) or community resources.

Note: Always ensure you have proper authorization before scanning any target systems or networks.

Competitor Comparisons

20,301

Fast and customizable vulnerability scanner based on simple YAML based DSL.

Pros of Nuclei

  • More extensive and actively maintained template library
  • Supports a wider range of protocols and technologies
  • Better community support and contribution ecosystem

Cons of Nuclei

  • Steeper learning curve for creating custom templates
  • May require more system resources for large-scale scans

Code Comparison

Xray configuration example:

plugins:
  - name: sqldet
    enabled: true
  - name: xss
    enabled: true

Nuclei template example:

id: cve-2021-44228-log4j-rce
info:
  name: Apache Log4j RCE
  severity: critical
http:
  - raw:
      - |
        GET /${jndi:ldap://{{Hostname}}/a} HTTP/1.1
        Host: {{Hostname}}

Key Differences

  • Xray uses a plugin-based approach, while Nuclei relies on YAML templates
  • Nuclei offers more granular control over individual vulnerability checks
  • Xray provides a more user-friendly interface for basic scans

Use Cases

  • Xray: Suitable for quick, automated scans with minimal configuration
  • Nuclei: Ideal for in-depth, customizable security assessments and research

Both tools are valuable for vulnerability scanning, but Nuclei offers more flexibility and extensibility for advanced users, while Xray provides a simpler experience for basic security checks.

32,268

Automatic SQL injection and database takeover tool

Pros of sqlmap

  • Specialized in SQL injection detection and exploitation
  • Extensive database support and advanced features for database enumeration
  • Large, active community and frequent updates

Cons of sqlmap

  • Limited to SQL injection vulnerabilities only
  • Steeper learning curve for advanced features
  • Can be slower for large-scale scans compared to more general-purpose tools

Code Comparison

sqlmap (Python):

def getFileContent(filepath):
    content = None
    try:
        with open(filepath, "rb") as f:
            content = f.read()
    except IOError:
        pass
    return content

xray (Go):

func ReadFileContent(filename string) ([]byte, error) {
    return ioutil.ReadFile(filename)
}

Key Differences

  • sqlmap focuses solely on SQL injection, while xray is a more comprehensive security assessment tool
  • xray offers a wider range of vulnerability detection capabilities, including XSS, SSRF, and more
  • sqlmap provides deeper SQL injection analysis and exploitation features
  • xray is written in Go, which may offer performance benefits for certain tasks
  • sqlmap has a larger user base and more extensive documentation

Both tools are valuable for security professionals, with sqlmap excelling in SQL injection scenarios and xray offering a broader vulnerability assessment approach.

8,470

Nikto web server scanner

Pros of Nikto

  • Longer history and wider adoption in the security community
  • Extensive plugin system for customization and extensibility
  • Lightweight and can run on systems with limited resources

Cons of Nikto

  • Slower scanning speed compared to Xray
  • Less frequent updates and maintenance
  • Limited reporting options and user interface

Code Comparison

Nikto (Perl):

sub nikto_headers {
    my ($mark) = @_;
    my %headers;
    foreach my $header (split(/\n/, $mark->{'headers'})) {
        my ($key, $value) = split(/:\s*/, $header, 2);
        $headers{lc($key)} = $value;
    }
    return %headers;
}

Xray (Go):

func ParseHeaders(headers string) map[string]string {
    headerMap := make(map[string]string)
    for _, line := range strings.Split(headers, "\n") {
        parts := strings.SplitN(line, ":", 2)
        if len(parts) == 2 {
            headerMap[strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1])
        }
    }
    return headerMap
}

Both code snippets demonstrate header parsing functionality, with Nikto using Perl and Xray using Go. Xray's implementation is more concise and leverages Go's built-in functions for string manipulation.

8,559

WPScan WordPress security scanner. Written for security professionals and blog maintainers to test the security of their WordPress websites. Contact us via contact@wpscan.com

Pros of WPScan

  • Specialized for WordPress security scanning, offering deep insights into WordPress-specific vulnerabilities
  • Extensive database of WordPress vulnerabilities, regularly updated
  • Supports both CLI and API usage, providing flexibility for different use cases

Cons of WPScan

  • Limited to WordPress sites, unlike Xray's broader web application scanning capabilities
  • May require more manual configuration and interpretation of results compared to Xray's user-friendly interface

Code Comparison

WPScan (Ruby):

def scan
  run_plugins
  enumerate_users
  check_vulnerabilities
end

Xray (Go):

func Scan(target string) {
    runPlugins()
    detectVulnerabilities()
    generateReport()
}

Both projects use a modular approach for scanning, but Xray's implementation in Go may offer performance advantages over WPScan's Ruby codebase. WPScan's code focuses on WordPress-specific elements, while Xray's is more generalized for various web applications.

WPScan excels in WordPress-specific security scanning, offering deep insights into CMS vulnerabilities. However, its specialization limits its use to WordPress sites. Xray provides a more versatile solution for scanning various web applications, potentially offering broader coverage but with less WordPress-specific depth. The choice between the two depends on the specific needs of the user and the target applications.

12,618

The ZAP by Checkmarx Core project

Pros of ZAP

  • More mature and widely adopted project with a larger community
  • Extensive documentation and tutorials available
  • Supports multiple scripting languages for customization (JavaScript, Python, Ruby)

Cons of ZAP

  • Steeper learning curve for beginners
  • Can be resource-intensive for large-scale scans
  • UI may feel outdated compared to more modern tools

Code Comparison

ZAP (Java):

public class ActiveScan extends AbstractAppParamPlugin {
    @Override
    public void scan(HttpMessage msg, String param, String value) {
        // Scanning logic here
    }
}

Xray (Go):

func (p *Plugin) Check(url *url.URL, resp *http.Response, body []byte) ([]poc.VulnResult, error) {
    // Vulnerability checking logic here
}

Both repositories focus on web security scanning, but they differ in implementation languages and specific features. ZAP is written in Java and offers a more comprehensive set of tools, while Xray is written in Go and aims for simplicity and ease of use. ZAP provides a full-featured GUI and API, whereas Xray is primarily designed for command-line usage and integration into CI/CD pipelines.

13,141

Most advanced XSS scanner.

Pros of XSStrike

  • Focused specifically on XSS detection and exploitation
  • Lightweight and easy to use for targeted XSS testing
  • Actively maintained with frequent updates

Cons of XSStrike

  • Limited to XSS vulnerabilities, while xray covers a broader range of security issues
  • Less comprehensive scanning capabilities compared to xray's multi-threaded approach
  • Smaller community and fewer contributors

Code Comparison

XSStrike (Python):

def scan(url, params, headers, GET, delay, timeout):
    global globalVariables
    globalVariables = {}
    paramsCopy = copy.deepcopy(params)
    headers = copy.deepcopy(headers)
    GET = GET
    delay = delay
    timeout = timeout

xray (Go):

func (p *Poc) Execute(url string) (result PluginResult, err error) {
    result.Vulnerable = false
    result.Target = url

    for _, rule := range p.Rules {
        ok, err := rule.Execute(url)
        if err != nil {
            return result, err
        }
        if ok {
            result.Vulnerable = true
            break
        }
    }
    return
}

Both tools utilize different programming languages and approaches, with XSStrike focusing on XSS-specific scanning logic, while xray implements a more generalized vulnerability detection framework.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Welcome to xray 👋

Documentation

一款功能强大的安全评估工具

🏠使用文档 • ⬇️xray下载 • ⬇️xpoc下载 • ⬇️xapp下载 • 📖插件存储库

English Version

注意:xray系列不开源,直接下载构建的二进制文件即可,仓库内主要为社区贡献的 poc,每次 xray 发布将自动打包。

✨ xray2.0

为了解决 xray 1.0在功能增加过程中变得复杂且臃肿的问题,我们推出了 xray 2.0。

这一全新版本致力于提升功能使用的流畅度,降低使用门槛,并帮助更多安全行业从业者以更高效的模式收获更好的体验。xray 2.0 将整合一系列新的安全工具,形成一个全面的安全工具集。

xray2.0系列的第二款工具xapp已经上线,欢迎体验!

XPOC

xpoc是xray2.0系列的第一款工具,它是一款为供应链漏洞扫描设计的快速应急响应工具

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

XAPP

xapp是一款专注于web指纹识别的工具。你可以使用xapp对web目标所使用的技术进行识别,为安全测试做好准备。

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

插件存储库

我们为各类插件创建了一个专门的存储库,旨在方便大家共享和使用各种插件。

这里主要收录的是开源的、转化成 xray格式的脚本,以供大家使用。

我们会不定期地往这里推送一些新的插件,同时也希望大家能积极踊跃的优化或者提交插件,共同丰富这个仓库。

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

🚀 快速使用

在使用之前,请务必阅读并同意 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
    

    报告样例

其他用法请阅读文档: https://docs.xray.cool

🪟 检测模块

新的检测模块将不断添加

名称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 发包配置
  • 反连平台的使用
  • ...

😘 贡献 POC

xray的进步离不开各位师傅的支持,秉持着互助共建的精神,为了让我们共同进步,xray也开通了“PoC收录”的渠道!在这里你将会得到:

提交流程

  1. 贡献者以 PR 的方式向 github xray 社区仓库内提交, POC 提交位置: https://github.com/chaitin/xray/tree/master/pocs, 指纹识别脚本提交位置: https://github.com/chaitin/xray/tree/master/fingerprints
  2. PR 中根据 Pull Request 的模板填写 POC 信息
  3. 内部审核 PR,确定是否合并入仓库
  4. 但需要注意,如果想要获得POC的奖励,需要将你的POC提交到CT stack,才能获取到奖励

丰厚的奖励

  • 贡献PoC将获得**丰厚的金币奖励**,成就感满满;
  • 丰富的礼品兑换专区,50余种周边礼品任你挑选;
  • 定期更有京东卡上线兑换,离**财富自由**又近了一步;
  • 进入核心社群的机会,领取特殊任务,赚取高额赏金;

完善的教程

  • 完善的PoC编写教程和指导,让你快速上手,少走弯路;

学习与交流

  • **与贡献者、开发者面对面**学习交流的机会,各项能力综合提高;
  • 免笔试的直通面试机会,好工作不是梦;

如果你已经成功贡献过PoC但是还没有进群,请添加客服微信:

提供平台注册id进行验证,验证通过后即可进群!

参照: https://docs.xray.cool/#/guide/contribute

🔧周边生态

POC质量确认靶场

Evil Pot

Releases

一个专门用于让扫描器产生误报的靶场

编写插件应该尽量避免能在这个靶场扫描出结果

POC编写辅助工具

该工具可以辅助生成POC,且在线版支持poc查重,本地版支持直接发包验证

在线版

本地版

xray gui辅助工具

本工具仅是简单的命令行包装,并不是直接调用方法。在 xray 的规划中,未来会有一款真正的完善的 GUI 版 XrayPro 工具,敬请期待。

📝 讨论区

各位开发者和 xray 粉丝们,欢迎来讨论区投票,决定 xray 2.0 工具的开发优先级,让你的声音塑造 xray 的未来! 🚀

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

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

  1. GitHub:

  2. 微信公众号:微信扫描以下二维码,关注我们

  3. 微信群: 请添加微信公众号并点击"联系我们" -> "加群",然后扫描二维码加群

  4. QQ 群: 717365081

Star History

Star History Chart