侧边栏壁纸
博主头像
wjlin0博主等级

行动起来,活在当下

  • 累计撰写 19 篇文章
  • 累计创建 19 个标签
  • 累计收到 5 条评论

目 录CONTENT

文章目录

pathScan

wjlin0
2024-04-01 / 0 评论 / 0 点赞 / 43 阅读 / 10777 字
作者修订时间
wjlin02024-04-01 15:28:54

pathScan

pathScan 是一个用Go编写的路径扫描工具,它允许您快速可靠的扫描URL地址和子域名信息收集。

地址: https://github.com/wjlin0/pathScan

pathScan安装

pathScan在安装前无需任何环境只需要下载已打包好的二进制文件,并根据操作系统选出相应的二进制文件

例如,使用 wget、curl安装

wget -o pathScan.zip https://github.com/wjlin0/pathScan/releases/download/v2.0.6/pathScan_2.0.6_windows_amd64.zip
curl -L -o pathScan.zip https://github.com/wjlin0/pathScan/releases/download/v2.0.6/pathScan_2.0.6_linux_amd64.zip

最后选择解压并移植到环境变量中的目录中

unzip pathScan.zip -d pathScan && chmod +x pathScan/pathScan && mv pathScan/pathScan /usr/local/bin/pathScan && rm -rf pathScan
pathScan -v

当然如果你找不到你对应系统的二进制文件,那么你可以选择以下方式

go -> pathScan需要go1.21才能安装成功

go install -v github.com/wjlin0/pathScan@latest

使用

下载配置文件

pathScan第一次运行会创建配置文件到 $HOME/.config/pathScan/

image-20240331021527107

当然初始化时这些文件并不存在配置,其中

  • match-config 为指纹识别文件目录,这个文件可从用命令 pathScan -um 下载最新的指纹识别库

image-20240331021947545

  • provider-config.yaml 为网络空间测绘搜索引擎的API配置文件,可以设置多个key,运行时随机选择key

    image-20240331022018093

  • config.yaml 为命令行配置,如果你不想输入过长的命令,则可以将参数配置在该文中,运行时会自动读取该文件内容

image-20240331022052551

基本使用

探寻一个完整的基本路径,并排除404响应

pathScan -u https://wjlin0.com -sc 404

image-20240331022150281

当错误过多时,你可以选择排除一些不必要的 比如排除长度 483的

pathScan -u https://wjlin0.com -sc 404 -sbl 483

image-20240331022403681

网络测绘

  • 从网络空间中,发现目标
# 首先得把key配置到 provider-config.yaml 文件中
pathScan -ue quake -uq 'domain: "baidu.com"' -uc -sc 404

image-20230709115619203

域名搜索

pathScan 其中内置了许多爬虫以及网络空间如下,默认选择所有进行收集,并进行指纹探测这是一体的

shodan censys fofa quake hunter zoomeye netlas criminalip publicwww hunterhow binaryedge github fullhunt zone0 shodan-idb anubis-spider sitedossier-spider fofa-spider bing-spider chinaz-spider google-spider ip138-spider qianxun-spider rapiddns-spider baidu-spider yahoo-spider zoomeye-spider

pathScan -s -sq wjlin0.com 
➜  ~ pathScan -s -sq wjlin0.com

               __   __    ____
   ___  ___ _ / /_ / /   / __/____ ___ _ ___
  / _ \/ _  // __// _ \ _\ \ / __// _  // _ \
 / .__/\_,_/ \__//_//_//___/ \__/ \_,_//_//_/
/_/

			wjlin0.com

