All Projects → zema1 → yarx

zema1 / yarx

Licence: MIT License
An awesome reverse engine for xray poc. | 一个自动化根据 xray poc 生成对应 server 的工具

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to yarx

http-live-simulator
A simple HTTP Server that serves with random delay for live simulation
Stars: ✭ 58 (-74.67%)
Mutual labels:  http-server
nhttp
An Simple http framework for Deno, Deno Deploy and Cloudflare Workers. so hot 🚀
Stars: ✭ 26 (-88.65%)
Mutual labels:  http-server
fs-over-http
A filesystem interface over http, with extras and docker support
Stars: ✭ 14 (-93.89%)
Mutual labels:  http-server
DataXServer
为DataX(https://github.com/alibaba/DataX) 提供远程多语言调用(ThriftServer,HttpServer) 分布式运行(DataX on YARN) 功能
Stars: ✭ 130 (-43.23%)
Mutual labels:  http-server
xray-node
Python 开发的基于 xray-core 的多用户代理后端,支持用户动态管理和流量统计。
Stars: ✭ 20 (-91.27%)
Mutual labels:  xray
go-oryx-lib
The public multiple media library for https://github.com/ossrs/go-oryx.
Stars: ✭ 98 (-57.21%)
Mutual labels:  http-server
malloy
A C++ library providing embeddable server & client components for both HTTP and WebSocket.
Stars: ✭ 29 (-87.34%)
Mutual labels:  http-server
restana
Super fast and minimalist framework for building REST micro-services.
Stars: ✭ 380 (+65.94%)
Mutual labels:  http-server
reciprocalspaceship
Tools for exploring reciprocal space
Stars: ✭ 17 (-92.58%)
Mutual labels:  xray
xray-plugin-android
A SIP003 plugin based on Xray-core for shadowsocks-android
Stars: ✭ 52 (-77.29%)
Mutual labels:  xray
go-fileserver
A simple HTTP Server to share files over WiFi via Qr Code
Stars: ✭ 68 (-70.31%)
Mutual labels:  http-server
MTJailed-Native
A terminal emulator with remote shell for non-jailbroken iOS devices
Stars: ✭ 24 (-89.52%)
Mutual labels:  http-server
quickserv
Dangerously user-friendly web server for quick prototyping and hackathons
Stars: ✭ 275 (+20.09%)
Mutual labels:  http-server
foxy
Session-based Beast/Asio wrapper requiring C++14
Stars: ✭ 61 (-73.36%)
Mutual labels:  http-server
httpbun
A simple HTTP server with responses tuned to be useful in testing HTTP clients. Heavily inspired by httpbin, but doesn't intend to be a perfect clone.
Stars: ✭ 14 (-93.89%)
Mutual labels:  http-server
http-accept
Parse Accept and Accept-Language HTTP headers in Ruby.
Stars: ✭ 69 (-69.87%)
Mutual labels:  http-server
shivneri
Component based MVC web framework based on fort architecture targeting good code structures, modularity & performance.
Stars: ✭ 21 (-90.83%)
Mutual labels:  http-server
python-fake-data-producer-for-apache-kafka
Kafka Python Fake Data Producer is a complete demo app allowing you to quickly produce a Python fake Pizza-based streaming dataset and push it to an Apache Kafka topic. It gives an example on how easy is to create great fake streaming data to feed Apache Kafka.
Stars: ✭ 34 (-85.15%)
Mutual labels:  fake-data-generator
node-slack-events-api
Slack Events API for Node
Stars: ✭ 93 (-59.39%)
Mutual labels:  http-server
eephttpd
Serving simple static sites directly to i2p via the SAM API. (Also part of https://github.com/eyedeekay/sam-forwarder)
Stars: ✭ 15 (-93.45%)
Mutual labels:  http-server
Logo

在线体验    漏洞报告

Yarx 是什么

Yarx 来自于 x-r-a-y 的反向拼写,它能够根据 xray 的 yaml poc 规则全自动的生成一个满足规则要求的 Server,使用 xray 扫描该 Server 将会扫描出对应的漏洞。它的核心工作原理如下:

yarx-core

它的主要特性有:

  • 支持 status、header、body 等位置的响应变换
  • 支持 == contains submatch 等各种匹配模式
  • 支持动态变量的渲染和捕获以及多级规则的变量追踪
  • 支持绝大部分内置函数的解析和调用
  • 通过路由合并和智能排序等策略有效减少路由冲突
  • 平铺式规则处理逻辑,支持并发扫描
  • 支持捕获扫描事件做进一步分析联动

核心原理: https://koalr.me/posts/core-concept-of-yarx/

立即尝试

./xray webscan --plugins phantasm --html-output yarx.html --url https://yarx.koalr.me

running

几秒钟后你就会得到一个类似的漏洞报告: report.html

安装

  • Github Release

    https://github.com/zema1/yarx/releases 下载合适的版本然后从命令行运行即可

  • Docker Hub

    docker pull zemal/yarx:latest
  • 源码安装

    git clone https://github.com/zema1/yarx
    cd yarx
    go build -o yarx ./cmd/yarx

用法

USAGE:
   yarx [global options] [arguments...]

GLOBAL OPTIONS:
   --pocs value, -p value    load pocs from this dir
   --listen value, -l value  the http server listen address (default: "127.0.0.1:7788")
   --root value, -r value    load files form this directory if the requested path is not found

   --verbose, -V             verbose mode, which is  equivalent to --log-level debug (default: false)
   --help, -h                show help (default: false)

使用示例:

# 在8080端口创建一个 http 服务,这个服务将模拟 pocs 文件夹下的所有漏洞
./yarx -p ./pocs -l 0.0.0.0:8080

# 和上面类似,但当路径不存在时,会从 `./www/html` 加载文件
./yarx -p ./pocs -l 0.0.0.0:8080 -r ./www/html

running

你可以使用本仓库的 pocs 文件夹,也可以直接使用 xray 官方仓库的 https://github.com/chaitin/xray/tree/master/pocs 文件夹。本仓库仅仅是去掉了暂时不支持的 poc,后者除了在运行时会打印一点错误信息之外没有任何区别,我会定期同步数据来增加更多 poc。当然,你也可以指定自己编写的 poc。

开发

Yarx 也可以作为 go 的 package 来使用

yr := &yarx.Yarx{}
// err := yr.Parse([]byte("poc-data"))
err := yr.ParseFile("/path/to/a/yaml/poc")
if err != nil {
    panic(err)
}

// 每个成功加载的 poc 对应一个 MutationChain
// poc 中的 rule 则对应于 MutationRule
chains := yr.Chains()
rules := yr.Rules()
...

// 一键生成上述规则的 http handler
handler := yr.HTTPHandler()

// 事件处理
handler.OnRuleMatch(func(e *yarx.ScanEvent) {
})
handler.OnPocMatch(func(e *yarx.ScanEvent) {
    fmt.Println(e.RemoteAddr)
    fmt.Println(e.Request)
    fmt.Println(e.Response)
    fmt.Println(e.PocMatched)
    fmt.Println(e.RuleMatched)
})

// 启动服务
http.ListenAndServe(handler, "127.0.0.1:7788")

错误说明

Yarx 在解析 poc 的过程中可能会出现错误,这些 poc 不会被加载到最终的 http 服务中,遇到错误时不要惊慌,基本都是这几类问题:

  • 不支持路径本身太灵活的

    主要是 {{name}}.php/ 之类的路径,这些路径作为路由时无法与其他类似的规则区分开,目测无解(相信我,Yarx 已经尽了最大努力避免路由冲突)

  • 不支持 set 定义中存在复杂转换的情况,如:

    set:
      r0: randLowercase(8)
      r1: base64(r0) # 追踪这个变量太复杂,不打算支持
  • 不支持使用反连平台的,即 yaml 中有 newReverse() 调用的,后续有计划支持

如果你遇到其他类型的报错,可以提交一个 issue,带上报错的 yaml poc 即可,我会尽快处理。

规划

  • 支持 Docker 一键部署
  • 支持依赖反连平台的 POC
  • 支持依赖 request 的 POC
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].