Giter Club home page Giter Club logo

zpscan's Introduction

zpscan

命令行信息收集工具

功能

  • domainscan

    • 调用 subfinder 被动收集,调用 ksubdoamin 进行 dns 验证
    • 泛解析、CDN 判断
    • 获取 domain 相关的 web(host:port)资产,使用 webscan 扫描
  • webscan

    • 支持 http/https scheme 自动判断
    • 获取 statusCode、contentLength、favicon、iconHash、title、wappalyzer、finger
    • title 自动中文解码
    • js 静态分析跳转
    • favicon 自动分析获取 iconhash
    • 指纹自定义 tags 用来过滤和标记,pocTags 与 pocscan 对应
    • 联动模块(webscan -> pocscan)
  • ipscan

    • 支持多种输入格式(192.168.1.1-128)(192.168.1.0/24)
    • 先端口开放扫描(tcp),使用 nmap 指纹识别协议
    • 获取地理位置
    • 操作系统识别
    • 联动模块(ipscan -> webscan -> crack)
  • crack

    • 支持默认端口协议和自定义协议爆破(127.0.0.1:3306)(127.0.01:3307|mysql)
    • 支持常见服务口令爆破、未授权检测( ftp,ssh,wmi,wmihash,smb,mssql,oracle,mysql,rdp,postgres,redis,memcached,mongodb)
    • 全部模块测试用例(爆破成功、失败、超时)
  • dirscan

    • 字典分类
    • 结果过滤(重复 contentLength 判断)
  • pocscan

    • 支持多种 poc 格式(goby、xray、nuclei)
    • 支持指定 tag 加载 poc
  • expscan

    • 基于 nuclei 的 exp 框架,通过 variables 替换 payload,通过 extractors 匹配结果

使用

➜  zpscan git:(main) ./zpscan -h
一个有点好用的信息收集工具 by zp857

Usage:
  zpscan [command]

Available Commands:
  crack       常见服务弱口令爆破
  dirscan     目录扫描
  domainscan  子域名收集
  help        Help about any command
  ipscan      端口扫描
 	pocscan     poc扫描
  webscan     web信息收集

Flags:
      --debug               show debug output
  -h, --help                help for zpscan
  -i, --input string        single input(example: -i 'xxx')
  -f, --input-file string   inputs file(example: -f 'xxx.txt')
      --no-color            disable colors in output
  -o, --output string       output file to write found results (default "result.txt")

Use "zpscan [command] --help" for more information about a command.

子命令(domainscan|ipscan|webscan|crack|dirscan|pocscan)

➜  zpscan git:(main) ./zpscan crack -h                       
常见服务弱口令爆破,支持ftp,ssh,wmi,wmihash,smb,mssql,oracle,mysql,rdp,postgres,redis,memcached,mongodb

Usage:
  zpscan crack [flags]

Flags:
      --crack-all          crack all user:pass
      --delay int          delay between requests in seconds (0 to disable)
  -h, --help               help for crack
  -m, --module string      choose one module to crack(ftp,ssh,wmi,mssql,oracle,mysql,rdp,postgres,redis,memcached,mongodb) (default "all")
      --pass string        pass(example: --pass 'admin,root')
      --pass-file string   pass file(example: --pass-file 'pass.txt')
      --threads int        number of threads (default 1)
      --timeout int        timeout in seconds (default 10)
      --user string        user(example: --user 'admin,root')
      --user-file string   user file(example: --user-file 'user.txt')

Global Flags:
      --debug               show debug output
  -i, --input string        single input(example: -i 'xxx')
  -f, --input-file string   inputs file(example: -f 'xxx.txt')
      --no-color            disable colors in output
  -o, --output string       output file to write found results (default "result.txt")
[INF] 运行时间: 545.655µs

截图

domainscan

image-20220920100928722

ipscan

image-20220920101122919

webscan

image-20220916134330575

crack

image-20220916134433908

dirscan

image-20220920101308449

pocscan

image-20230422192033778

expscan

image-20230422192623949

说明

更新

2023-01-04

  • 改进 domainscan 模块的 subfinder 模块
  • 改进 dirscan 模块,根据 url 自动补充字典

2022-12-21

  • 增加 exp 模块(nuclei),支持走代理扫描

2022-11-10

  • 增加 pocscan 模块

TODO

  • 子域名存在泛解析时爆破方式:使用 TTL 判断

Q&A

1、linux操作系统端口扫描时出现:ping err, socket: permission denied

sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"

参考

https://github.com/projectdiscovery/subfinder

https://github.com/boy-hack/ksubdomain

https://github.com/netxfly/x-crack

https://github.com/shadow1ng/fscan

https://github.com/zu1k/nali

https://github.com/projectdiscovery/naabu