慎用。你要为自己的行为负责
开发者不承担任何责任,也不对任何误用或损坏负责.
[INF] Current pathScan version v2.0.5 (latest)
[INF] Current pathScan-match version 1.1.2 (latest)
[INF] PathScan-match templates loaded for current scan: 68
[INF] Subdomain engine: ["shodan", "censys", "fofa", "quake", "hunter", "zoomeye", "netlas", "criminalip", "publicwww", "hunterhow", "binaryedge", "github", "fullhunt", "zone0", "shodan-idb", "anubis-spider", "sitedossier-spider", "fofa-spider", "bing-spider", "chinaz-spider", "google-spider", "ip138-spider", "qianxun-spider", "rapiddns-spider", "baidu-spider", "yahoo-spider", "zoomeye-spider"]
[INF] Subdomain query: ["wjlin0.com"]
[ERR] only ip/cidr are accepted
[INF] Running check alive on input host
[INF] Found 17 URL of alive hosts
[INF] Total number of Requests: 510
http://101.43.95.147:80/ [404] [146] [101.43.95.147] [waf-detect:nginxgeneric] [404 Not Found]
http://42.101.4.41:80/ [403] [554] [42.101.4.41] [waf-detect:apachegeneric] [403 Forbidden]
https://101.43.95.147:443/ [404] [548] [101.43.95.147] [waf-detect:nginxgeneric] [404 Not Found]
https://101.43.95.147/ [404] [548] [101.43.95.147] [waf-detect:nginxgeneric] [404 Not Found]
http://172.67.183.17:8080/ [403] [16] [172.67.183.17] [waf-detect:cloudflare]
http://172.67.183.17:443/ [400] [253] [172.67.183.17] [waf-detect:cloudflare] [400 The plain HTTP request was sent to HTTPS port]
http://172.67.183.17:8443/ [400] [253] [172.67.183.17] [waf-detect:cloudflare] [400 The plain HTTP request was sent to HTTPS port]
http://172.67.183.17:80/ [403] [16] [172.67.183.17] [waf-detect:cloudflare]
http://101.43.95.147:80/ [404] [548] [101.43.95.147] [waf-detect:nginxgeneric] [404 Not Found]
http://42.101.4.41:80/ [403] [152] [42.101.4.41] [java-jsp:jsp,waf-detect:apachegeneric] [403 Forbidden]
https://dns.wjlin0.com/ [404] [172.67.183.17] [waf-detect:cloudflare]
https://book.wjlin0.com/ [404] [3082] [172.67.183.17] [waf-detect:cloudflare] [Page Not Found]
https://101.43.95.147/ [404] [146] [101.43.95.147] [waf-detect:nginxgeneric] [404 Not Found]
https://101.43.95.147:443/ [404] [146] [101.43.95.147] [waf-detect:nginxgeneric] [404 Not Found]
https://cdusec.wjlin0.com/ [404] [3082] [104.21.36.16] [waf-detect:cloudflare] [Page Not Found]
https://blog.wjlin0.com/ [404] [3082] [104.21.36.16] [waf-detect:cloudflare] [Page Not Found]
https://wjlin0.com/ [200] [2288] [101.43.95.147]
........
........
........

配合其他工具

pathScan 支持标准输入输出,所以你可以轻松从其他的工具的输出结果获取到,再从标准输出传递给其他工具。

cat url.txt | pathScan -ps / -silent | nuclei

image-20240331022535664

更多用法

➜  ~ pathScan -h
pathScan 2.0.5 Go 扫描、信息收集工具

Usage:
  pathScan [flags]

Flags:
输入:
   -u, -url string[]  目标(以逗号分割)
   -list string[]     从文件中,读取目标

扫描字典:
   -ps, -path string[]       路径(以逗号分割)
   -pl, -path-list string[]  从文件中,读取路径
   -ldd, -load-default-dict  目标超过一个时,是否加载默认字典
   -lad, -load-api-dict      是否加载api字典

子域名收集模式:
   -s, -sub                   子域名收集
   -sq, -sub-query string[]   需要收集的域名 (支持从文件中录入 -sq /tmp/sub-query.txt)
   -sl, -sub-limit int        每个搜索引擎返回的至少不超过数 (default 1000)
   -so, -sub-output string    子域名搜索结果保存 支持csv格式输出
   -se, -sub-engine string[]  子域名搜索引擎 [shodan censys fofa quake hunter zoomeye netlas criminalip publicwww hunterhow binaryedge github fullhunt zone0 shodan-idb anubis-spider sitedossier-spider fofa-spider bing-spider chinaz-spider google-spider ip138-spider qianxun-spider rapiddns-spider baidu-spider yahoo-spider zoomeye-spider] (default all)

