From 3d13b8263fb3e572410091bb4dff8830eaea0bef Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Sun, 18 Sep 2022 09:14:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5=20IP-=D0=B0?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D1=81=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domains.txt | 10 +++++++++- ips.txt | 5 +++++ runners/1_ips_from_domains_txt.py | 10 +++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/domains.txt b/domains.txt index 3d9e0e5..afb6eda 100644 --- a/domains.txt +++ b/domains.txt @@ -46,6 +46,14 @@ chess.com # developers.google.com # developers.google.com +142.250.150.101/32 # developers.google.com +64.233.163.102/32 # developers.google.com + developers.home.google.com +173.194.222.113/32 # developers.home.google.com + googleapis.com -firebase.google.com \ No newline at end of file +173.194.221.105/32 # googleapis.com + +firebase.google.com +74.125.205.138/32 # firebase.google.com \ No newline at end of file diff --git a/ips.txt b/ips.txt index a7bfdfc..37f98f1 100644 --- a/ips.txt +++ b/ips.txt @@ -1,8 +1,13 @@ 192.229.221.58/32 # us.download.nvidia.com 172.65.251.78/32 # gitlab.com +74.125.131.101/32 # developers.google.com +142.250.150.101/32 # developers.google.com 64.233.163.102/32 # developers.google.com +142.250.150.102/32 # developers.home.google.com 173.194.222.113/32 # developers.home.google.com +64.233.165.103/32 # googleapis.com 173.194.221.105/32 # googleapis.com +74.125.131.102/32 # firebase.google.com 74.125.205.138/32 # firebase.google.com 35.190.247.0/24 # google (spf) 64.233.160.0/19 # google (spf) diff --git a/runners/1_ips_from_domains_txt.py b/runners/1_ips_from_domains_txt.py index e7d4d58..74b61f8 100644 --- a/runners/1_ips_from_domains_txt.py +++ b/runners/1_ips_from_domains_txt.py @@ -1,3 +1,4 @@ +import ipaddress import socket from collections import defaultdict from utils import prettyprint @@ -12,7 +13,14 @@ def main(file_data: list): if l.startswith('#') or l == '': continue - dict[socket.gethostbyname(l) + '/32'].append(l) + domain_or_range, comment, *_ = [x.strip() for x in l.split('#')] + [None] + + try: + ipaddress.ip_network(domain_or_range) + dict[domain_or_range].append(comment) + + except ValueError: + dict[socket.gethostbyname(domain_or_range) + '/32'].append(l) ips = list(dict.keys())