Subdosec
サブドメインテイクオーバースキャナー&偵察ツール。

インストール • 使用法 • Web版 • 貢献 • オンラインスキャン • 謝辞
Subdosecは、誤検出のない高速で正確なサブドメインテイクオーバースキャナーです。脆弱なサブドメインの公開データベースと、偵察のための詳細な非脆弱性メタデータ(IP、CNAME、タイトル、ステータスコード)を備えています。
subdosecのインストールまたはアップグレード
pipx install git+https://github.com/xcapri/subdosec.git
pipx upgrade subdosec
次に、新しいターミナルセッションを開始するたびにこれを実行します(「サーバーが正常に起動しました」と表示されるまで)。
$ subdosec -ins
Starting Node.js server...
Node.js server started successfully.
[警告] test.txt内のすべてのサブドメインをテイクオーバーしないでください。 これはデモ用に誰でも使用できるようにしておいてください。
[情報] リリースセクションもご確認ください。 興味深い情報が見つかるかもしれません。
$ subdosec -h
_____ __ __
/ ___/__ __/ /_ ____/ /___ ________ _____
\__ \/ / / / __ \/ __ / __ \/ ___/ _ \/ ___/
___/ / /_/ / /_/ / /_/ / /_/ (__ ) __/ /__
/____/\__,_/_.___/\__,_/\____/____/\___/\___/
usage: subdosec [-h] [-mode {private,public}] [-initkey INITKEY] [-vo] [-pe] [-ins] [-pf PF] [-subfng SUBFNG] [-lf LF] [-sfid] [-ks] [-o O] [-su] [-lu LU] [-lm] [-uf] [-unai UNAI] [-v] [-t THREADS]
Subdomain takeover scanner.
options:
-h, --help show this help message and exit
-mode {private,public}
Mode of operation (private/public)
-initkey INITKEY Initialize the API key
-vo VULN Only: Hide UNDETECT messages
-pe Print Error: When there are problems detecting your target
-ins Prepar node & start server
-pf PF Private Fingerprint: uses your local fingerprint. Example: -pf /path/to/tko.json
-subfng SUBFNG Submit fingerprint: submit local fingerprint to admin. Example: -subfng localfinger.json
-lf LF Fingerprint lock: to focus on one or multiple fingerprints. (-lf github.io,surge.sh) and leave this arg to scan all fingerprints
-sfid To view all available fingerprint ids.
-ks To shut down the server node if you want to not use subdosec for a long time.
-o O Save result locally to the specified path. Example: -o /path/to/dir
-su Skip undetect will not stored to server (https://subdosec.vulnshot.com/result/undetected)
-lu LU Undetec stored localy to the specified path. Example: -lu /path/to/dir
-lm Local Mode: Save vuln and undetect to default inside tools directory (auto -su)
-uf Update Fingerprint
-unai UNAI Analyze undetected subdomains using AI. Example: -unai /path/to/undetect.json
-v, --verbose Show progress count (e.g. [1/10])
-t THREADS, --threads THREADS
Number of threads to use for scanning (default: 10)
リストの準備
プロトコルなしでも対応
cat list
https://careers.rotacloud.com
http://creators.thinkorion.com
https://docs.polygon-nightfall.technology
a.anchorsawaytpt.com
help.oceges.com
CMD 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]
VULN DIRECTORY : /home/alice/.subdosec/vulns
UNDETECT FILE : /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": "No title found",
"status_code": 404,
"redirect_url": "No redirects",
"cname_records": [
"cname.redacted.com"
],
"a_records": [
"76.76.21.98",
"76.76.21.241"
],
"subdomain": "try.redacted.com",
"rootdomain": "redacted.com"
},
{
"title": "No title found",
"status_code": 200,
"redirect_url": "No redirects",
"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
[INFO] 完全未検出 0 | サブドメインはsubdosecスキャンを通過したにもかかわらず、脆弱として検出されませんでした。
[INFO] 2バッチで8項目を分析中。
[INFO] 進捗: 5/8 データが分析されました。
新たな可能性 :
ドメイン : try.redacted.com
CNAME : cname.redacted-service.com
A Record : 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 Record : 216.150.16.129, 216.150.1.129
テイクオーバー : 可能
理由 : サービスはカスタムドメイン設定に静的なCNAME(cname.fermat.shop)を使用しています。Fermatのカスタムドメイン設定に関する公開ドキュメントでは、ドメイン所有権のためのTXTレコードや動的な確認方法が明確に規定されていません。そのような確認がない場合、対応するFermatアカウントが削除されるかリンクが解除されると、静的なCNAMEによりサブドメインが脆弱になる可能性があります。
参照: https://fermat.shop/
================================================================================
CMD 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]
VULN DIRECTORY : /home/alice/.subdosec/vulns
UNDETECT FILE : /home/alice/.subdosec/undetect/undetect.json
CMD 3
(結果をnotifyに転送)
cat list | subdosec -lm -vo | notify -silent
https://careers.rotacloud.com [100.00%] [gohire.io] [VULN] [SAVED]
CMD 4
プライベートフィンガープリントを使用します。このフラグは公開フィンガープリントとプライベートフィンガープリントを自動的にマージします
cat priv8.json
{
"fingerprints": [
{
"fid": 0,
"name": "Subdomain takeover - Pagedeck",
"rules": {
"cname": "cname.pagedeck.com",
"status_code": "404",
"in_body":"This page could not be found."
},
"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"
},
add more
]}
echo try.hugsleep.com | subdosec -pf privfinger.json -o testpriv -lu okgaslu
_____ __ __
/ ___/__ __/ /_ ____/ /___ ________ _____
\__ \/ / / / __ \/ __ / __ \/ ___/ _ \/ ___/
___/ / /_/ /_/ / /_/ / /_/ (__ ) __/ /__
/____/\__,_/_.___/\__,_/\____/____/\___/\___/
https://try.hugsleep.com [pagedeck.com] [VULN] [SAVED]
VULN DIRECTORY : /home/pd/tko/testpriv
UNDETECT FILE : /home/pd/tko/okgaslu/undetect.json
subdosec Webの機能を知ることで、ここでhttps://subdosec.vulnshot.com/result/undetected機能を偵察として使用し、IP、CNAME、TITLE、STATUS CODEなどを追加情報として確認したり、新しいテイクオーバーサブドメインを見つけたりできます。
これはundetect.jsonと同じ機能を持ちますが、違いはあなたと他の人々が互いに共有する点です。
例えば、キーワード404でsubdosecによって脆弱として検出されないサイトを検索すると、cname.gohire.ioとタイトルGoHireの情報があります。これをGoogleで検索しても、gohireサービスのサブドメインテイクオーバーに関する記事情報は見つかりません。

新しいサブドメインテイクオーバーを手動または自動(-unaiを使用)で見つけた後、subdosec -subfngコマンドを使用してデータを提出できます。
動的に、ルールには次の要素を使用できます:
title, cname, status_code, in_body, a_record, redirect
cat newvuln.json
{
"name": "Subdomain takeover - GoHire",
"rules": {
"cname": "custom.gohire.io",
"in_body": "Page not found",
"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
[Info] Submitting fingerprint ...
Imported fingerprint data successfully
セキュリティのバックグラウンドがない方、例えばWeb開発者やプログラマーでCLIツールに詳しくない場合、Web版を使用して、1回のスキャンで最大10個のサブドメインをスキャンできます。

subdosecツールの作成に影響を与えた先駆的なツール
subdosec は MITライセンス の下で配布されています