引擎搜索模式:
   -uc, -uncover                  启用打开搜索引擎
   -uq, -uncover-query string[]   搜索查询
   -ue, -uncover-engine string[]  支持的引擎 [shodan censys fofa quake hunter zoomeye netlas criminalip publicwww hunterhow binaryedge github fullhunt zone0] (default fofa)
   -uf, -uncover-field string     引擎返回字段 (ip,port,host) (default "host")
   -ul, -uncover-limit int        发现要返回的结果 (default 100)
   -uo, -uncover-output string    搜索引擎查询结果保存 支持csv格式输出

跳过:
   -su, -skip-url string[]          跳过的目标(以逗号分割,支持从文件读取 -su /tmp/skip-url.txt)
   -sc, -skip-code string[]         跳过状态码(以逗号分割,支持从文件读取 -sc /tmp/skip-code.txt, 支持 5xx、300-399 )
   -sh, -skip-hash string           跳过指定hash
   -sbl, -skip-body-len string[]    跳过body固定长度(支持 100-200,即长度为100~200之间的均跳过,支持 从文件中读取 -sbl /tmp/skip-body-len.txt)
   -sbr, -skip-body-regex string[]  跳过body正则匹配(以逗号分割,支持从文件读取 -sbr /tmp/skip-regex.txt)

输出:
   -o, -output string  输出文件路径(可忽略)
   -csv                csv格式输出
   -html               html格式输出
   -silent             简略输出
   -nc, -no-color      无颜色输出
   -vb, -verbose       详细输出模式
   -debug              调试输出

工具:
   -gh, -get-hash                  计算hash
   -shm, -skip-hash-method string  指定hash的方法(sha256,md5,sha1) (default "sha256")

模版规则:
   -validate                  验证指纹文件
   -mf, -match-file string    指纹文件目录或文件
   -dsm, -disable-scan-match  禁用指纹识别

配置:
   -no-stdin                         disable stdin processing
   -rs, -retries int                 重试
   -p, -proxy string[]               代理
   -resolvers string[]               自定义DNS列表( 文件或逗号隔开 )
   -nn, -not-new                     允许重定向
   -dac, -disable-alive-check        跳过活跃检查
   -sdl, -scan-domain-list string[]  从响应中中发现其他域名(逗号隔开,支持文件读取 -sdl /tmp/otherDomain.txt)
   -sd, -scan-domain                 从响应中发现其他域名
   -v, -version                      输出版本

请求头参数:
   -m, -method string[]          请求方法 [GET HEAD POST PUT PATCH DELETE CONNECT OPTIONS TRACE] (default ["GET"])
   -ua, -user-agent string[]     User-Agent (支持从文件中录入 -ua /tmp/user-agent.txt)
   -c, -cookie string            cookie
   -auth, -authorization string  Auth请求头
   -header string[]              自定义请求头,以逗号隔开 (支持从文件中录入 -header /tmp/header.txt)
   -b, -body string              自定义请求体

速率:
   -t, -thread int       线程 (default 50)
   -rl, -rate-limit int  每秒允许的HTTP连接数 (default 150)
   -http-timeout int     HTTP请求超时时间 (default 15)

更新:
   -update                      更新版本
   -um, -update-match           更新指纹识别库
   -duc, -disable-update-check  跳过自动检查更新


EXAMPLES:

运行 pathScan 扫描路径, 指定单个目标 跳过 4xx 5xx 输出:
    $ pathScan -u https://example.com/ -sc 4xx,5xx

运行 pathScan 搜索引擎:
    $ pathScan -ue fofa -uq 'app="tomcat"'

运行 pathScan 收集子域名 指定输出:
    $ pathScan -sq example.com -csv -o out.csv

运行 pathScan 收集子域名 并配合 nuclei 进行自动化漏洞扫描:
    $ pathScan -sq example.com -silent | nuclei

其他文档可在以下网址获得: https://github.com/wjlin0/pathScan/

总结

pathScan是一款高效的,采用go语言开发,快速的发现目标信息,并收集信息,这对我们渗透测试有则很大的帮助.同时pathScan也有许多功能尚未完善,欢迎大家提交pull requests

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区