hfinder | 借助 Robtex 和 BGP.HE识别IP对应域名
hfinder 简介
hfinder (Hosts Finder)主机查找器。
借助https://bgp.he.net/和https://www.robtex.com/帮助从特定 ASN 或 CIDR 重新识别主机名。
可以根据结果生成过滤后的/etc/hosts文件。
安装方法
你应该有chrome( SergeyPirogov/webdriver_manager#649 ) 或 Google Chrome 预装在您的系统上。
pip install hfinder
或
git clone https://github.com/cosad3s/hfinder.git
sudo pip3 install .
用法
❯ hfinder -h
用法: hfinder [-h] [-c CIDR] [-a ASN] [--hosts] [--fqdn] [--filter FILTER]
从ASN或CIDR中查找主机名 - Robtex x BGP.HE
选项:
-h, --help 显示帮助信息并退出
-c CIDR CIDR(单个或多个,用逗号分隔 - 例如: 192.168.0.0/24 或192.168.0.0/24,192.168.1.0/24)
-a ASN ASN(单个或多个,用逗号分隔 - 例如: AS1234 或 AS1234,AS4561)
--hosts 生成类似于 /etc/hosts 的文件
--fqdn 仅显示找到的完全限定域名(FQDN)
--filter FILTER 使用正则表达式过滤 FQDN(例如: ^.*example\.org$)
使用示例
❯ hfinder -c 207.231.168.0/21
vpn-west.uberinternal.com:207.231.168.144
itelogs.uberinternal.com:207.231.168.148
backup.uberinternal.com:207.231.168.151
backup.uber.com:207.231.168.151
munki.uberinternal.com:207.231.168.155
team.uber.com:207.231.168.160
team.uberinternal.com:207.231.168.160
jds.uberinternal.com:207.231.168.162
jds-staging.uberinternal.com:207.231.168.163
chef.uberinternal.com:207.231.168.172
scout.uberinternal.com:207.231.168.174
tableau.uberinternal.com:207.231.168.202
vpn-east.uberinternal.com:207.231.169.144
prj.usuppliers.uber.com:207.231.169.199
usuppliers.uber.com:207.231.169.200
vpn-west.uberatc.com:207.231.171.36
...
❯ hfinder -a AS26673
vpn-west.uberinternal.com:207.231.168.144
itelogs.uberinternal.com:207.231.168.148
backup.uberinternal.com:207.231.168.151
backup.uber.com:207.231.168.151
munki.uberinternal.com:207.231.168.155
team.uber.com:207.231.168.160
team.uberinternal.com:207.231.168.160
jds.uberinternal.com:207.231.168.162
jds-staging.uberinternal.com:207.231.168.163
chef.uberinternal.com:207.231.168.172
scout.uberinternal.com:207.231.168.174
tableau.uberinternal.com:207.231.168.202
vpn-east.uberinternal.com:207.231.169.144
prj.usuppliers.uber.com:207.231.169.199
usuppliers.uber.com:207.231.169.200
vpn-west.uberatc.com:207.231.171.36
❯ hfinder -a AS26673 --hosts
207.231.168.144 vpn-west.uberinternal.com
207.231.168.148 itelogs.uberinternal.com
207.231.168.151 backup.uberinternal.com backup.uber.com
207.231.168.155 munki.uberinternal.com
207.231.168.160 team.uberinternal.com team.uber.com
207.231.168.162 jds.uberinternal.com
207.231.168.163 jds-staging.uberinternal.com
207.231.168.172 chef.uberinternal.com
207.231.168.174 scout.uberinternal.com
207.231.168.202 tableau.uberinternal.com
207.231.169.144 vpn-east.uberinternal.com
207.231.169.199 prj.usuppliers.uber.com
207.231.169.200 usuppliers.uber.com
207.231.171.36 vpn-west.uberatc.com
❯ hfinder -a AS26673 --hosts --filter "^.*uber.com$"
207.231.168.151 backup.uber.com
207.231.168.160 team.uber.com
207.231.169.199 prj.usuppliers.uber.com
207.231.169.200 usuppliers.uber.com
❯ hfinder -c 207.231.168.0/21 --fqdn
vpn-west.uberinternal.com
itelogs.uberinternal.com
backup.uberinternal.com
backup.uber.com
munki.uberinternal.com
team.uber.com
team.uberinternal.com
jds.uberinternal.com
jds-staging.uberinternal.com
chef.uberinternal.com
scout.uberinternal.com
tableau.uberinternal.com
vpn-east.uberinternal.com
prj.usuppliers.uber.com
usuppliers.uber.com
vpn-west.uberatc.com
❯ hfinder -a AS63948,AS63943,AS63086,AS399759,AS273797,AS26673,AS203351,AS19934,AS147183,AS136114,AS134981,AS134135 --hosts --filter "^(.*\.uber\.com|.*\.uberinternal\.com|.*\.ubereats\.com)$"
43.231.12.135 cn-pek1.uber.com
104.36.192.131 ussh.uberinternal.com bastion-sjc1.uber.com bastion02-sjc1.prod.uber.com
104.36.197.130 ussh.uberinternal.com bastion-geo.uber.com
104.36.195.187 ussh.uberinternal.com
104.36.195.188 ussh.uberinternal.com
104.36.196.133 ussh.uberinternal.com bastion-phx2.prod.uber.com bastion-geo.uber.com
104.36.192.244 ussh.uberinternal.com bastion-sjc1.uber.com bastion01-sjc1.prod.uber.com
104.36.195.186 ussh.uberinternal.com
104.36.197.131 ussh.uberinternal.com bastion-geo.uber.com
104.36.197.230 ussh.uberinternal.com bastion-geo.uber.com
104.36.197.129 ussh.uberinternal.com bastion-geo.uber.com
104.36.196.134 ussh.uberinternal.com bastion-phx2.prod.uber.com bastion-geo.uber.com
# ...
项目地址
GitHub:
https://github.com/cosad3s/hfinder
直链下载地址
https://lp.lmboke.com/hfinder-main.zip
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 程序员小航
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果