Skip to content

Instantly share code, notes, and snippets.

@defulmere
Created February 27, 2020 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save defulmere/cf64d0b0bd0c93e7020f23c2ee665a4d to your computer and use it in GitHub Desktop.
Save defulmere/cf64d0b0bd0c93e7020f23c2ee665a4d to your computer and use it in GitHub Desktop.
Get a list of all cloudflare IPv4 addresses with python
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