This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
import ipaddr | |
# Get the AWS IP address ranges https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html | |
ip_ranges = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json').json()['prefixes'] | |
# Get the CIDR to check from from the user | |
cidrtocheck = input("Enter your CIDR to check... ") | |
range = ipaddr.IPNetwork(cidrtocheck) # Turn it into IP Network Class |
OlderNewer