Created
February 27, 2020 21:50
-
-
Save defulmere/cf64d0b0bd0c93e7020f23c2ee665a4d to your computer and use it in GitHub Desktop.
Get a list of all cloudflare IPv4 addresses with python
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
import requests | |
from ipaddress import * | |
subnets = requests.get('https://www.cloudflare.com/ips-v4').content.split() | |
for s in subnets: | |
subnet = IPv4Network(s.decode()) | |
for h in subnet.hosts(): | |
print(h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment