Skip to content

A utility to check whether a given IP is associated with a cloud provider

License

Notifications You must be signed in to change notification settings

linux4life798/cloud-ip-lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Services IP Lookup

This tool checked whether the given IP addresses are associated with any known cloud/service providers. It does this by downloading the IP range files from each provider and checking if the IP address given falls within one or more of the listed ranges. Since we are searching the pre-downloaded ranges, the provided IP address are not communicated outside of your machine.

The following providers are supported:

Usage:

lookup.py <lookup_ip_address> [more_lookup_ip_addresses...]

Example 1

./lookup.py 44.242.161.7

Outputs:

44.242.161.7 | AWS | {'ip_prefix': '44.224.0.0/11', 'region': 'us-west-2', 'service': 'AMAZON', 'network_border_group': 'us-west-2'}

44.242.161.7 | AWS | {'ip_prefix': '44.224.0.0/11', 'region': 'us-west-2', 'service': 'EC2', 'network_border_group': 'us-west-2'}

44.242.161.7 | AWS | {'ip_prefix': '44.242.161.6/31', 'region': 'us-west-2', 'service': 'KINESIS_VIDEO_STREAMS', 'network_border_group': 'us-west-2'}

Example 2

Let's try with multiple IP addresses at once.

./lookup.py 44.242.161.7 8.8.8.8 35.231.19.128 2a06:98c1:50::ac40:20b3

Outputs:

44.242.161.7 | AWS | {'ip_prefix': '44.224.0.0/11', 'region': 'us-west-2', 'service': 'AMAZON', 'network_border_group': 'us-west-2'}

44.242.161.7 | AWS | {'ip_prefix': '44.224.0.0/11', 'region': 'us-west-2', 'service': 'EC2', 'network_border_group': 'us-west-2'}

44.242.161.7 | AWS | {'ip_prefix': '44.242.161.6/31', 'region': 'us-west-2', 'service': 'KINESIS_VIDEO_STREAMS', 'network_border_group': 'us-west-2'}

8.8.8.8 | Google Service | {'ipv4Prefix': '8.8.8.0/24'}

35.231.19.128 | Google Service | {'ipv4Prefix': '35.224.0.0/12'}

35.231.19.128 | Google Cloud | {'ipv4Prefix': '35.231.0.0/16', 'service': 'Google Cloud', 'scope': 'us-east1'}

2a06:98c1:50::ac40:20b3 | Cloudflare | 2a06:98c0::/29

Example 3

Let's try to script only the company/product name.

./lookup.py 44.242.161.7 8.8.8.8 35.231.19.128 2a06:98c1:50::ac40:20b3 | cut -d'|' -f2

Outputs:

AWS

AWS

AWS

Google Service

Google Service

Google Cloud

Cloudflare

About

A utility to check whether a given IP is associated with a cloud provider

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages