MCPcopy
hub / github.com/0x727/ShuiZe_0x727

github.com/0x727/ShuiZe_0x727 @v1.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.0 ↗
1,056 symbols 3,279 edges 198 files 60 documented · 6%
README

水泽-信息收集自动化工具

郑重声明:文中所涉及的技术、思路和工具仅供以安全为目的的学习交流使用,任何人不得将其用于非法用途以及盈利等目的,否则后果自行承担。

0x01 介绍

作者:Ske

团队:0x727,未来一段时间将陆续开源工具,地址:https://github.com/0x727

定位:协助红队人员快速的信息收集,测绘目标资产,寻找薄弱点

语言:python3开发

功能:一条龙服务,只需要输入根域名即可全方位收集相关资产,并检测漏洞。也可以输入多个域名、C段IP等,具体案例见下文。

调用:脚本借用了ksubdomain爆破子域名和theHarvester收集邮箱,感谢ksubdomain和theHarvester作者

0x02 安装

为了避免踩坑,建议安装在如下环境中

  • 当前用户对该目录有写权限,不然扫描结果无法生成。root权限即可
  • Python环境必须是3.7以上,因为使用了异步。建议VPS环境是ubuntu20,默认是python3.8

  • 在配置文件iniFile/config.ini里加入api(fofa、shodan、github、virustotal)

chmod 777 build.sh
./build.sh

image-20210728153419131

python3 ShuiZe.py -h

image-20210728154929084

0x03 效果展示

备案反查顶级域名

image-20210728155358378

不是泛解析,调用ksubdomain爆破子域名

image-20210728155541501

theHarvest获取邮箱

image-20210728161507035

image-20210728163216047

第三方数据接口 -> 获取子域名

image-20210728160705706

github -> 从github获取子域名,并把查询结果保存到txt,并匹配关键字获取敏感信息

image-20210728161022348

百度和必应爬虫

image-20210728161117459

证书

image-20210728161711534

子域名友链

image-20210728161339208

解析子域名A记录,检测是否CDN和整理C段的IP

image-20210728162655684

image-20210728162049962

网络空间搜索引擎:Fofa和Shodan

image-20210728162119531

IP反查域名

image-20210728162303312

存活探测

image-20210728162441132

漏洞检测

image-20210728165612314

扫描结果保存在excel文件里

image-20210728170303756

excel的内容如下

备案反查顶级域名

image-20210728163926763

image-20210728163940918

邮箱

image-20210728164010063

Github敏感信息

image-20210728164040649

爬虫

image-20210728164146630

证书

image-20210728164211552

子域名A记录和CDN

image-20210728164316747

动态链接和后台地址

image-20210728164555141

网络空间搜索引擎

image-20210728164745820

ip反查域名

image-20210728164811422

存活网站标题

image-20210728164933353

指纹和漏洞

image-20210728165004202

相关域名和C段

image-20210728165052361

0x04 POC编写

POC的模板文件例子:Plugins/Vul/Web/__template__.py

只需要在run_detect方法里调用POC的利用方法即可。

0x05 使用方法

语法 功能
python3 ShuiZe.py -d domain.com 收集单一的根域名资产
python3 ShuiZe.py --domainFile domain.txt 批量跑根域名列表
python3 ShuiZe.py -c 192.168.1.0,192.168.2.0,192.168.3.0 收集C段资产
python3 ShuiZe.py -f url.txt 对url里的网站漏洞检测
python3 ShuiZe.py --fofaTitle XXX大学 从fofa里收集标题为XXX大学的资产,然后漏洞检测
python3 ShuiZe.py -d domain.com --justInfoGather 1 仅信息收集,不检测漏洞
python3 ShuiZe.py -d domain.com --ksubdomain 0 不调用ksubdomain爆破子域名

0x06 实现原理

  • 备案反查顶级域名 -> 获取目标域名相关的其他根域名 -> 接口:http://icp.chinaz.com
  • 判断是否是泛解析
  • 泛解析-> 不爆破子域名
  • 不是泛解析 -> 调用ksubdomain爆破子域名(脚本里我用的是linux版本的ksubdomain,文件地址:./Plugins/infoGather/subdomain/ksubdomain/ksubdomain_linux,如果是其他系统请自行替换)
  • 调用theHarvester -> 获取子域名和邮箱列表
  • 第三方数据接口 -> 获取子域名
  • virustotal -> https://www.virustotal.com -> 需要api
  • ce.baidu.com -> http://ce.baidu.com
  • url.fht.im -> https://url.fht.im/
  • qianxun -> https://www.dnsscan.cn/
  • sublist3r -> https://api.sublist3r.com
  • crt.sh -> https://crt.sh
  • certspotter -> https://api.certspotter.com
  • bufferover -> http://dns.bufferover.run
  • threatcrowd -> https://threatcrowd.org
  • hackertarget -> https://api.hackertarget.com
  • chaziyu -> https://chaziyu.com/hbu.cn/
  • rapiddns -> https://rapiddns.io
  • sitedossier -> http://www.sitedossier.com
  • ximcx -> http://sbd.ximcx.cn
  • github -> 从github获取子域名,并把查询结果保存到txt-获取敏感信息
  • 敏感信息关键字匹配,可在iniFile/config.ini自定义关键字内容,内置如下关键字('jdbc:', 'password', 'username', 'database', 'smtp', 'vpn', 'pwd', 'passwd', 'connect')
  • 百度和必应爬虫 -> 获取目标后台等地址('inurl:admin', 'inurl:login', 'inurl:system', 'inurl:register', 'inurl:upload', '后台', '系统', '登录')
  • 证书 -> 获取目标关联域名
  • 子域名友链 -> 获取未爆破出的子域名,未被收录的深层域名

image-20210728132752381

整理上面所有的子域名

  • 对所有子域名判断是否是CDN并解析出A记录

  • 统计每个c段出现IP的个数

  • 调用网络空间搜索引擎

  • fofa -> 需要API
  • shodan -> 需要API

  • 前面获得的ip反查域名得到相关资产的子域名,整理出所有的子域名和IP

image-20210728133047590

  • 整理所有资产探测漏洞

  • Web -> 存活探测

    • 获取标题
    • 自动跑后台路径(['admin', 'login', 'system', 'manager', 'admin.jsp', 'login.jsp', 'admin.php', 'login.php','admin.aspx', 'login.aspx', 'admin.asp', 'login.asp'])
    • 如果URL是IP则查询IP的归属地
    • 漏洞检测 -> Plugins/Vul/Web

    image-20210728134051049

    image-20210728134115608

    image-20210728134131076

  • 非Web服务 --> 未授权和弱口令

image-20210728134212279

其他功能

image-20210728134304533

结果展示:

image-20210728132105833

完整流程图:

0x07 新增功能

2021.7.31 增加了Censys接口,需要在iniFile/config.ini的[censys api]中填入API。 功能是获取域名的所有解析IP记录,一是为了Host碰撞,二是更加准确的得到C段IP

需要censys的api,免费的账户一个月只有250次查询,所以后期需要注意,用完了要更新api

2021.7.31 增加了Host碰撞访问内网系统漏洞,感谢小洲提交的建议

2021.8.1 修复了CDN判断的bug,感谢 leveryd 师傅提交的bug。

issues地址:https://github.com/0x727/ShuiZe_0x727/issues/3

2021.8.3 修复了chinazApi接口请求超时太长的bug,设置默认时间10秒,感谢 k0njac 师傅提交的bug。

issues地址:https://github.com/0x727/ShuiZe_0x727/issues/11

0x08 反馈

ShuiZe(水泽) 是一个免费且开源的项目,我们欢迎任何人为其开发和进步贡献力量。

  • 在使用过程中出现任何问题,可以通过 issues 来反馈。
  • Bug 的修复可以直接提交 Pull Request 到 dev 分支。
  • 如果是增加新的功能特性,请先创建一个 issue 并做简单描述以及大致的实现方法,提议被采纳后,就可以创建一个实现新特性的 Pull Request。
  • 欢迎对说明文档做出改善,帮助更多的人使用 ShuiZe。
  • 贡献代码请提交 PR 至 dev 分支,master 分支仅用于发布稳定可用版本。

提醒:和项目相关的问题最好在 issues 中反馈,这样方便其他有类似问题的人可以快速查找解决方法,并且也避免了我们重复回答一些问题。

Core symbols most depended-on inside this repo

start
called by 66
Plugins/infoGather/subdomain/FriendChins/crawlFriendChins.py
fetch_all
called by 35
Plugins/infoGather/subdomain/theHarvester/runTheHarvester/lib/core.py
store
called by 31
Plugins/infoGather/subdomain/theHarvester/runTheHarvester/__main__.py
get_user_agent
called by 27
Plugins/infoGather/subdomain/theHarvester/runTheHarvester/lib/core.py
query
called by 20
Plugins/infoGather/subdomain/theHarvester/runTheHarvester/lib/hostchecker.py
trace
called by 17
Plugins/infoGather/subdomain/Sublist3r/subbrute/subbrute.py
save
called by 17
Plugins/infoGather/subdomain/template/multiThreading.py
unpack
called by 17
Plugins/Vul/CMS/Tomcat_AJP_LFI.py

Shape

Method 706
Function 200
Class 150

Languages

Python100%

Modules by API surface

Plugins/infoGather/subdomain/Sublist3r/sublist3r.py91 symbols
ShuiZe.py50 symbols
Plugins/Vul/CMS/Tomcat_AJP_LFI.py27 symbols
Plugins/infoGather/subdomain/subdomain3/brutedns.py24 symbols
Plugins/infoGather/subdomain/Sublist3r/subbrute/subbrute.py22 symbols
Plugins/infoGather/subdomain/theHarvester/runTheHarvester/lib/core.py19 symbols
Plugins/Vul/Web/weblogic.py19 symbols
Plugins/saveToExcel.py18 symbols
Plugins/infoGather/webInfo/Wappalyzer/Wappalyzer.py17 symbols
Plugins/infoGather/subdomain/othersApiSubdomains/othersApiSubdomains.py17 symbols
Plugins/infoGather/subdomain/theHarvester/runTheHarvester/parsers/myparser.py16 symbols
Plugins/infoGather/subdomain/theHarvester/runTheHarvester/discovery/googlesearch.py14 symbols

Dependencies from manifests, versioned

Click7.0 · 1×
Cython0.29.15 · 1×
FOFA1.0.1 · 1×
Flask1.1.1 · 1×
IPy1.0 · 1×
Jinja22.11.1 · 1×
MarkupSafe1.1.1 · 1×
PyInstaller3.5 · 1×
PyMySQL0.9.3 · 1×
PyNaCl1.3.0 · 1×
PySocks1.7.1 · 1×
PyYAML5.3.1 · 1×

For agents

$ claude mcp add ShuiZe_0x727 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact