Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
sub.Monitor — 自托管的被动子域持续监控工具。 | Kitploit
工具/GitHubGitHub/e1abrador/sub.monitor
侦察信息收集子域名枚举
GitHube1abrador/sub.monitor

sub.Monitor

自托管的被动子域持续监控工具。

查看仓库
172202年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

sub.Monitor

root@kitploit:~

   快速且用户友好的子域名监控工具,用于持续的攻击面管理。

image

为什么?

为什么选择 sub.Monitor?该程序设置简单,因为它利用 SQLite 存储所有已识别域名(无需预先进行数据库管理)。此外,它还具有高度可定制性,用户只需使用所选的工具向脚本中添加几行代码即可。与依赖 MySQL 或 MongoDB 等数据库的其他现有解决方案相比,初始化脚本可能变得繁琐。

特性

  • 快速
  • 易于使用
  • 易于安装
  • 易于定制
  • 持续将子域名保存到本地数据库(并可选择全部导出)
  • Telegram/Slack/Discord 通知

帮助菜单

sub.Monitor 参数:

root@kitploit:~
选项:
  --add ADD             要扫描的域名
  --out-scope OUT_SCOPE
                        超出范围的域名文件
  --file FILE           已知子域名文件
  -D DOMAIN, --domain DOMAIN
                        要扫描的域名
  -H HOURS, --hours HOURS
                        每次扫描间隔的小时数
  --dump                导出指定域名的所有子域名
  --list                列出数据库中所有根域名
  -df DF                要扫描的域名列表文件
  --inscope             仅导出范围内的子域名
  --notinscope          仅导出范围外的子域名
  --dumpall             导出所有子域名及其详细信息
  --info                显示子域名的发现日期
  -help, -?             显示此帮助信息并退出

预先需要的配置

你需要在 config.ini 文件中写入配置(API)路径文件。

  • Subfinder API 配置文件。
  • Amass API 配置文件。
  • Notify API 配置文件。
  • 你需要在 sub.monitor-config.ini 文件中指定二进制文件和配置路径。
  • 最后,执行 pip3 install -r requirements.txt

你可以轻松地在脚本中实现你自己的工具,只需修改以下代码行:

root@kitploit:~
def run_tool(tool, domain, output_file):
    print(f'[{datetime.datetime.now()}] - Running {tool} on {domain}')
    if tool == 'assetfinder':
        assetfinder_binary = config.get('Binary paths', 'assetfinder')
        cmd = f'echo {domain} | {assetfinder_binary} -subs-only | grep -E "{domain}$" |grep -v "*" | grep -v "@"'
    elif tool == 'subfinder':
        subfinder_binary = config.get('Binary paths', 'subfinder')
        subfinder_api = config.get('Api', 'subfinder_api')
        cmd = f'{subfinder_binary} -d {domain} -silent -pc {subfinder_api} -all'
    elif tool == 'amass':
        amass_binary = config.get('Binary paths', 'amass')
        amass_api = config.get('Api', 'amass_api')
        cmd = f'{amass_binary} enum -passive -norecursive -noalts -d {domain} -config {amass_api}'
    elif tool == 'my-custom-tool':
        my-custom-tool-binary = config.get('Binary paths', 'my-custom-tool-binary-or-script')
        cmd = f'{my-custom-tool-binary} -d {domain}'

需要注意的是,如果你添加了任何自定义工具,其最终输出必须是域名结果,以便 sub.Monitor 将其保存到数据库中。例如,使用方式如下:

root@kitploit:~
cmd = f'bash customtool.sh {domain}''
...
cat customtool.sh
mycustomtool -d $1 > /tmp/$1.txt &>/dev/null; cat /tmp/$1.txt | unfurl domains | anew; rm -r /tmp/$1.txt

同时,在这里添加你的工具名称:

root@kitploit:~
                for tool in ['subfinder', 'amass', 'assetfinder', 'my-custom-tool-name']:
                    run_tool(tool, domain, output_file)

最后,当然你还需要在 sub.monitor-config.ini 文件中添加该工具,以便 Python 脚本能够从该配置文件中获取二进制文件。

唯一需要的是,命令执行完毕后,其输出必须显示所有发现的域名,以便工具能将它们保存到日志文件和数据库中。

工作计划

首先,sub.Monitor 需要一个已经扫描过的域名列表:

root@kitploit:~
➜  cat ibm_sorted_subdomains.txt
test1.ibm.com
test2.ibm.com
test3.ibm.com
subtest.testX.ibm.com
...

现在,包含子域名的文件可以通过以下命令传递给 sub.Monitor:

root@kitploit:~
python3 monitor.py --add ibm.com --file ibm_sorted_subdomains.txt
          _    ___  ___            _ _
          | |   |  \/  |           (_) |
 ___ _   _| |__ | .  . | ___  _ __  _| |_ ___  _ __
/ __| | | | '_ \| |\/| |/ _ \| '_ \| | __/ _ \| '__|
\__ \ |_| | |_) | |  | | (_) | | | | | || (_) | |
|___/\__,_|_.__/\_|  |_/\___/|_| |_|_|\__\___/|_|

                    github.com/e1abrador/sub.Monitor

[2023-06-06 18:16:26.002521] - 已将 538 个子域名添加到本地数据库。

此外,还可以添加一个超出范围的标志。例如,假设某个漏洞赏金计划有以下规则:

root@kitploit:~
*.ibm.com - 在范围内
super-admin.ibm.com - 超出范围
*.super-admin.ibm.com - 超出范围

可以创建一个包含这些内容的文件:

root@kitploit:~
cat outscope.txt
super-admin.ibm.com
*.super-admin.ibm.com

现在,你可以手动将所有发现的域名添加到数据库中(过滤出在范围内的):

root@kitploit:~
python3 monitor.py --add ibm.com --file ibm_sorted_subdomains.txt --out-scope outscope.txt
          _    ___  ___            _ _
          | |   |  \/  |           (_) |
 ___ _   _| |__ | .  . | ___  _ __  _| |_ ___  _ __
/ __| | | | '_ \| |\/| |/ _ \| '_ \| | __/ _ \| '__|
\__ \ |_| | |_) | |  | | (_) | | | | | || (_) | |
|___/\__,_|_.__/\_|  |_/\___/|_| |_|_|\__\___/|_|

                    github.com/e1abrador/sub.Monitor

[2023-06-06 18:16:26.002521] - 已将 538 个子域名添加到本地数据库。

这会将所有子域名添加到数据库,但会将超出范围的域名标记为 [Out of scope](我们将在导出域名部分看到如何从数据库中筛选在范围内的域名)。

要确认域名已添加到数据库,请执行:

root@kitploit:~
python3 monitor.py --list
          _    ___  ___            _ _
          | |   |  \/  |           (_) |
 ___ _   _| |__ | .  . | ___  _ __  _| |_ ___  _ __
/ __| | | | '_ \| |\/| |/ _ \| '_ \| | __/ _ \| '__|
\__ \ |_| | |_) | |  | | (_) | | | | | || (_) | |
|___/\__,_|_.__/\_|  |_/\___/|_| |_|_|\__\___/|_|

                    github.com/e1abrador/sub.Monitor

ibm.com [手动添加了9个子域名] [发现了2个子域名] [数据库中总计11个唯一域名]

一旦加载正确,就可以开始监控过程。建议在 VPS 上使用 TMUX,并让其长时间运行。通过以下命令,脚本将运行子域名枚举工具,并将新结果与旧结果进行比较。如果发现任何新子域名,sub.Monitor 会先将其添加到本地数据库(这样就不会再对该发现进行通知),然后通过 Slack/Telegram/Discord 通知用户。

root@kitploit:~
python3 monitor.py -D ibm.com -H 12 --out-scope outscope.txt

如果发现任何子域名,sub.Monitor 会在输出中显示以下消息:

root@kitploit:~
➜ python3 monitor.py -D ibm.com -H 8 # 要筛选当前范围内(排除范围外)的子域名,可以使用:
                                      # python3 monitor.py -D ibm.com -H 8 --out-scope outscope.txt

          _    ___  ___            _ _
          | |   |  \/  |           (_) |
 ___ _   _| |__ | .  . | ___  _ __  _| |_ ___  _ __
/ __| | | | '_ \| |\/| |/ _ \| '_ \| | __/ _ \| '__|
\__ \ |_| | |_) | |  | | (_) | | | | | || (_) | |
|___/\__,_|_.__/\_|  |_/\___/|_| |_|_|\__\___/|_|

                    github.com/e1abrador/sub.Monitor

[2023-06-06 18:07:25.191169] - 发现新子域名 xxxx.ibm.com
[2023-06-06 18:07:25.353156] - 发现新子域名 xyxyxyxyxyx.ibm.com
[2023-06-06 18:07:25.641082] - 发现新子域名 x1.xxxx.ibm.com

也可以监控多个域名,使用以下命令:

root@kitploit:~
python3 monitor.py -df root-domains.txt -H 8
python3 monitor.py -df roots.txt -H 8 --out-scope outscope.txt

在报告这些消息的同时,用户也会在 Telegram 上收到通知

image

我如何管理通知?我发现了一种非常简单(且易于管理)的方式,可以在 Discord 上查看所有新发现的域名。如下所示(模糊处理,因为都是私有项目):

image

思路是首先根据项目名称创建一个分类:

> Yahoo

--- yahoo.com

--- yahoo.net

--- 等等 ...

> IBM

--- ibm.com

--- whateverdomain.com

--- 等等 ...

这是我的 notify 配置文件样子:

image

我建议为每个域名都这样做(设置起来可能相当繁琐,但这是管理结果的好方法)。monitor.py 脚本会根据 ID(必须与要扫描的域名相同)将结果发送到给定的 webhook。

假设脚本已经运行了两个月,你想要获取所有结果(旧子域名和新发现的子域名)。使用 sub.Monitor 可以,通过 --dump 标志:

root@kitploit:~
python3 monitor.py -D ibm.com --dump

          _    ___  ___            _ _
          | |   |  \/  |           (_) |
 ___ _   _| |__ | .  . | ___  _ __  _| |_ ___  _ __
/ __| | | | '_ \| |\/| |/ _ \| '_ \| | __/ _ \| '__|
\__ \ |_| | |_) | |  | | (_) | | | | | || (_) | |
|___/\__,_|_.__/\_|  |_/\___/|_| |_|_|\__\___/|_|

                    github.com/e1abrador/sub.Monitor

ibm.com 的子域名:
subdomain1.ibm.com
subdomain2.ibm.com
...

你也可以使用以下命令查看域名被发现的具体日期:

root@kitploit:~
python3 monitor.py -D ibm.com --dump --info

          _    ___  ___            _ _
          | |   |  \/  |           (_) |
 ___ _   _| |__ | .  . | ___  _ __  _| |_ ___  _ __
/ __| | | | '_ \| |\/| |/ _ \| '_ \| | __/ _ \| '__|
\__ \ |_| | |_) | |  | | (_) | | | | | || (_) | |
|___/\__,_|_.__/\_|  |_/\___/|_| |_|_|\__\___/|_|

                    github.com/e1abrador/sub.Monitor

ibm.com 的子域名:
test.ibm.com [发现于 06/08/2023]
test2.ibm.com [发现于 08/08/2023] [超出范围]

由于某些域名很可能被标记为超出范围,使用 python3 monitor.py -d ibm.com --dump --info 命令时,要仅显示范围内的域名,可以使用 --inscope 标志:

root@kitploit:~
python3 monitor.py -D ibm.com --dump --info --inscope

          _    ___  ___            _ _
          | |   |  \/  |           (_) |
 ___ _   _| |__ | .  . | ___  _ __  _| |_ ___  _ __
/ __| | | | '_ \| |\/| |/ _ \| '_ \| | __/ _ \| '__|
\__ \ |_| | |_) | |  | | (_) | | | | | || (_) | |
|___/\__,_|_.__/\_|  |_/\___/|_| |_|_|\__\___/|_|

                    github.com/e1abrador/sub.Monitor

ibm.com 的子域名:
test.ibm.com [发现于 06/08/2023]
test3.ibm.com [发现于 08/08/2023]

致谢

感谢:

  • Projectdiscovery 创建了 subfinder 和 notify!
  • 感谢 OWASP 的精彩项目 amass!
  • Tomnomnom 创建了 assetfinder!

待办事项

  • 实现监控多个子域名。 [已完成]
  • 持续读取域名文件,以便在不停止程序的情况下扫描新域名。 [已完成]
  • 实现超出范围过滤 [已完成]

如果你有任何新功能的想法,请在 https://github.com/e1abrador/sub.Monitor/pulls 开启一个 PR。

祝你好运,狩猎愉快! 如果你真的喜欢这个工具(或其他工具),或者它们帮助你找到了丰厚的赏金,请考虑 请我喝杯咖啡! ☕(我可以用咖啡因提提神!)

⚪ e1abrador

Twitter: https://twitter.com/e1abrador

请在 ko-fi.com 上请我喝杯咖啡

下载工具