https://github.com/projectdiscovery/nuclei

https://github.com/Ciyfly/woodpecker

zpscan's People

Contributors

niudaii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zpscan's Issues

webscan功能建议

师傅的工具很棒,提一下webscan指纹识别的功能建议,是否考虑method增加get或者post请求类的,有些站点需要携带指纹url或者关键字才能回显对应框架的指纹

oracle 爆破不生效

使用命令
./zpscan crack -i ip:1521 --user test123 --pass thinker

输出内容如下,已确认test123/thinker 可以正常连接oracle,但是爆破并没有显示成功。

开始爆破……
……
爆破结束
运行时间

建议

建议加入域名端口扫描

wmi 扫描模块出错

本地 127.0.0.1:135
未能扫出口令(用户名密码已知)
20 线程,默认超时

当前测试环境win 10

http指纹可以发下吗

师傅,下载的配置文件里finger指纹只有一个,看了下格式跟其他的指纹库不适配。

poc模块报错

image

root@HW-VPS:~/zpscan# ./zpscan_linux pocscan -o out-zpscan-pocscan.txt -f ../urls.txt panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x8ac955]

goroutine 1 [running]:
github.com/niudaii/zpscan/internal/utils.GetAllFile.func1({0x0, 0x0}, {0x0?, 0x0?}, {0xc0002d4390?, 0x76?})
/home/runner/work/zpscan/zpscan/internal/utils/fileutil.go:63 +0x35
path/filepath.Walk({0x0, 0x0}, 0xc000757a88)
/opt/hostedtoolcache/go/1.18.8/x64/src/path/filepath/path.go:515 +0x50
github.com/niudaii/zpscan/internal/utils.GetAllFile({0x0?, 0xc000757af0?})
/home/runner/work/zpscan/zpscan/internal/utils/fileutil.go:62 +0x52
github.com/niudaii/zpscan/pkg/pocscan/goby.LoadAllPoc({0x0?, 0x210041b?})
/home/runner/work/zpscan/zpscan/pkg/pocscan/goby/poc.go:97 +0x33
github.com/niudaii/zpscan/cmd.initPoc()
/home/runner/work/zpscan/zpscan/cmd/pocscan.go:71 +0x39
github.com/niudaii/zpscan/cmd.glob..func5(0x4174480?, {0x20b1037?, 0x4?, 0x4?})
/home/runner/work/zpscan/zpscan/cmd/pocscan.go:45 +0x14a
github.com/spf13/cobra.(*Command).execute(0x4174480, {0xc0001133c0, 0x4, 0x4})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0x4174700)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:918
github.com/niudaii/zpscan/cmd.Execute()
/home/runner/work/zpscan/zpscan/cmd/root.go:108 +0x1da
main.main()
/home/runner/work/zpscan/zpscan/main.go:9 +0x17

github.com/imroc/req 依赖的库quic-go不兼容go1.22.2

go1.22.2版本运行报错

github.com/quic-go/quic-go/internal/qtls

../../../go/pkg/mod/github.com/quic-go/[email protected]/internal/qtls/go121.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.21 yet. For more details, please see https://github.com/quic-go/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.21 yet. F...) as int value in variable declaration

github.com/imroc/req/v3 需要升级最新版本 v3.43.7

crack多线程异常等待

url.txt

192.168.73.35:3389|rdp
45.144.1.22:22|ssh

执行命令

.\zpscan.exe crack -f .\url.txt   --user-file .\user.txt  --pass-file .\pass-100.txt --timeout 15    --debug

问题:crack 爆破弱口令,当url.txt的目标都爆破出弱口令时,程序在50秒左右完成扫描并输出结果,然后程序就在一直等待,--debug无结果输出,【爆破结束】在3m29秒才输出,进程才退出。

image

image

domainscan问题

师傅,domainscan扫完后,开始HTTP探活一直循环卡在探测这里,一个端口会进行4次左右的探测
微信截图_20230211153643

微信截图_20230211153741

crack模块在i/o timeout之后就会滚动条拉到底

使用了2w的字典, 然后运行rdp爆破后发现在i/o timeout之后就会滚动条拉到底, 然后就不跑了(--debug下看到的)
.\zpscan_1.8.39.exe crack -i xxx --user Administrator,Public,MSSQLSERVER,SQLTELEMETRY -m rdp --threads 100 --pass-file "xxx\top19576.txt" --debug

模板使用报错

image
大佬,使用过程中出现这个问题是咋回事啊,资源文件也放好了呀

使用说明

可不可以出一下使用说明啊 不会用啊

怎么使用

[ERR] initFinger() err, open : no such file or directory
[FTL] initQqwry() err, open : no such file or directory

漏洞模板加载问题

