Added list and tool to generate list for cloudflare IP ranges.
parent
7e240da00c
commit
d22c6902b3
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"list": [
|
||||
"198.41.128.0/17",
|
||||
"131.0.72.0/22",
|
||||
"104.16.0.0/12",
|
||||
"103.21.244.0/22",
|
||||
"197.234.240.0/22",
|
||||
"173.245.48.0/20",
|
||||
"188.114.96.0/20",
|
||||
"108.162.192.0/18",
|
||||
"141.101.64.0/18",
|
||||
"162.158.0.0/15",
|
||||
"2400:cb00::/32",
|
||||
"2803:f800::/32",
|
||||
"103.22.200.0/22",
|
||||
"2a06:98c0::/29",
|
||||
"2c0f:f248::/32",
|
||||
"2405:8100::/32",
|
||||
"2405:b500::/32",
|
||||
"190.93.240.0/20",
|
||||
"2606:4700::/32",
|
||||
"103.31.4.0/22",
|
||||
"172.64.0.0/13"
|
||||
],
|
||||
"type": "cidr",
|
||||
"matching_attributes": [
|
||||
"ip-dst",
|
||||
"ip-src",
|
||||
"domain|ip"
|
||||
],
|
||||
"name": "List of known Cloudflare IP ranges",
|
||||
"version": 20190724,
|
||||
"description": "List of known Cloudflare IP ranges (https://www.cloudflare.com/ips/)"
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import json
|
||||
import os
|
||||
import requests
|
||||
import datetime
|
||||
import io
|
||||
|
||||
base_url="https://www.cloudflare.com/"
|
||||
uri_list=['ips-v4','ips-v6']
|
||||
dict=dict()
|
||||
dict['list']=list()
|
||||
def source_read_and_add(input_file):
|
||||
output_list=list()
|
||||
|
||||
for line in input_file.splitlines():
|
||||
output_list.append(line)
|
||||
return output_list
|
||||
|
||||
|
||||
for uri in uri_list:
|
||||
url = base_url + uri
|
||||
r=requests.get(url)
|
||||
dict['list'] += source_read_and_add(r.text)
|
||||
|
||||
dict['type'] = "cidr"
|
||||
dict['matching_attributes']=["ip-dst","ip-src","domain|ip"]
|
||||
dict['name']="List of known Cloudflare IP ranges"
|
||||
dict['version']= int(datetime.date.today().strftime('%Y%m%d'))
|
||||
dict['description']="List of known Cloudflare IP ranges (https://www.cloudflare.com/ips/)"
|
||||
dict['list']=list(set(dict['list']))
|
||||
|
||||
print(json.dumps(dict))
|
Loading…
Reference in New Issue