Subdosec
子域名接管扫描与侦查工具。

安装 • 使用 • 网页版 • 贡献 • 在线扫描 • 致谢
Subdosec 是一个快速、准确的子域名接管扫描器,零误报,拥有公开的易受攻击子域名数据库,并提供详细的非易受攻击元数据(IP、CNAME、标题和状态码)用于侦查。
安装或升级 subdosec
pipx install git+https://github.com/xcapri/subdosec.git
pipx upgrade subdosec
然后每次启动新终端会话时运行以下命令(直到显示“服务器启动成功”)。
$ subdosec -ins
正在启动 Node.js 服务器...
Node.js 服务器启动成功。
[警告] 不要接管 test.txt 中的所有子域名, 让每个人都用那个来演示。
[信息] 同时查看 发布 页面。 你可以找到有趣的信息。
$ subdosec -h
_____ __ __
/ ___/__ __/ /_ ____/ /___ ________ _____
\__ \/ / / / __ \/ __ / __ \/ ___/ _ \/ ___/
___/ / /_/ / /_/ / /_/ / /_/ (__ ) __/ /__
/____/\__,_/_.___/\__,_/\____/____/\___/\___/
用法: subdosec [-h] [-mode {private,public}] [-initkey INITKEY] [-vo] [-pe] [-ins] [-pf PF] [-subfng SUBFNG] [-lf LF] [-o O] [-su] [-lu LU] [-lm] [-uf] [-unai UNAI] [-v] [-t THREADS]
子域名接管扫描器。
选项:
-h, --help 显示此帮助信息并退出
-mode {private,public}
操作模式(private/public)
-initkey INITKEY 初始化 API 密钥
-vo 仅显示漏洞:隐藏 UNDETECT 消息
-pe 打印错误:检测目标出现问题时显示
-ins 准备节点并启动服务器
-pf PF 私有指纹:使用本地指纹。示例:-pf /path/to/tko.json
-subfng SUBFNG 提交指纹:将本地指纹提交给管理员。示例:-subfng localfinger.json
-lf LF 指纹锁定:专注于一个或多个指纹。(-lf github.io,surge.sh) 留空则扫描所有指纹
-sfid 查看所有可用的指纹 ID
-ks 如果你想长时间不使用 subdosec,关闭服务器节点
-o O 将结果保存到指定路径。示例:-o /path/to/dir
-su 跳过未检测结果,不存储到服务器(https://subdosec.vulnshot.com/result/undetected)
-lu LU 将未检测结果本地存储到指定路径。示例:-lu /path/to/dir
-lm 本地模式:将漏洞和未检测结果保存到工具目录下的默认位置(自动启用 -su)
-uf 更新指纹
-unai UNAI 使用 AI 分析未检测到的子域名。示例:-unai /path/to/undetect.json
-v, --verbose 显示进度计数(例如 [1/10])
-t THREADS, --threads THREADS
用于扫描的线程数(默认:10)
准备列表
支持无协议
cat 列表
https://careers.rotacloud.com
http://creators.thinkorion.com
https://docs.polygon-nightfall.technology
a.anchorsawaytpt.com
help.oceges.com
命令 1
跳过将未检测结果存储到服务器并保存到本地
cat test.txt | subdosec -lm
https://subdosec.vulnshot.com [UNDETECT]
http://feedback.bazoom.com [sleekplan.com] [VULN] [SAVED]
http://demodev.destinojet.co [meteor.com] [VULN] [SAVED]
http://creators.thinkorion.com [UNDETECT]
https://www.www.savillerow.status.lnt.cl [ohdear.app] [VULN] [SAVED]
https://careers.rotacloud.com [gohire.io] [VULN] [SAVED]
https://careers.rotacloud.com [gohire.io] [VULN] [SAVED]
https://ai.yooture.com [UNDETECT]
https://help.oceges.com [UNDETECT]
http://ftp.thiagolima.com [surge.sh] [VULN] [SAVED]
漏洞目录 : /home/alice/.subdosec/vulns
未检测文件 : /home/alice/.subdosec/undetect/undetect.json
查看输出
~$ ls /home/alice/.subdosec/vulns
gohire.io_tko.txt meteor.com_tko.txt ohdear.app_tko.txt sleekplan.com_tko.txt surge.sh_tko.txt
~$ cat /home/alice/.subdosec/vulns/gohire.io_tko.txt
careers.rotacloud.com
查看未检测结果,并使用 -unai 自动分析新的潜在漏洞
cat /home/alice/.subdosec/undetect/undetect.json
[
{
"title": "未找到标题",
"status_code": 404,
"redirect_url": "无重定向",
"cname_records": [
"cname.redacted.com"
],
"a_records": [
"76.76.21.98",
"76.76.21.241"
],
"subdomain": "try.redacted.com",
"rootdomain": "redacted.com"
},
{
"title": "未找到标题",
"status_code": 200,
"redirect_url": "无重定向",
"cname_records": [
"cname.fermat.shop"
],
"a_records": [
"216.150.16.129",
"216.150.1.129"
],
"subdomain": "get.redacted.com",
"rootdomain": "redacted.com"
}
]
subdosec -unai /home/pd/.subdosec/undetect/undetect.json
[信息] 纯未检测 0 | 子域名即使通过了 subdosec 扫描也未被检测为易受攻击。
[信息] 正在分析 8 个项目,分 2 批。
[信息] 进度:5/8 数据已分析。
新潜在漏洞:
域名 : try.redacted.com
CNAME : cname.redacted-service.com
A 记录 : 76.76.21.98, 76.76.21.241
接管状态 : 否
原因 : redacted-service 自定义域名设置指南明确要求添加 TXT 记录(例如 'redacted-service-verification=<your_site_id>')以验证域名所有权。存在 TXT 记录验证步骤使其不易受攻击。
参考 : https://www.redacted-service.com/blog/how-to-setup-custom-domain/
================================================================================
域名 : get.redacted.com
CNAME : cname.fermat.shop
A 记录 : 216.150.16.129, 216.150.1.129
接管状态 : 可能
原因 : 该服务使用静态 CNAME (cname.fermat.shop) 进行自定义域名设置。Fermat 自定义域名设置的公开文档未明确要求 TXT 记录或任何动态验证域名所有权的方法。如果没有此类验证,则当相应的 Fermat 账户被删除或解除关联时,静态 CNAME 可能使子域名易受攻击。
参考 : https://fermat.shop/
================================================================================
命令 2
使用根域名和管道子域名查找工具(如 subfinder、assetfinder、amass 等)
cat list
example.com
cat list | subfinder -silent | subdosec -lm
https://subdosec.vulnshot.com [UNDETECT]
http://feedback.bazoom.com [sleekplan.com] [VULN] [SAVED]
http://demodev.destinojet.co [meteor.com] [VULN] [SAVED]
http://creators.thinkorion.com [UNDETECT]
https://www.www.savillerow.status.lnt.cl [ohdear.app] [VULN] [SAVED]
https://careers.rotacloud.com [gohire.io] [VULN] [SAVED]
https://careers.rotacloud.com [gohire.io] [VULN] [SAVED]
https://ai.yooture.com [UNDETECT]
https://help.oceges.com [UNDETECT]
http://ftp.thiagolima.com [surge.sh] [VULN] [SAVED]
漏洞目录 : /home/alice/.subdosec/vulns
未检测文件 : /home/alice/.subdosec/undetect/undetect.json
命令 3
(将结果转发到通知工具)
cat list | subdosec -lm -vo | notify -silent
https://careers.rotacloud.com [100.00%] [gohire.io] [VULN] [SAVED]
命令 4
使用私有指纹,此标志将自动合并公共指纹和私有指纹
cat priv8.json
{
"fingerprints": [
{
"fid": 0,
"name": "子域名接管 - Pagedeck",
"rules": {
"cname": "cname.pagedeck.com",
"status_code": "404",
"in_body":"此页面未找到。"
},
"status_fingerprint": 0,
"reference": "https://docs.pagedeck.com/getting-started/connecting-a-subdomain",
"service": "pagedeck.com",
"logo_service": "https://i.ytimg.com/vi/DY76Tjf1m-8/maxresdefault.jpg"
},
添加更多
]}
echo try.hugsleep.com | subdosec -pf privfinger.json -o testpriv -lu okgaslu
_____ __ __
/ ___/__ __/ /_ ____/ /___ ________ _____
\__ \/ / / / __ \/ __ / __ \/ ___/ _ \/ ___/
___/ / /_/ / /_/ / /_/ / /_/ /_/ (__ ) __/ /__
/____/\__,_/_.___/\__,_/\____/____/\___/\___/
https://try.hugsleep.com [pagedeck.com] [VULN] [SAVED]
漏洞目录 : /home/pd/tko/testpriv
未检测文件 : /home/pd/tko/okgaslu/undetect.json
了解 subdosec 网页的功能,你可以使用 https://subdosec.vulnshot.com/result/undetected 功能进行侦查,获取 IP、CNAME、标题、状态码等信息,作为进一步的信息,甚至发现新的接管子域名。
它与 undetect.json 功能相同,区别在于你和其他人可以共享。
例如,你搜索一个未被 subdosec 检测为易受攻击的站点,使用关键词 404,并且有关于 cname.gohire.io 的信息,标题为 GoHire,如果你在谷歌上搜索,没有关于 gohire 服务子域名接管的文章信息。

当你发现新的子域名接管(无论是手动还是自动使用 -unai)时,你可以使用 subdosec -subfng 命令将数据提交给我们。
你可以动态使用以下元素作为规则:
title, cname, status_code, in_body, a_record, redirect
cat newvuln.json
{
"name": "子域名接管 - GoHire",
"rules": {
"cname": "custom.gohire.io",
"in_body": "页面未找到",
"status_code": "404"
},
"status_fingerprint": 0,
"reference": "https://help.gohire.io/en/articles/3385288-setting-up-a-custom-domain",
"service": "gohire.io",
"logo_service": "https://gohire-website.s3.amazonaws.com/img/logos/gh-logo-main.gif"
}
subdosec -subfng newvuln.json
[信息] 正在提交指纹 ...
指纹数据导入成功
如果你没有安全背景,可能是一个网页开发者/程序员,不熟悉 CLI 工具。你可以使用网页版扫描所有子域名,每次扫描最多 10 个子域名。

启发创建 subdosec 工具的前身工具。
subdosec 根据 MIT 许可证 分发