我想问下例如/home/zpscan/resource/pocscan/nuclei/cves/2001/CVE-2001-1473.yaml这些文件在哪下载,或者如何更新每年的漏洞模板文件,我安装了nuclei,并且有个/root/nuclei-templates目录,我发现和该目录下的http目录下文件雷同,而且在cves目录下有新的漏洞模板文件,所以我拷贝了一份/nuclei-templates在/home/zpscan-1.8.39/目录下,当把/home/zpscan/config.yaml配置中 nuclei-exp-dir: resource/pocscan/nuclei改为/root/nuclei-templates/http/目录时,扫描结果就开始报错,如下:
image
.txt","CommonFile":"resource/dirscan/common.txt","DirMap":null},"Pocscan":{"GobyPocDir":"resource/pocscan/goby","XrayPocDir":"resource/pocscan/xray","NucleiPocDir":"/home/zpscan-1.8.39/nuclei-templates/http","GobyPocs":null,"XrayPocs":null,"NucleiPocs":null},"Expscan":{"NucleiExpDir":"resource/pocscan/nuclei","NucleiExps":null}}
[DBG] pocscanOptions: {"Timeout":10,"Proxy":"","Headers":[]}
[INF] gobyPocs: 373
[INF] xrayPocs: 351
[INF] nucleiPocs: 7722
[INF] 开始poc扫描: https://192.168.168.80:9200
[INF] pocTag: elasticsearch
[INF] load 1 goby pocs
[DBG] 加载POC: Elasticsearch Remote Code Execution CVE-2015-1427
[INF] load 5 xray pocs
[DBG] 加载POC: poc-yaml-elasticsearch-cve-2014-3120
[DBG] 加载POC: poc-yaml-elasticsearch-cve-2015-1427
[DBG] 加载POC: poc-yaml-elasticsearch-cve-2015-3337-lfi
[DBG] 加载POC: poc-yaml-elasticsearch-cve-2015-5531
[DBG] 加载POC: poc-yaml-elasticsearch-unauth
[ERR] templates.Parse() err, no requests defined for CVE-2014-3120
[ERR] templates.Parse() err, no requests defined for CVE-2015-1427
[ERR] templates.Parse() err, no requests defined for CVE-2015-3337
[ERR] templates.Parse() err, no requests defined for CVE-2015-5531
[ERR] templates.Parse() err, no requests defined for CVE-2021-22145
[ERR] templates.Parse() err, no requests defined for elasticsearch-default-login
[ERR] templates.Parse() err, no requests defined for elasticpot-honeypot-detect
[ERR] templates.Parse() err, no requests defined for elasticsearch
[ERR] templates.Parse() err, no requests defined for elasticsearch-sql-client-detect
[ERR] templates.Parse() err, no requests defined for elasticsearch5-log4j-rce
[ERR] load 0 nuclei pocs
[INF] 不存在漏洞
[INF] 运行时间: 1.93821576s
这是/home/zpscan-1.8.39/nuclei-templates/http目录结构
image
image
这些模板文件都在,但是报错,劳请一一解答:
1.如何下载.yaml这些文件
2.在nuclei的目录http,该目录下是否可以替换/home/zpscan/config.yaml中nuclei-exp-dir: 的值,如不能替换,请粗略说明原因
3. 对于#42 -exp.yaml问题,我参考了你的方式,看到一些不同,但不知道我的理解对不对,这是我的理解,劳烦点拨下:
3.1:id:命名有变动;
3.2:去除了info:下一些无关属性
3.3:添加了variables:属性
3.4:更改http:为requests:
3.5:增加requests:下的属性extractors:

exp

请问这个exp模块的原理是什么?如何自定义exp呢

webscan模块报错

root@TX-VPS:~/zpscan# ./zpscan_linux webscan -o out-zpscan-pocscan.txt -f ../urls.txt
[ERR] initFinger() err, Get "/xxx": unsupported protocol scheme ""
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x8ac955]

goroutine 1 [running]:
github.com/niudaii/zpscan/internal/utils.GetAllFile.func1({0x0, 0x0}, {0x0?, 0x0?}, {0x0?, 0x0?})
/home/runner/work/zpscan/zpscan/internal/utils/fileutil.go:63 +0x35
path/filepath.Walk({0x0, 0x0}, 0xc0006d9a18)
/opt/hostedtoolcache/go/1.18.8/x64/src/path/filepath/path.go:515 +0x50
github.com/niudaii/zpscan/internal/utils.GetAllFile({0x0?, 0xc0006d9ab0?})
/home/runner/work/zpscan/zpscan/internal/utils/fileutil.go:62 +0x52
github.com/niudaii/zpscan/pkg/pocscan/goby.LoadAllPoc({0x0?, 0x0?})
/home/runner/work/zpscan/zpscan/pkg/pocscan/goby/poc.go:97 +0x33
github.com/niudaii/zpscan/cmd.initPoc()
/home/runner/work/zpscan/zpscan/cmd/pocscan.go:71 +0x39
github.com/niudaii/zpscan/cmd.glob..func7(0x4174e80?, {0x20b1037?, 0x4?, 0x4?})
/home/runner/work/zpscan/zpscan/cmd/webscan.go:67 +0x28a
github.com/spf13/cobra.(*Command).execute(0x4174e80, {0xc0001772c0, 0x4, 0x4})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0x4174700)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:918
github.com/niudaii/zpscan/cmd.Execute()
/home/runner/work/zpscan/zpscan/cmd/root.go:108 +0x1da
main.main()
/home/runner/work/zpscan/zpscan/main.go:9 +0x17

牛蛙牛蛙

不知道师傅有没有做web的想法,工具很棒

支持json格式输出

output可以添加一个json格式的输出,方便其他工具解析扫描结果。
我比较懒,就不mr了。

wmi 爆破报错

goroutine 1125 [running]:
github.com/C-Sto/goWMIExec/pkg/ntlmssp.ParseSSPChallenge({0x45a22f8, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/!c-!sto/go!w!m!i![email protected]/pkg/ntlmssp/ntlmssp.go:114 +0x9c5
github.com/niudaii/zpscan/pkg/crack/plugins/wmiexec.(*wmiExecer).Auth(0xc000973b30)
/home/runner/work/zpscan/zpscan/pkg/crack/plugins/wmiexec/wmiexec.go:264 +0x64a
github.com/niudaii/zpscan/pkg/crack/plugins/wmiexec.WMIExec({0xc000faae70, 0xd}, {0xc0000a8110, 0xd}, {0xc0006d5ea8, 0x8}, {0x0, 0x0}, {0x0, 0x0}, ...)
/home/runner/work/zpscan/zpscan/pkg/crack/plugins/wmiexec/wmiexec.go:790 +0x39b
github.com/niudaii/zpscan/pkg/crack/plugins.WmiCrack(0xc000bb1040)
/home/runner/work/zpscan/zpscan/pkg/crack/plugins/wmi.go:11 +0xb1
github.com/niudaii/zpscan/pkg/crack.(*Runner).Crack.func1()
/home/runner/work/zpscan/zpscan/pkg/crack/runner.go:118 +0x43b
created by github.com/niudaii/zpscan/pkg/crack.(*Runner).Crack
/home/runner/work/zpscan/zpscan/pkg/crack/runner.go:106 +0x5e5

    被扫描目标windows 7
    线程 20

当前测试环境win 10

target形式和-m参数冲突,导致产生歧义

代码片段位于:zpscan/pkg/crack/parse.go的 ParseTargets函数中
image

parse.go文件的第16行,tmp = strings.Split(tmp[1], "|")

tmp参数原本来自于对target参数的分割,tmp[0]是ip,tmp[1]是端口。但这里对tmp[1]又用 '|'进行了分割,并且把分割后的值覆盖了原来的tmp,导致下面对tmp的判断永远不可能==2。所以如果target的形式是x.x.x.x:2022这种非标端口,走到这一步后,len(tmp)==2这个判断永远不成立。只能走else分支,但是在预置端口-服务对应关系列表中找不到2022端口,此时及时制定了-m为ssh,也会提示目标为空

下图是证明,都是爆破ssh服务,非标端口时无法正常运行
image

从作者代码看,|应该是为了支持 x.x.x.x:2022|ssh这种形式。不过这里既然有-m参数,建议能够把-m参数和 ip:port|servername这两种形式合并下。比较容易歧义

执行出错

image
输出:.txt","CommonFile":"resource/dirscan/common.txt","DirMap":null},"Pocscan":{"GobyPocDir":"resource/pocscan/goby","XrayPocDir":"resource/pocscan/xray","NucleiPocDir":"resource/pocscan/nuclei","GobyPocs":null,"XrayPocs":null,"NucleiPocs":null},"Expscan":{"NucleiExpDir":"resource/pocscan/nuclei","NucleiExps":null}}
[DBG] expscanOptions: {"Timeout":10,"Proxy":"","Headers":[],"Payload":"whoami"}
[INF] nucleiExps: 0
[INF] 开始exp扫描: http://192.168.168.65:5432
[INF] pocName: CVE-2019-9193
[ERR] load 0 nuclei exps
[INF] 不存在漏洞
[INF] 运行时间: 40.28798ms
,192.168.168.65:5432是个postgres,CVE-2019-9193是postgres中的某个漏洞,为什么一直打印的[ERR] load 0 nuclei exps,明明文件存在的,但还是加载不到,请问大神,如何处理

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.