大多数云服务提供商都会发布其 IP 地址范围的最新列表。该工具通过获取并解析最新列表,判断某个 IP 是否属于某个提供商的地址范围。
支持:
该工具的灵感来自 Bryce Kunz 所写的 Nimbusland。
推荐的安装方式是使用 pipx:
$ pipx install https://github.com/nccgroup/cloud_ip_ranges
$ cloud_ip_ranges
或者,你可以创建虚拟环境并安装依赖:
$ virtualenv -p python3 venv
$ source venv/bin/activate
$ pip install -r requirements.txt
运行该工具:
$ cloud_ip_ranges -h
usage: cloud_ip_ranges [-h] [-q] ip
positional arguments:
ip The IP to evaluate, e.g.: 8.8.8.8
optional arguments:
-h, --help show this help message and exit
-q, --quiet Suppress logging output
$ cloud_ip_ranges 52.4.0.0
2020-09-18 17:38:42 host __main__[21549] INFO Starting
2020-09-18 17:38:42 host __main__[21549] INFO Checking for AWS
2020-09-18 17:38:43 host __main__[21549] INFO Match for AWS range "52.4.0.0/14", region "us-east-1" and service "AMAZON"
2020-09-18 17:38:43 host __main__[21549] INFO Match for AWS range "52.4.0.0/14", region "us-east-1" and service "EC2"
2020-09-18 17:38:43 host __main__[21549] INFO Checking for Azure
2020-09-18 17:38:44 host __main__[21549] INFO Checking for GCP
2020-09-18 17:38:44 host __main__[21549] INFO Checking for OCI
2020-09-18 17:38:44 host __main__[21549] INFO Done