Skip to content

Commit

Permalink
更新子域名文档
Browse files Browse the repository at this point in the history
  • Loading branch information
zema1 committed Jun 13, 2020
1 parent 1c86a9d commit fcdce56
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 55 deletions.
1 change: 0 additions & 1 deletion docs/assets/configuration/cui.svg

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/configuration/terminalui.svg

This file was deleted.

23 changes: 13 additions & 10 deletions docs/assets/report_example.html

Large diffs are not rendered by default.

48 changes: 32 additions & 16 deletions docs/configration/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,46 @@ xray 的命令有 6 个,抛开 `version` 和 `help` 这两个信息展示型

这里介绍一下后面两个命令。

## subdomain 子域名扫描
## subdomain 子域名扫描 (仅高级版)

扫描 `example.com`,并将结果输出到 example.txt
运行 `./xray_darwin_amd64 subdomain -h`,可以看到

```
./xray_darwin_amd64 subdomain --target example.com --text-output example.txt
NAME:
subdomain - Run a subdomain task
USAGE:
subdomain [command options] [arguments...]
OPTIONS:
--target value, -t value SubDomain scan targets
--no-brute disable subdomain brute runner
--web-only only output domains that have web services
--ip-only only output domains that had been resolved successfully
--json-output FILE output xray results to FILE in json format
--html-output FILE output xray results to FILE in HTML format
--text-output FILE output xray results to FILE in plain text format
--webhook-output value post xray result to url in json format
```

扫描 `example.com`,并将结果输出到 example 报告

```
./xray_darwin_amd64 subdomain --target example.com --html-output example.html
```

扫描 `example.com`,并使用 console ui 交互式界面,同时记录结果到 example.txt
扫描 `example.com`,输出到 html 报告,且结果仅保留成功解析到 IP 的

```
./xray_darwin_amd64 subdomain --target example.com --console-ui --text-output example.txt
./xray_darwin_amd64 subdomain --target example.com --html-output example.html --ip-only
```
![cui.svg](../assets/configuration/cui.svg)

其他用法请参照 subdomain 配置文件中的内容

扫描 `example.com`,输出到 html 报告,且结果仅保留域名存在 web 应用的 (80, 443)

```
./xray_darwin_amd64 subdomain --target example.com --html-output example.html --web-only
```

## webscan web 漏洞检测
运行 `./xray_darwin_amd64 webscan -h`,可以看到
Expand Down Expand Up @@ -192,12 +216,4 @@ a=b&x=y
./xray_darwin_amd64 webscan --url http://example.com --data "x=y" --html-output 2.html --json-output 1.json
./xray_darwin_amd64 webscan --url http://example.com/ --webhook-output http://host:port/path
```

## 交互式命令行

如果你已经理解了上面的这些内容,但感觉内容繁多记不住,那这个交互式的命令行就是新手福利了。

直接运行 xray 而不加任何参数即可启动交互式命令行。

![ui](../assets/configuration/terminalui.svg)
```
59 changes: 32 additions & 27 deletions docs/configration/subdomain.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,37 @@

```yaml
subdomain:
modes: # 使用哪些方式获取子域名
- brute # 字典爆破模式
- api # 使用各大 api 获取
- zone_transfer # 尝试使用域传送漏洞获取
worker_count: 100 # 决定同时允许多少个 DNS 查询
dns_servers: # 查询使用的 DNS server
- 1.1.1.1
- 8.8.8.8
allow_recursive: false # 是否允许递归扫描,开了后如果发现 a.example.com 将继续扫描 a.example.com 的子域名
max_depth: 5 # 最大允许的子域名深度
main_dictionary: "" # 一级子域名字典, 绝对路径
sub_dictionary: "" # 其它层级子域名字典, 绝对路径
max_parallel: 50 # 并发的 worker 数,类似线程数
allow_recursion: false # 是否允许递归的处理子域名,开启后,扫描完一级域名后,会自动将一级的每个域名作为新的目标,去找二级域名, 递归层数由下面的配置决定
max_recursion_depth: 3 # 最大允许的子域名层数,3 意为 3 级子域名
web_only: false # 结果中仅显示有 web 应用的, 没有 web 应用的将被丢弃
ip_only: false # 结果中仅展示解析出 IP 的,没有解析成功的将被丢弃
servers: ["8.8.8.8", "8.8.4.4", "223.5.5.5", "223.6.6.6", "4.2.2.1", "114.114.114.114"] # 子域名扫描过程中使用的 DNS Server
sources:
brute: # 字典爆破模式, 会自动处理泛解析问题
enabled: true
main_dict: "" # 一级大字典路径,为空将使用内置的 TOP 30000 字典
sub_dict: "" # 其他级小字典路径,为空将使用内置过的 TOP 100 字典
httpfinder: # http 的一些方式来抓取子域名,包括 js, 配置文件,http header 等等
enabled: true
dnsfinder: # 使用 dns 的一些错误配置来找寻子域名,如区域传送(zone transfer)
enabled: true
certspotter: # 下面的都是 API 类的了
enabled: true
crt:
enabled: true
hackertarget:
enabled: true
qianxun:
enabled: true
rapiddns:
enabled: true
sublist3r:
enabled: true
threatminer:
enabled: true
virusTotal:
enabled: true
```
子域名的配置项相对比较简洁,对照注释大都可以理解。
## worker_count
这个 worker_count 对应于 goroutine, 如果没写过 go,可以理解为其他语言的协程、线程。如果设置为 100,指的是同时可能有 100 个 DNS 查询请求发出。这和 http 配置中的 `max_qps` 不一样,`max_qps` 指的是 1s 内最大运行的请求数。

## `allow_recursive` 和 `max_depth`

假设子域名扫描的目标为 `example.com`, 发现有子域名 `a.example.com`。
当开启 `allow_recurisive` 后,将自动把 `a.example.com` 视为新的扫描目标,进而可能获得 `b.a.example.com` 等二级子域。 而最大的子域深度由 `max_depth` 控制。

## `main_dictionary` 和 `sub_dictionary`

与 `dirscan` 插件类似,当没有配置这两项时将使用内置字典,默认 main 字典为 Top3000, 默认 sub 字典为 top200。
当配置了自定义字典时,将使用用户配置的字典而禁用内直字典,两个配置项可以单独配置。
子域名的配置项相对比较简洁,对照注释大都可以理解。

0 comments on commit fcdce56

Please sign in to comment.