Parsing Large Raw Files and Excluding Country IP Address Ranges
With this script we can analyze raw logs, extract IP addresses from a specific country and then analyze the rest of the log.
import ipaddress
import sys
# Função para verificar se um endereço IP está dentro do intervalo de IPv4 de Portugal
def is_portugal_ipv4(ip):
ipv4_ranges_portugal = [
ipaddress.ip_network('5.0.0.0/8'),
ipaddress.ip_network('37.0.0.0/8'),
ipaddress.ip_network('77.54.0.0/15'),
ipaddress.ip_network('85.242.0.0/15'),
ipaddress.ip_network('88.157.0.0/16'),
ipaddress.ip_network('109.48.0.0/15'),
ipaddress.ip_network('130.185.0.0/16'),
ipaddress.ip_network('176.63.0.0/16'),
ipaddress.ip_network('178.166.0.0/15'),
ipaddress.ip_network('185.2.0.0/15'),
ipaddress.ip_network('188.79.0.0/16'),
ipaddress.ip_network('193.126.0.0/16'),
ipaddress.ip_network('194.65.0.0/16'),
ipaddress.ip_network('195.22.0.0/15'),
ipaddress.ip_network('195.170.168.0/24'),
ipaddress.ip_network('213.13.0.0/16'),
ipaddress.ip_network('213.134.0.0/16'),
ipaddress.ip_network('213.205.0.0/16'),
ipaddress.ip_network('217.9.0.0/16'),
ipaddress.ip_network('89.114.0.0/15'),
ipaddress.ip_network('87.103.20.0/23'),
ipaddress.ip_network('148.69.0.0/16'),
ipaddress.ip_network('85.240.0.0/13'),
ipaddress.ip_network('78.137.192.0/18'),
ipaddress.ip_network('95.92.0.0/14'),
ipaddress.ip_network('213.205.64.0/19'),
ipaddress.ip_network('212.0.160.0/19'),
ipaddress.ip_network('195.23.0.0/16'),
ipaddress.ip_network('194.79.64.0/19'),
ipaddress.ip_network('192.101.118.0/24'),
ipaddress.ip_network('192.160.246.0/23'),
ipaddress.ip_network('192.160.245.0/24'),
ipaddress.ip_network('188.37.0.0/16'),
ipaddress.ip_network('185.37.208.0/22'),
ipaddress.ip_network('178.166.0.0/17'),
ipaddress.ip_network('161.230.0.0/16'),
ipaddress.ip_network('149.90.0.0/16'),
ipaddress.ip_network('148.71.0.0/16'),
ipaddress.ip_network('148.63.0.0/16'),
ipaddress.ip_network('144.64.0.0/16'),
ipaddress.ip_network('168.182.128.0/17'),
ipaddress.ip_network('176.78.0.0/15'),
ipaddress.ip_network('185.2.84.0/22'),
ipaddress.ip_network('188.250.0.0/15'),
ipaddress.ip_network('188.80.0.0/14'),
ipaddress.ip_network('198.56.128.0/17'),
ipaddress.ip_network('212.55.128.0/19'),
ipaddress.ip_network('192.160.248.0/23'),
ipaddress.ip_network('192.160.251.0/24'),
ipaddress.ip_network('193.109.93.0/24'),
ipaddress.ip_network('212.18.160.0/19'),
ipaddress.ip_network('213.30.0.0/17'),
ipaddress.ip_network('37.28.192.0/18'),
ipaddress.ip_network('46.189.128.0/17'),
ipaddress.ip_network('5.158.0.0/18'),
ipaddress.ip_network('5.249.0.0/17'),
ipaddress.ip_network('5.43.0.0/18'),
ipaddress.ip_network('77.54.0.0/16'),
ipaddress.ip_network('83.174.0.0/18'),
ipaddress.ip_network('87.103.0.0/17'),
ipaddress.ip_network('2.80.0.0/14'),
ipaddress.ip_network('37.189.0.0/16'),
ipaddress.ip_network('81.193.0.0/16'),
ipaddress.ip_network('82.154.0.0/15'),
ipaddress.ip_network('109.48.0.0/14'),
ipaddress.ip_network('109.48.0.0/18'),
ipaddress.ip_network('109.48.128.0/18'),
ipaddress.ip_network('109.48.192.0/18'),
ipaddress.ip_network('109.48.64.0/18'),
ipaddress.ip_network('109.49.0.0/18'),
ipaddress.ip_network('109.49.128.0/18'),
ipaddress.ip_network('109.49.192.0/18'),
ipaddress.ip_network('109.49.64.0/18'),
ipaddress.ip_network('109.50.128.0/18'),
ipaddress.ip_network('109.50.192.0/18'),
ipaddress.ip_network('109.50.64.0/18'),
ipaddress.ip_network('109.51.0.0/18'),
ipaddress.ip_network('109.51.128.0/18'),
ipaddress.ip_network('109.51.192.0/18'),
ipaddress.ip_network('109.51.64.0/18'),
ipaddress.ip_network('136.238.225.0/24'),
ipaddress.ip_network('185.218.12.0/22'),
ipaddress.ip_network('185.224.164.0/22'),
ipaddress.ip_network('185.80.76.0/22'),
ipaddress.ip_network('192.84.62.0/24'),
ipaddress.ip_network('193.176.0.0/24'),
ipaddress.ip_network('194.117.36.0/22'),
ipaddress.ip_network('194.140.232.0/24'),
ipaddress.ip_network('195.246.238.0/24'),
ipaddress.ip_network('195.246.239.0/24'),
ipaddress.ip_network('212.113.160.0/19'),
ipaddress.ip_network('213.22.0.0/16'),
ipaddress.ip_network('213.22.0.0/18'),
ipaddress.ip_network('213.22.128.0/18'),
ipaddress.ip_network('213.22.192.0/18'),
ipaddress.ip_network('213.22.64.0/18'),
ipaddress.ip_network('217.70.64.0/20'),
ipaddress.ip_network('23.1.4.0/22'),
ipaddress.ip_network('62.169.64.0/18'),
ipaddress.ip_network('78.130.0.0/17'),
ipaddress.ip_network('79.168.0.0/15'),
ipaddress.ip_network('79.168.0.0/18'),
ipaddress.ip_network('79.168.128.0/18'),
ipaddress.ip_network('79.168.192.0/18'),
ipaddress.ip_network('79.168.64.0/18'),
ipaddress.ip_network('79.169.0.0/18'),
ipaddress.ip_network('79.169.128.0/18'),
ipaddress.ip_network('79.169.192.0/18'),
ipaddress.ip_network('79.169.64.0/18'),
ipaddress.ip_network('80.243.80.0/20'),
ipaddress.ip_network('81.84.0.0/16'),
ipaddress.ip_network('81.84.0.0/18'),
ipaddress.ip_network('81.84.128.0/18'),
ipaddress.ip_network('81.84.192.0/18'),
ipaddress.ip_network('81.84.64.0/18'),
ipaddress.ip_network('83.132.0.0/16'),
ipaddress.ip_network('83.132.0.0/18'),
ipaddress.ip_network('83.132.128.0/18'),
ipaddress.ip_network('83.132.192.0/18'),
ipaddress.ip_network('83.144.128.0/18'),
ipaddress.ip_network('85.138.0.0/15'),
ipaddress.ip_network('85.138.0.0/18'),
ipaddress.ip_network('85.138.128.0/18'),
ipaddress.ip_network('85.138.192.0/18'),
ipaddress.ip_network('85.138.64.0/18'),
ipaddress.ip_network('85.139.0.0/18'),
ipaddress.ip_network('85.139.128.0/18'),
ipaddress.ip_network('85.139.192.0/18'),
ipaddress.ip_network('85.139.64.0/18'),
ipaddress.ip_network('87.196.0.0/16'),
ipaddress.ip_network('87.196.0.0/18'),
ipaddress.ip_network('87.196.64.0/19'),
ipaddress.ip_network('88.157.134.0/24'),
ipaddress.ip_network('88.210.64.0/18'),
ipaddress.ip_network('89.152.0.0/14'),
ipaddress.ip_network('89.152.0.0/18'),
ipaddress.ip_network('89.152.128.0/18'),
ipaddress.ip_network('89.152.192.0/18'),
ipaddress.ip_network('89.152.64.0/18'),
ipaddress.ip_network('89.153.0.0/18'),
ipaddress.ip_network('89.153.128.0/18'),
ipaddress.ip_network('89.153.192.0/18'),
ipaddress.ip_network('89.153.64.0/18'),
ipaddress.ip_network('89.154.0.0/18'),
ipaddress.ip_network('89.154.128.0/18'),
ipaddress.ip_network('89.154.192.0/18'),
ipaddress.ip_network('89.154.64.0/18'),
ipaddress.ip_network('89.155.0.0/18'),
ipaddress.ip_network('89.155.128.0/18'),
ipaddress.ip_network('89.155.192.0/18'),
ipaddress.ip_network('89.155.64.0/18'),
ipaddress.ip_network('89.180.0.0/15'),
ipaddress.ip_network('89.180.0.0/16'),
ipaddress.ip_network('89.180.128.0/18'),
ipaddress.ip_network('89.181.0.0/16'),
ipaddress.ip_network('89.181.128.0/18'),
ipaddress.ip_network('89.181.192.0/18'),
ipaddress.ip_network('93.102.0.0/16'),
ipaddress.ip_network('93.102.0.0/18'),
ipaddress.ip_network('93.102.64.0/18'),
ipaddress.ip_network('94.132.0.0/15'),
ipaddress.ip_network('94.132.0.0/18'),
ipaddress.ip_network('94.132.128.0/18'),
ipaddress.ip_network('93.108.0.0/16'),
ipaddress.ip_network('94.60.0.0/14'),
ipaddress.ip_network('95.136.0.0/17'),
ipaddress.ip_network('139.83.0.0/16'),
ipaddress.ip_network('158.162.0.0/19'),
ipaddress.ip_network('158.162.112.0/21'),
ipaddress.ip_network('158.162.128.0/18'),
ipaddress.ip_network('158.162.64.0/19'),
ipaddress.ip_network('158.162.96.0/20'),
ipaddress.ip_network('185.175.184.0/22'),
ipaddress.ip_network('192.104.48.0/24'),
ipaddress.ip_network('192.107.122.0/24'),
ipaddress.ip_network('192.122.238.0/23'),
ipaddress.ip_network('192.122.240.0/23'),
ipaddress.ip_network('192.122.242.0/24'),
ipaddress.ip_network('192.132.53.0/24'),
ipaddress.ip_network('192.132.55.0/24'),
ipaddress.ip_network('192.133.108.0/24'),
ipaddress.ip_network('192.135.187.0/24'),
ipaddress.ip_network('192.135.219.0/24'),
ipaddress.ip_network('192.136.52.0/24'),
ipaddress.ip_network('192.138.204.0/24'),
ipaddress.ip_network('192.138.86.0/24'),
ipaddress.ip_network('192.147.155.0/24'),
ipaddress.ip_network('192.153.13.0/24'),
ipaddress.ip_network('192.190.174.0/24'),
ipaddress.ip_network('192.195.195.0/24'),
ipaddress.ip_network('192.207.196.0/24'),
ipaddress.ip_network('192.26.231.0/24'),
ipaddress.ip_network('192.26.236.0/24'),
ipaddress.ip_network('192.26.239.0/24'),
ipaddress.ip_network('192.67.76.0/24'),
ipaddress.ip_network('192.68.186.0/24'),
ipaddress.ip_network('192.68.209.0/24'),
ipaddress.ip_network('192.68.216.0/24'),
ipaddress.ip_network('192.68.221.0/24'),
ipaddress.ip_network('192.68.224.0/24'),
ipaddress.ip_network('192.80.20.0/24'),
ipaddress.ip_network('192.82.127.0/24'),
ipaddress.ip_network('192.82.214.0/24'),
ipaddress.ip_network('192.84.13.0/24'),
ipaddress.ip_network('192.84.15.0/24'),
ipaddress.ip_network('192.86.138.0/24'),
ipaddress.ip_network('192.88.17.0/24'),
ipaddress.ip_network('192.88.250.0/24'),
ipaddress.ip_network('192.88.251.0/24'),
ipaddress.ip_network('192.88.252.0/24'),
ipaddress.ip_network('192.88.253.0/24'),
ipaddress.ip_network('192.88.254.0/24'),
ipaddress.ip_network('192.92.133.0/24'),
ipaddress.ip_network('192.92.135.0/24'),
ipaddress.ip_network('192.92.142.0/24'),
ipaddress.ip_network('192.92.144.0/24'),
ipaddress.ip_network('192.92.146.0/24'),
ipaddress.ip_network('192.92.147.0/24'),
ipaddress.ip_network('192.92.148.0/24'),
ipaddress.ip_network('192.92.149.0/24'),
ipaddress.ip_network('192.92.152.0/24'),
ipaddress.ip_network('192.92.153.0/24'),
ipaddress.ip_network('192.94.24.0/24'),
ipaddress.ip_network('193.136.0.0/15'),
ipaddress.ip_network('193.236.0.0/20'),
ipaddress.ip_network('193.236.102.0/23'),
ipaddress.ip_network('193.236.104.0/21'),
ipaddress.ip_network('193.236.112.0/21'),
ipaddress.ip_network('193.236.124.0/22'),
ipaddress.ip_network('193.236.153.0/24'),
ipaddress.ip_network('193.236.154.0/23'),
ipaddress.ip_network('193.236.157.0/24'),
ipaddress.ip_network('193.236.158.0/23'),
ipaddress.ip_network('193.236.160.0/20'),
ipaddress.ip_network('193.236.178.0/23'),
ipaddress.ip_network('193.236.180.0/22'),
ipaddress.ip_network('193.236.184.0/21'),
ipaddress.ip_network('193.236.192.0/18'),
ipaddress.ip_network('193.236.97.0/24'),
ipaddress.ip_network('193.236.98.0/23'),
ipaddress.ip_network('194.117.0.0/20'),
ipaddress.ip_network('194.117.16.0/21'),
ipaddress.ip_network('194.117.40.0/21'),
ipaddress.ip_network('194.117.48.0/23'),
ipaddress.ip_network('194.210.0.0/16'),
ipaddress.ip_network('185.92.96.0/22'),
ipaddress.ip_network('188.140.0.0/17'),
ipaddress.ip_network('31.22.128.0/17'),
ipaddress.ip_network('46.50.0.0/17'),
ipaddress.ip_network('83.223.224.0/19'),
ipaddress.ip_network('88.214.128.0/18'),
ipaddress.ip_network('89.214.0.0/16'),
ipaddress.ip_network('92.250.0.0/17'),
ipaddress.ip_network('95.69.0.0/17'),
ipaddress.ip_network('213.228.128.0/18'),
ipaddress.ip_network('213.228.128.0/22'),
ipaddress.ip_network('213.228.132.0/24'),
ipaddress.ip_network('213.228.137.0/24'),
ipaddress.ip_network('213.228.153.0/24'),
ipaddress.ip_network('213.228.154.0/24'),
ipaddress.ip_network('213.228.155.0/24'),
ipaddress.ip_network('213.228.157.0/24'),
ipaddress.ip_network('213.228.168.0/24'),
ipaddress.ip_network('213.228.169.0/24'),
ipaddress.ip_network('213.228.170.0/24'),
ipaddress.ip_network('213.228.171.0/24'),
ipaddress.ip_network('213.228.180.0/24'),
ipaddress.ip_network('213.228.184.0/24'),
ipaddress.ip_network('217.129.0.0/16'),
ipaddress.ip_network('217.129.0.0/21'),
ipaddress.ip_network('217.129.104.0/21'),
ipaddress.ip_network('217.129.144.0/22'),
ipaddress.ip_network('217.129.148.0/22'),
ipaddress.ip_network('217.129.152.0/22'),
ipaddress.ip_network('217.129.156.0/22'),
ipaddress.ip_network('217.129.160.0/21'),
ipaddress.ip_network('217.129.168.0/21'),
ipaddress.ip_network('217.129.176.0/21'),
ipaddress.ip_network('217.129.184.0/21'),
ipaddress.ip_network('217.129.192.0/21'),
ipaddress.ip_network('217.129.208.0/21'),
ipaddress.ip_network('217.129.216.0/21'),
ipaddress.ip_network('217.129.224.0/21'),
ipaddress.ip_network('217.129.232.0/22'),
ipaddress.ip_network('217.129.236.0/22'),
ipaddress.ip_network('217.129.240.0/21'),
ipaddress.ip_network('217.129.24.0/21'),
ipaddress.ip_network('217.129.248.0/22'),
ipaddress.ip_network('217.129.252.0/22'),
ipaddress.ip_network('217.129.40.0/21'),
ipaddress.ip_network('217.129.48.0/20'),
ipaddress.ip_network('217.129.64.0/21'),
ipaddress.ip_network('217.129.72.0/21'),
ipaddress.ip_network('217.129.80.0/22'),
ipaddress.ip_network('217.129.8.0/21'),
ipaddress.ip_network('217.129.84.0/22'),
ipaddress.ip_network('217.129.88.0/22'),
ipaddress.ip_network('217.129.92.0/22'),
ipaddress.ip_network('217.129.96.0/21'),
ipaddress.ip_network('84.90.0.0/15'),
ipaddress.ip_network('84.90.0.0/21'),
ipaddress.ip_network('84.90.104.0/21'),
ipaddress.ip_network('84.90.112.0/21'),
ipaddress.ip_network('84.90.120.0/22'),
ipaddress.ip_network('84.90.12.0/22'),
ipaddress.ip_network('84.90.124.0/22'),
ipaddress.ip_network('84.90.128.0/21'),
ipaddress.ip_network('84.90.136.0/21'),
ipaddress.ip_network('84.90.144.0/22'),
ipaddress.ip_network('84.90.148.0/22'),
ipaddress.ip_network('84.90.152.0/22'),
ipaddress.ip_network('84.90.156.0/22'),
ipaddress.ip_network('84.90.160.0/21'),
ipaddress.ip_network('84.90.16.0/22'),
ipaddress.ip_network('84.90.168.0/22'),
ipaddress.ip_network('84.90.176.0/22'),
ipaddress.ip_network('84.90.180.0/22'),
ipaddress.ip_network('84.90.184.0/22'),
ipaddress.ip_network('84.90.188.0/23'),
ipaddress.ip_network('84.90.190.0/23'),
ipaddress.ip_network('84.90.200.0/21'),
ipaddress.ip_network('84.90.20.0/24'),
ipaddress.ip_network('84.90.208.0/21'),
ipaddress.ip_network('84.90.21.0/24'),
ipaddress.ip_network('84.90.216.0/22'),
ipaddress.ip_network('84.90.220.0/22'),
ipaddress.ip_network('84.90.224.0/22'),
ipaddress.ip_network('84.90.228.0/23'),
ipaddress.ip_network('84.90.230.0/23'),
ipaddress.ip_network('84.90.232.0/22'),
ipaddress.ip_network('84.90.236.0/22'),
ipaddress.ip_network('84.90.240.0/22'),
ipaddress.ip_network('84.90.24.0/21'),
ipaddress.ip_network('84.90.244.0/22'),
ipaddress.ip_network('84.90.248.0/22'),
ipaddress.ip_network('84.90.32.0/22'),
ipaddress.ip_network('84.90.36.0/22'),
ipaddress.ip_network('84.90.40.0/21'),
ipaddress.ip_network('84.90.48.0/21'),
ipaddress.ip_network('84.90.56.0/22'),
ipaddress.ip_network('84.90.60.0/22'),
ipaddress.ip_network('84.90.64.0/24'),
ipaddress.ip_network('84.90.65.0/24'),
ipaddress.ip_network('84.90.68.0/22'),
ipaddress.ip_network('84.90.72.0/21'),
ipaddress.ip_network('84.90.80.0/21'),
ipaddress.ip_network('84.90.8.0/22'),
ipaddress.ip_network('84.90.88.0/21'),
ipaddress.ip_network('84.90.96.0/21'),
ipaddress.ip_network('84.91.100.0/22'),
ipaddress.ip_network('84.91.104.0/22'),
ipaddress.ip_network('84.91.108.0/22'),
ipaddress.ip_network('84.91.112.0/22'),
ipaddress.ip_network('84.91.116.0/22'),
ipaddress.ip_network('147.78.200.0/22'),
ipaddress.ip_network('158.162.120.0/22'),
ipaddress.ip_network('176.221.32.0/24'),
ipaddress.ip_network('176.221.33.0/24'),
ipaddress.ip_network('176.221.34.0/24'),
ipaddress.ip_network('176.221.35.0/24'),
ipaddress.ip_network('176.221.36.0/24'),
ipaddress.ip_network('176.221.37.0/24'),
ipaddress.ip_network('185.160.115.0/24'),
ipaddress.ip_network('185.17.228.0/22'),
ipaddress.ip_network('185.99.233.0/24'),
ipaddress.ip_network('185.99.234.0/24'),
ipaddress.ip_network('185.99.235.0/24'),
ipaddress.ip_network('192.133.15.0/24'),
ipaddress.ip_network('192.88.123.0/24'),
ipaddress.ip_network('192.91.177.0/24'),
ipaddress.ip_network('193.203.106.0/24'),
ipaddress.ip_network('193.203.107.0/24'),
ipaddress.ip_network('193.236.120.0/24'),
ipaddress.ip_network('193.236.121.0/24'),
ipaddress.ip_network('193.236.122.0/24'),
ipaddress.ip_network('193.236.123.0/24'),
ipaddress.ip_network('193.43.40.0/24'),
ipaddress.ip_network('194.11.23.0/24'),
ipaddress.ip_network('194.39.84.0/24'),
ipaddress.ip_network('195.35.66.0/24'),
ipaddress.ip_network('212.55.160.0/20'),
ipaddress.ip_network('212.55.176.0/21'),
ipaddress.ip_network('213.13.32.0/19'),
ipaddress.ip_network('62.28.0.0/16'),
ipaddress.ip_network('62.48.128.0/17'),
ipaddress.ip_network('83.240.128.0/17'),
ipaddress.ip_network('91.216.117.0/24'),
ipaddress.ip_network('185.204.111.0/24'),
ipaddress.ip_network('185.248.35.0/24'),
ipaddress.ip_network('185.31.156.0/22'),
ipaddress.ip_network('185.31.156.0/24'),
ipaddress.ip_network('185.31.157.0/24'),
ipaddress.ip_network('185.31.158.0/24'),
ipaddress.ip_network('185.31.159.0/24'),
ipaddress.ip_network('185.42.162.0/24'),
ipaddress.ip_network('185.90.56.0/22'),
ipaddress.ip_network('185.90.56.0/24'),
ipaddress.ip_network('185.90.57.0/24'),
ipaddress.ip_network('185.90.58.0/24'),
ipaddress.ip_network('185.90.59.0/24'),
ipaddress.ip_network('194.39.124.0/22'),
ipaddress.ip_network('194.39.124.0/24'),
ipaddress.ip_network('194.39.125.0/24'),
ipaddress.ip_network('194.39.126.0/24'),
ipaddress.ip_network('194.39.127.0/24'),
ipaddress.ip_network('195.245.128.0/18'),
ipaddress.ip_network('195.245.128.0/19'),
ipaddress.ip_network('195.245.128.0/24'),
ipaddress.ip_network('195.245.156.0/24'),
ipaddress.ip_network('195.245.160.0/19'),
ipaddress.ip_network('195.245.173.0/24'),
ipaddress.ip_network('195.245.174.0/23'),
ipaddress.ip_network('195.245.179.0/24'),
ipaddress.ip_network('195.245.180.0/24'),
ipaddress.ip_network('213.58.0.0/16'),
ipaddress.ip_network('213.58.0.0/17'),
ipaddress.ip_network('213.58.0.0/21'),
ipaddress.ip_network('213.58.0.0/22'),
ipaddress.ip_network('213.58.100.0/22'),
ipaddress.ip_network('213.58.102.0/23'),
ipaddress.ip_network('213.58.104.0/22'),
ipaddress.ip_network('213.58.104.0/23'),
ipaddress.ip_network('213.58.106.0/23'),
ipaddress.ip_network('213.58.108.0/22'),
ipaddress.ip_network('213.58.108.0/23'),
ipaddress.ip_network('213.58.110.0/23'),
ipaddress.ip_network('213.58.112.0/22'),
ipaddress.ip_network('213.58.112.0/23'),
ipaddress.ip_network('213.58.114.0/23'),
ipaddress.ip_network('213.58.116.0/23'),
ipaddress.ip_network('213.58.118.0/23'),
ipaddress.ip_network('213.58.128.0/17'),
ipaddress.ip_network('213.58.128.0/18'),
ipaddress.ip_network('213.58.133.0/24'),
ipaddress.ip_network('213.58.182.0/24'),
ipaddress.ip_network('213.58.186.0/24'),
ipaddress.ip_network('213.58.187.0/24'),
ipaddress.ip_network('213.58.192.0/18'),
ipaddress.ip_network('213.58.209.0/24'),
ipaddress.ip_network('213.58.255.0/24'),
ipaddress.ip_network('213.58.40.0/21'),
ipaddress.ip_network('213.58.64.0/23'),
ipaddress.ip_network('213.58.66.0/23'),
ipaddress.ip_network('213.58.68.0/23'),
ipaddress.ip_network('213.58.70.0/23'),
ipaddress.ip_network('213.58.80.0/22'),
ipaddress.ip_network('213.58.84.0/22'),
ipaddress.ip_network('213.58.88.0/22'),
ipaddress.ip_network('213.58.92.0/23'),
ipaddress.ip_network('213.58.94.0/23'),
ipaddress.ip_network('213.58.96.0/19'),
ipaddress.ip_network('213.58.96.0/22'),
ipaddress.ip_network('62.233.41.0/24'),
ipaddress.ip_network('84.252.88.0/24'),
ipaddress.ip_network('84.252.89.0/24'),
ipaddress.ip_network('84.252.90.0/24'),
ipaddress.ip_network('84.252.91.0/24'),
ipaddress.ip_network('185.113.156.0/22'),
ipaddress.ip_network('213.141.0.0/19'),
ipaddress.ip_network('213.63.0.0/17'),
ipaddress.ip_network('213.63.128.0/17'),
ipaddress.ip_network('159.255.48.0/20'),
ipaddress.ip_network('188.125.192.0/19'),
ipaddress.ip_network('213.138.224.0/19'),
ipaddress.ip_network('213.190.192.0/19'),
ipaddress.ip_network('83.223.160.0/19'),
ipaddress.ip_network('84.23.192.0/19'),
ipaddress.ip_network('89.109.64.0/18'),
ipaddress.ip_network('95.172.160.0/19'),
ipaddress.ip_network('146.193.0.0/19'),
ipaddress.ip_network('146.193.32.0/19'),
ipaddress.ip_network('146.193.64.0/18'),
ipaddress.ip_network('146.193.128.0/18'),
ipaddress.ip_network('146.193.192.0/19'),
ipaddress.ip_network('146.193.224.0/19'),
ipaddress.ip_network('192.12.232.0/24'),
ipaddress.ip_network('194.117.32.0/22'),
ipaddress.ip_network('89.26.128.0/17'),
ipaddress.ip_network('89.26.128.0/18'),
ipaddress.ip_network('89.26.128.0/22'),
ipaddress.ip_network('89.26.128.0/24'),
ipaddress.ip_network('89.26.129.0/24'),
ipaddress.ip_network('89.26.132.0/22'),
ipaddress.ip_network('89.26.132.0/24'),
ipaddress.ip_network('89.26.136.0/22'),
ipaddress.ip_network('89.26.136.0/24'),
ipaddress.ip_network('89.26.137.0/24'),
ipaddress.ip_network('89.26.138.0/24'),
ipaddress.ip_network('89.26.139.0/24'),
ipaddress.ip_network('89.26.140.0/22'),
ipaddress.ip_network('89.26.140.0/24'),
ipaddress.ip_network('89.26.141.0/24'),
ipaddress.ip_network('89.26.142.0/23'),
ipaddress.ip_network('89.26.144.0/22'),
ipaddress.ip_network('89.26.148.0/22'),
ipaddress.ip_network('89.26.152.0/22'),
ipaddress.ip_network('89.26.156.0/22'),
ipaddress.ip_network('89.26.192.0/18'),
ipaddress.ip_network('89.26.192.0/22'),
ipaddress.ip_network('194.38.128.0/19'),
ipaddress.ip_network('194.38.128.0/20'),
ipaddress.ip_network('194.38.144.0/20'),
ipaddress.ip_network('213.146.192.0/19'),
ipaddress.ip_network('213.146.192.0/20'),
ipaddress.ip_network('213.146.192.0/22'),
ipaddress.ip_network('213.146.200.0/22'),
ipaddress.ip_network('213.146.204.0/22'),
ipaddress.ip_network('213.146.208.0/20'),
ipaddress.ip_network('213.146.208.0/22'),
ipaddress.ip_network('213.146.212.0/22'),
ipaddress.ip_network('213.146.216.0/22'),
ipaddress.ip_network('213.146.220.0/22'),
ipaddress.ip_network('213.146.220.0/24'),
ipaddress.ip_network('213.146.221.0/24'),
ipaddress.ip_network('194.38.128.0/24'),
ipaddress.ip_network('194.38.129.0/24'),
ipaddress.ip_network('194.38.144.0/24'),
ipaddress.ip_network('194.38.145.0/24'),
ipaddress.ip_network('81.20.240.0/20'),
ipaddress.ip_network('78.29.128.0/18'),
ipaddress.ip_network('128.65.224.0/19'),
ipaddress.ip_network('94.46.12.0/24'),
ipaddress.ip_network('94.46.13.0/24'),
ipaddress.ip_network('94.46.14.0/24'),
ipaddress.ip_network('94.46.15.0/24'),
ipaddress.ip_network('94.46.16.0/22'),
ipaddress.ip_network('94.46.20.0/22'),
ipaddress.ip_network('94.46.20.0/24'),
ipaddress.ip_network('94.46.21.0/24'),
ipaddress.ip_network('94.46.22.0/24'),
ipaddress.ip_network('94.46.23.0/24'),
ipaddress.ip_network('94.46.25.0/24'),
ipaddress.ip_network('94.46.26.0/24'),
ipaddress.ip_network('94.46.27.0/24'),
ipaddress.ip_network('94.46.28.0/22'),
ipaddress.ip_network('94.46.28.0/24'),
ipaddress.ip_network('94.46.29.0/24'),
ipaddress.ip_network('94.46.30.0/24'),
ipaddress.ip_network('94.46.132.0/24'),
ipaddress.ip_network('94.46.133.0/24'),
ipaddress.ip_network('109.71.40.0/21'),
ipaddress.ip_network('109.71.40.0/24'),
ipaddress.ip_network('109.71.41.0/24'),
ipaddress.ip_network('109.71.42.0/24'),
ipaddress.ip_network('109.71.43.0/24'),
ipaddress.ip_network('109.71.44.0/24'),
ipaddress.ip_network('109.71.45.0/24'),
ipaddress.ip_network('109.71.46.0/24'),
ipaddress.ip_network('109.71.47.0/24'),
ipaddress.ip_network('130.185.80.0/21'),
ipaddress.ip_network('130.185.81.0/24'),
ipaddress.ip_network('130.185.82.0/24'),
ipaddress.ip_network('130.185.83.0/24'),
ipaddress.ip_network('130.185.84.0/24'),
ipaddress.ip_network('130.185.85.0/24'),
ipaddress.ip_network('130.185.86.0/24'),
ipaddress.ip_network('130.185.87.0/24'),
ipaddress.ip_network('185.15.20.0/22'),
ipaddress.ip_network('185.15.20.0/24'),
ipaddress.ip_network('185.15.22.0/24'),
ipaddress.ip_network('185.15.23.0/24'),
ipaddress.ip_network('193.236.64.0/19'),
ipaddress.ip_network('193.236.32.0/19'),
ipaddress.ip_network('193.236.16.0/20'),
ipaddress.ip_network('104.89.164.0/22'),
ipaddress.ip_network('185.96.172.0/22'),
ipaddress.ip_network('195.8.0.0/19'),
ipaddress.ip_network('217.168.112.0/21'),
ipaddress.ip_network('88.221.64.0/22'),
ipaddress.ip_network('176.111.104.0/22'),
ipaddress.ip_network('176.111.104.0/24'),
ipaddress.ip_network('176.61.144.0/21'),
ipaddress.ip_network('185.11.164.0/22'),
ipaddress.ip_network('185.12.116.0/22'),
ipaddress.ip_network('185.76.4.0/22'),
ipaddress.ip_network('194.8.30.0/24'),
ipaddress.ip_network('195.8.58.0/23'),
ipaddress.ip_network('91.198.47.0/24'),
ipaddress.ip_network('94.126.168.0/21'),
ipaddress.ip_network('185.124.124.0/22'),
ipaddress.ip_network('185.136.52.0/22'),
ipaddress.ip_network('193.218.156.0/22'),
ipaddress.ip_network('195.184.240.0/22'),
ipaddress.ip_network('89.31.224.0/21'),
ipaddress.ip_network('94.126.144.0/21'),
ipaddress.ip_network('212.13.32.0/19')
]
for ipv4_range in ipv4_ranges_portugal:
if ipaddress.ip_address(ip) in ipv4_range:
return True
return False
# Função para verificar se um endereço IP está dentro do intervalo de IPv4 de Angola
def is_angola_ipv4(ip):
ipv4_ranges_angola = [
ipaddress.ip_network('41.0.0.0/8'),
ipaddress.ip_network('105.168.0.0/16'),
ipaddress.ip_network('154.0.0.0/8'),
ipaddress.ip_network('196.192.0.0/16'),
ipaddress.ip_network('41.63.160.0/24'),
ipaddress.ip_network('41.63.161.0/24'),
ipaddress.ip_network('41.63.162.0/24'),
ipaddress.ip_network('41.63.163.0/24'),
ipaddress.ip_network('41.63.164.0/24'),
ipaddress.ip_network('41.63.165.0/24'),
ipaddress.ip_network('41.63.167.0/24'),
ipaddress.ip_network('41.63.170.0/23'),
ipaddress.ip_network('41.63.184.0/24'),
ipaddress.ip_network('41.63.185.0/24'),
ipaddress.ip_network('41.63.187.0/24'),
ipaddress.ip_network('41.63.188.0/23'),
ipaddress.ip_network('41.63.190.0/24'),
ipaddress.ip_network('41.63.191.0/24'),
ipaddress.ip_network('41.70.128.0/17'),
ipaddress.ip_network('41.72.32.0/20'),
ipaddress.ip_network('41.72.52.0/23'),
ipaddress.ip_network('41.72.56.0/24'),
ipaddress.ip_network('41.74.241.0/24'),
ipaddress.ip_network('41.74.242.0/24'),
ipaddress.ip_network('41.74.243.0/24'),
ipaddress.ip_network('41.74.245.0/24'),
ipaddress.ip_network('41.74.246.248/29'),
ipaddress.ip_network('41.74.249.0/24'),
ipaddress.ip_network('41.74.250.0/24'),
ipaddress.ip_network('41.74.251.0/24'),
ipaddress.ip_network('41.74.252.0/24'),
ipaddress.ip_network('41.74.253.0/24'),
ipaddress.ip_network('41.78.16.0/23'),
ipaddress.ip_network('41.78.18.0/24'),
ipaddress.ip_network('41.78.19.0/24'),
ipaddress.ip_network('41.205.32.0/23'),
ipaddress.ip_network('41.205.34.0/24'),
ipaddress.ip_network('41.205.35.0/24'),
ipaddress.ip_network('41.205.36.0/23'),
ipaddress.ip_network('41.205.39.0/24'),
ipaddress.ip_network('41.205.40.0/24'),
ipaddress.ip_network('41.205.41.0/24'),
ipaddress.ip_network('41.205.48.0/23'),
ipaddress.ip_network('41.205.51.0/24'),
ipaddress.ip_network('41.205.52.0/22'),
ipaddress.ip_network('41.205.58.0/24'),
ipaddress.ip_network('41.205.59.0/24'),
ipaddress.ip_network('41.205.61.0/24'),
ipaddress.ip_network('41.205.62.0/24'),
ipaddress.ip_network('41.205.63.0/24'),
ipaddress.ip_network('41.207.228.0/24'),
ipaddress.ip_network('41.207.230.0/24'),
ipaddress.ip_network('41.210.192.0/18'),
ipaddress.ip_network('41.216.236.0/22'),
ipaddress.ip_network('41.218.108.0/24'),
ipaddress.ip_network('41.218.117.56/29'),
ipaddress.ip_network('41.218.124.0/23'),
ipaddress.ip_network('41.221.240.0/20'),
ipaddress.ip_network('41.222.200.0/24'),
ipaddress.ip_network('41.222.201.0/24'),
ipaddress.ip_network('41.222.203.0/24'),
ipaddress.ip_network('41.222.236.0/24'),
ipaddress.ip_network('41.222.237.16/28'),
ipaddress.ip_network('41.222.238.0/24'),
ipaddress.ip_network('41.222.239.64/26'),
ipaddress.ip_network('41.222.248.0/24'),
ipaddress.ip_network('41.222.249.0/24'),
ipaddress.ip_network('41.222.250.0/24'),
ipaddress.ip_network('41.222.251.0/24'),
ipaddress.ip_network('41.222.253.0/24'),
ipaddress.ip_network('41.222.254.0/23'),
ipaddress.ip_network('41.223.40.0/23'),
ipaddress.ip_network('41.223.42.32/27'),
ipaddress.ip_network('41.223.43.0/24'),
ipaddress.ip_network('41.223.100.0/23'),
ipaddress.ip_network('41.223.103.0/24'),
ipaddress.ip_network('41.223.156.0/23'),
ipaddress.ip_network('41.223.159.0/24'),
ipaddress.ip_network('41.223.164.0/24'),
ipaddress.ip_network('41.223.165.0/24'),
ipaddress.ip_network('57.82.52.0/23'),
ipaddress.ip_network('63.223.154.0/25'),
ipaddress.ip_network('66.110.112.0/20'),
ipaddress.ip_network('77.70.138.0/26'),
ipaddress.ip_network('80.88.9.0/24'),
ipaddress.ip_network('83.229.65.0/24'),
ipaddress.ip_network('84.254.128.0/24'),
ipaddress.ip_network('102.36.224.0/24'),
ipaddress.ip_network('102.36.225.0/24'),
ipaddress.ip_network('102.36.226.0/24'),
ipaddress.ip_network('102.36.227.0/24'),
ipaddress.ip_network('102.64.60.0/24'),
ipaddress.ip_network('102.64.61.0/24'),
ipaddress.ip_network('102.64.82.0/24'),
ipaddress.ip_network('102.64.84.0/24'),
ipaddress.ip_network('102.64.87.0/24'),
ipaddress.ip_network('102.130.64.0/24'),
ipaddress.ip_network('102.130.65.0/24'),
ipaddress.ip_network('102.130.66.0/24'),
ipaddress.ip_network('102.130.67.0/24'),
ipaddress.ip_network('102.130.68.0/23'),
ipaddress.ip_network('102.130.70.0/24'),
ipaddress.ip_network('102.130.71.0/24'),
ipaddress.ip_network('102.130.192.0/24'),
ipaddress.ip_network('102.130.193.0/24'),
ipaddress.ip_network('102.130.194.0/24'),
ipaddress.ip_network('102.130.195.0/24'),
ipaddress.ip_network('102.130.196.0/23'),
ipaddress.ip_network('102.130.198.0/24'),
ipaddress.ip_network('102.130.199.0/24'),
ipaddress.ip_network('102.130.214.0/24'),
ipaddress.ip_network('102.130.215.0/24'),
ipaddress.ip_network('102.130.216.0/24'),
ipaddress.ip_network('102.130.217.0/24'),
ipaddress.ip_network('102.131.40.0/21'),
ipaddress.ip_network('102.165.190.0/24'),
ipaddress.ip_network('102.210.120.0/22'),
ipaddress.ip_network('102.210.169.0/24'),
ipaddress.ip_network('102.210.176.0/23'),
ipaddress.ip_network('102.210.178.0/23'),
ipaddress.ip_network('102.210.228.0/24'),
ipaddress.ip_network('102.210.229.0/24'),
ipaddress.ip_network('102.210.230.0/24'),
ipaddress.ip_network('102.210.231.0/24'),
ipaddress.ip_network('102.211.55.0/24'),
ipaddress.ip_network('102.211.128.0/24'),
ipaddress.ip_network('102.211.129.0/24'),
ipaddress.ip_network('102.211.130.0/23'),
ipaddress.ip_network('102.211.152.0/22'),
ipaddress.ip_network('102.211.200.0/22'),
ipaddress.ip_network('102.211.224.0/22'),
ipaddress.ip_network('102.212.216.0/22'),
ipaddress.ip_network('102.213.12.0/23'),
ipaddress.ip_network('102.213.14.0/23'),
ipaddress.ip_network('102.213.32.0/22'),
ipaddress.ip_network('102.213.54.0/24'),
ipaddress.ip_network('102.213.96.0/22'),
ipaddress.ip_network('102.213.101.0/24'),
ipaddress.ip_network('102.213.106.0/24'),
ipaddress.ip_network('102.213.107.0/24'),
ipaddress.ip_network('102.213.108.0/22'),
ipaddress.ip_network('102.213.240.0/24'),
ipaddress.ip_network('102.214.0.0/23'),
ipaddress.ip_network('102.214.2.0/23'),
ipaddress.ip_network('102.214.36.0/24'),
ipaddress.ip_network('102.214.37.0/24'),
ipaddress.ip_network('102.214.38.0/24'),
ipaddress.ip_network('102.214.39.0/24'),
ipaddress.ip_network('102.214.120.0/22'),
ipaddress.ip_network('102.214.127.0/24'),
ipaddress.ip_network('102.214.236.0/22'),
ipaddress.ip_network('102.215.60.0/24'),
ipaddress.ip_network('102.215.61.0/24'),
ipaddress.ip_network('102.215.62.0/23'),
ipaddress.ip_network('102.215.168.0/22'),
ipaddress.ip_network('102.215.180.0/24'),
ipaddress.ip_network('102.215.181.0/24'),
ipaddress.ip_network('102.215.184.0/22'),
ipaddress.ip_network('102.216.26.0/24'),
ipaddress.ip_network('102.216.44.0/22'),
ipaddress.ip_network('102.216.53.0/24'),
ipaddress.ip_network('102.216.54.0/23'),
ipaddress.ip_network('102.216.59.0/24'),
ipaddress.ip_network('102.216.140.0/24'),
ipaddress.ip_network('102.216.141.0/24'),
ipaddress.ip_network('102.216.142.0/23'),
ipaddress.ip_network('102.216.168.0/24'),
ipaddress.ip_network('102.216.169.0/24'),
ipaddress.ip_network('102.216.171.0/24'),
ipaddress.ip_network('102.216.208.0/23'),
ipaddress.ip_network('102.216.211.0/24'),
ipaddress.ip_network('102.216.252.0/22'),
ipaddress.ip_network('102.217.116.0/24'),
ipaddress.ip_network('102.217.117.0/24'),
ipaddress.ip_network('102.217.118.0/24'),
ipaddress.ip_network('102.217.119.0/24'),
ipaddress.ip_network('102.217.192.0/24'),
ipaddress.ip_network('102.217.193.0/24'),
ipaddress.ip_network('102.218.84.0/24'),
ipaddress.ip_network('102.218.85.0/24'),
ipaddress.ip_network('102.218.86.0/24'),
ipaddress.ip_network('102.218.87.0/24'),
ipaddress.ip_network('102.218.92.0/22'),
ipaddress.ip_network('102.218.148.0/22'),
ipaddress.ip_network('102.218.180.0/24'),
ipaddress.ip_network('102.218.181.0/24'),
ipaddress.ip_network('102.218.183.0/24'),
ipaddress.ip_network('102.219.30.0/24'),
ipaddress.ip_network('102.219.80.0/24'),
ipaddress.ip_network('102.219.124.0/22'),
ipaddress.ip_network('102.219.184.0/22'),
ipaddress.ip_network('102.219.226.0/24'),
ipaddress.ip_network('102.220.192.0/22'),
ipaddress.ip_network('102.221.52.0/23'),
ipaddress.ip_network('102.221.54.0/24'),
ipaddress.ip_network('102.221.55.0/24'),
ipaddress.ip_network('102.221.108.0/22'),
ipaddress.ip_network('102.221.172.0/23'),
ipaddress.ip_network('102.221.174.0/24'),
ipaddress.ip_network('102.221.175.0/24'),
ipaddress.ip_network('102.222.16.0/22'),
ipaddress.ip_network('102.222.92.0/24'),
ipaddress.ip_network('102.222.93.0/24'),
ipaddress.ip_network('102.223.3.0/24'),
ipaddress.ip_network('104.28.46.0/24'),
ipaddress.ip_network('104.28.61.0/24'),
ipaddress.ip_network('104.28.82.0/24'),
ipaddress.ip_network('104.29.40.0/24'),
ipaddress.ip_network('104.44.65.0/24'),
ipaddress.ip_network('105.168.0.0/24'),
ipaddress.ip_network('105.168.1.0/24'),
ipaddress.ip_network('105.168.3.224/27'),
ipaddress.ip_network('105.168.4.144/28'),
ipaddress.ip_network('105.168.6.0/25'),
ipaddress.ip_network('105.168.6.192/26'),
ipaddress.ip_network('105.168.8.0/23'),
ipaddress.ip_network('105.168.11.0/24'),
ipaddress.ip_network('105.168.12.0/24'),
ipaddress.ip_network('105.168.13.0/24'),
ipaddress.ip_network('105.168.14.0/24'),
ipaddress.ip_network('105.168.15.0/24'),
ipaddress.ip_network('105.168.16.0/24'),
ipaddress.ip_network('105.168.17.0/24'),
ipaddress.ip_network('105.168.18.0/24'),
ipaddress.ip_network('105.168.19.0/24'),
ipaddress.ip_network('105.168.20.0/25'),
ipaddress.ip_network('105.168.20.128/25'),
ipaddress.ip_network('105.168.22.0/24'),
ipaddress.ip_network('105.168.23.0/24'),
ipaddress.ip_network('105.168.24.0/23'),
ipaddress.ip_network('105.168.26.0/24'),
ipaddress.ip_network('105.168.27.0/24'),
ipaddress.ip_network('105.168.28.0/22'),
ipaddress.ip_network('105.168.32.0/24'),
ipaddress.ip_network('105.168.33.0/24'),
ipaddress.ip_network('105.168.34.0/24'),
ipaddress.ip_network('105.168.35.0/24'),
ipaddress.ip_network('105.168.36.0/23'),
ipaddress.ip_network('105.168.38.0/24'),
ipaddress.ip_network('105.168.39.0/24'),
ipaddress.ip_network('105.168.40.0/24'),
ipaddress.ip_network('105.168.41.0/24'),
ipaddress.ip_network('105.168.42.0/24'),
ipaddress.ip_network('105.168.43.0/24'),
ipaddress.ip_network('105.168.46.0/24'),
ipaddress.ip_network('105.168.47.0/24'),
ipaddress.ip_network('105.168.48.0/24'),
ipaddress.ip_network('105.168.49.0/24'),
ipaddress.ip_network('105.168.51.0/24'),
ipaddress.ip_network('105.168.52.0/23'),
ipaddress.ip_network('105.168.55.0/24'),
ipaddress.ip_network('105.168.57.0/24'),
ipaddress.ip_network('105.168.64.0/23'),
ipaddress.ip_network('105.168.66.0/24'),
ipaddress.ip_network('105.168.67.0/24'),
ipaddress.ip_network('105.168.68.0/24'),
ipaddress.ip_network('105.168.69.0/24'),
ipaddress.ip_network('105.168.70.0/23'),
ipaddress.ip_network('105.168.72.0/24'),
ipaddress.ip_network('105.168.73.0/24'),
ipaddress.ip_network('105.168.76.0/24'),
ipaddress.ip_network('105.168.77.0/24'),
ipaddress.ip_network('105.168.79.0/24'),
ipaddress.ip_network('105.168.80.0/22'),
ipaddress.ip_network('105.168.85.0/24'),
ipaddress.ip_network('105.168.86.0/24'),
ipaddress.ip_network('105.168.87.0/24'),
ipaddress.ip_network('105.168.88.0/23'),
ipaddress.ip_network('105.168.90.0/24'),
ipaddress.ip_network('105.168.91.0/24'),
ipaddress.ip_network('105.168.92.0/23'),
ipaddress.ip_network('105.168.94.0/24'),
ipaddress.ip_network('105.168.95.0/25'),
ipaddress.ip_network('105.168.95.192/26'),
ipaddress.ip_network('105.168.97.0/24'),
ipaddress.ip_network('105.168.98.0/23'),
ipaddress.ip_network('105.168.101.0/24'),
ipaddress.ip_network('105.168.102.0/24'),
ipaddress.ip_network('105.168.103.0/24'),
ipaddress.ip_network('105.168.104.0/23'),
ipaddress.ip_network('105.168.106.0/23'),
ipaddress.ip_network('105.168.109.0/24'),
ipaddress.ip_network('105.168.110.0/24'),
ipaddress.ip_network('105.168.111.0/24'),
ipaddress.ip_network('105.168.112.0/24'),
ipaddress.ip_network('105.168.113.0/24'),
ipaddress.ip_network('105.168.114.0/24'),
ipaddress.ip_network('105.168.115.0/24'),
ipaddress.ip_network('105.168.116.0/23'),
ipaddress.ip_network('105.168.118.0/24'),
ipaddress.ip_network('105.168.119.0/24'),
ipaddress.ip_network('105.168.122.0/24'),
ipaddress.ip_network('105.168.123.0/24'),
ipaddress.ip_network('105.168.124.0/22'),
ipaddress.ip_network('105.168.129.0/24'),
ipaddress.ip_network('105.168.130.0/23'),
ipaddress.ip_network('105.168.134.0/23'),
ipaddress.ip_network('105.168.136.0/24'),
ipaddress.ip_network('105.168.137.0/24'),
ipaddress.ip_network('105.168.140.0/23'),
ipaddress.ip_network('105.168.143.0/24'),
ipaddress.ip_network('105.168.144.0/24'),
ipaddress.ip_network('105.168.145.0/24'),
ipaddress.ip_network('105.168.147.0/24'),
ipaddress.ip_network('105.168.148.0/23'),
ipaddress.ip_network('105.168.150.0/24'),
ipaddress.ip_network('105.168.151.0/24'),
ipaddress.ip_network('105.168.152.0/24'),
ipaddress.ip_network('105.168.153.0/25'),
ipaddress.ip_network('105.168.153.128/25'),
ipaddress.ip_network('105.168.155.0/24'),
ipaddress.ip_network('105.168.156.0/24'),
ipaddress.ip_network('105.168.157.0/24'),
ipaddress.ip_network('105.168.163.0/24'),
ipaddress.ip_network('105.168.164.0/24'),
ipaddress.ip_network('105.168.165.0/24'),
ipaddress.ip_network('105.168.166.0/23'),
ipaddress.ip_network('105.168.169.0/24'),
ipaddress.ip_network('105.168.170.0/23'),
ipaddress.ip_network('105.168.172.0/24'),
ipaddress.ip_network('105.168.173.0/24'),
ipaddress.ip_network('105.168.175.0/24'),
ipaddress.ip_network('105.168.178.0/23'),
ipaddress.ip_network('105.168.182.0/24'),
ipaddress.ip_network('105.168.183.0/24'),
ipaddress.ip_network('105.168.184.0/24'),
ipaddress.ip_network('105.168.185.0/24'),
ipaddress.ip_network('105.168.186.0/24'),
ipaddress.ip_network('105.168.187.0/24'),
ipaddress.ip_network('105.168.188.0/23'),
ipaddress.ip_network('105.168.190.0/24'),
ipaddress.ip_network('105.168.191.0/24'),
ipaddress.ip_network('105.168.192.0/24'),
ipaddress.ip_network('105.168.193.0/24'),
ipaddress.ip_network('105.168.195.0/24'),
ipaddress.ip_network('105.168.197.0/24'),
ipaddress.ip_network('105.168.198.0/23'),
ipaddress.ip_network('105.168.200.0/24'),
ipaddress.ip_network('105.168.201.0/24'),
ipaddress.ip_network('105.168.202.0/24'),
ipaddress.ip_network('105.168.203.0/24'),
ipaddress.ip_network('105.168.209.0/24'),
ipaddress.ip_network('105.168.210.0/24'),
ipaddress.ip_network('105.168.211.0/24'),
ipaddress.ip_network('105.168.212.208/28'),
ipaddress.ip_network('105.168.214.0/24'),
ipaddress.ip_network('105.168.215.0/24'),
ipaddress.ip_network('105.168.216.0/23'),
ipaddress.ip_network('105.168.219.0/24'),
ipaddress.ip_network('105.168.220.0/24'),
ipaddress.ip_network('105.168.221.0/24'),
ipaddress.ip_network('105.168.223.0/24'),
ipaddress.ip_network('105.168.225.0/24'),
ipaddress.ip_network('105.168.228.0/22'),
ipaddress.ip_network('105.168.233.0/24'),
ipaddress.ip_network('105.168.234.0/24'),
ipaddress.ip_network('105.168.235.0/24'),
ipaddress.ip_network('105.168.236.0/23'),
ipaddress.ip_network('105.168.239.0/24'),
ipaddress.ip_network('105.168.240.0/24'),
ipaddress.ip_network('105.168.241.0/24'),
ipaddress.ip_network('105.168.242.0/23'),
ipaddress.ip_network('105.168.244.0/24'),
ipaddress.ip_network('105.168.245.0/24'),
ipaddress.ip_network('105.168.248.0/24'),
ipaddress.ip_network('105.168.249.0/24'),
ipaddress.ip_network('105.168.250.0/24'),
ipaddress.ip_network('105.168.251.0/24'),
ipaddress.ip_network('105.168.252.0/24'),
ipaddress.ip_network('105.168.253.0/24'),
ipaddress.ip_network('105.168.254.0/24'),
ipaddress.ip_network('105.168.255.0/24'),
ipaddress.ip_network('105.172.2.0/24'),
ipaddress.ip_network('105.172.3.0/24'),
ipaddress.ip_network('105.172.5.0/24'),
ipaddress.ip_network('105.172.6.0/24'),
ipaddress.ip_network('105.172.7.0/24'),
ipaddress.ip_network('105.172.8.0/24'),
ipaddress.ip_network('105.172.9.0/24'),
ipaddress.ip_network('105.172.10.0/23'),
ipaddress.ip_network('105.172.14.0/23'),
ipaddress.ip_network('105.172.21.0/24'),
ipaddress.ip_network('105.172.22.0/24'),
ipaddress.ip_network('105.172.23.0/24'),
ipaddress.ip_network('105.172.27.0/24'),
ipaddress.ip_network('105.172.28.0/24'),
ipaddress.ip_network('105.172.29.128/25'),
ipaddress.ip_network('105.172.30.0/24'),
ipaddress.ip_network('105.172.31.0/24'),
ipaddress.ip_network('105.172.33.0/24'),
ipaddress.ip_network('105.172.35.0/24'),
ipaddress.ip_network('105.172.36.0/24'),
ipaddress.ip_network('105.172.37.0/24'),
ipaddress.ip_network('105.172.40.0/24'),
ipaddress.ip_network('105.172.41.0/24'),
ipaddress.ip_network('105.172.42.0/24'),
ipaddress.ip_network('105.172.43.0/24'),
ipaddress.ip_network('105.172.44.0/24'),
ipaddress.ip_network('105.172.45.0/24'),
ipaddress.ip_network('105.172.46.0/23'),
ipaddress.ip_network('105.172.48.0/23'),
ipaddress.ip_network('105.172.50.0/24'),
ipaddress.ip_network('105.172.51.0/24'),
ipaddress.ip_network('105.172.54.0/24'),
ipaddress.ip_network('105.172.55.0/24'),
ipaddress.ip_network('105.172.56.0/24'),
ipaddress.ip_network('105.172.57.0/24'),
ipaddress.ip_network('105.172.58.0/23'),
ipaddress.ip_network('105.172.61.0/24'),
ipaddress.ip_network('105.172.62.0/24'),
ipaddress.ip_network('105.172.63.0/24'),
ipaddress.ip_network('105.172.64.0/24'),
ipaddress.ip_network('105.172.65.0/24'),
ipaddress.ip_network('105.172.66.0/24'),
ipaddress.ip_network('105.172.67.0/24'),
ipaddress.ip_network('105.172.68.0/23'),
ipaddress.ip_network('105.172.71.64/26'),
ipaddress.ip_network('105.172.71.192/26'),
ipaddress.ip_network('105.172.75.0/24'),
ipaddress.ip_network('105.172.76.0/24'),
ipaddress.ip_network('105.172.77.0/24'),
ipaddress.ip_network('105.172.78.0/24'),
ipaddress.ip_network('105.172.79.0/24'),
ipaddress.ip_network('105.172.81.0/24'),
ipaddress.ip_network('105.172.82.0/24'),
ipaddress.ip_network('105.172.83.0/24'),
ipaddress.ip_network('105.172.86.0/24'),
ipaddress.ip_network('105.172.87.0/24'),
ipaddress.ip_network('105.172.88.0/23'),
ipaddress.ip_network('105.172.90.0/24'),
ipaddress.ip_network('105.172.91.0/24'),
ipaddress.ip_network('105.172.92.0/22'),
ipaddress.ip_network('105.172.96.0/24'),
ipaddress.ip_network('105.172.97.0/24'),
ipaddress.ip_network('105.172.98.0/23'),
ipaddress.ip_network('105.172.101.0/24'),
ipaddress.ip_network('105.172.102.0/24'),
ipaddress.ip_network('105.172.103.0/24'),
ipaddress.ip_network('105.172.104.0/24'),
ipaddress.ip_network('105.172.105.0/24'),
ipaddress.ip_network('105.172.106.68/30'),
ipaddress.ip_network('105.172.109.0/24'),
ipaddress.ip_network('105.172.110.0/23'),
ipaddress.ip_network('105.172.112.0/24'),
ipaddress.ip_network('105.172.113.0/24'),
ipaddress.ip_network('105.172.114.0/24'),
ipaddress.ip_network('105.172.115.0/24'),
ipaddress.ip_network('105.172.116.0/24'),
ipaddress.ip_network('105.172.117.0/24'),
ipaddress.ip_network('105.172.119.0/24'),
ipaddress.ip_network('105.172.120.0/24'),
ipaddress.ip_network('105.172.121.0/24'),
ipaddress.ip_network('105.172.122.0/24'),
ipaddress.ip_network('105.172.123.0/24'),
ipaddress.ip_network('105.172.125.0/24'),
ipaddress.ip_network('105.172.126.0/23'),
ipaddress.ip_network('105.172.128.0/24'),
ipaddress.ip_network('105.172.129.0/24'),
ipaddress.ip_network('105.172.130.0/24'),
ipaddress.ip_network('105.172.131.0/24'),
ipaddress.ip_network('105.172.133.0/24'),
ipaddress.ip_network('105.172.134.0/24'),
ipaddress.ip_network('105.172.135.0/24'),
ipaddress.ip_network('105.172.136.0/23'),
ipaddress.ip_network('105.172.138.0/23'),
ipaddress.ip_network('105.172.141.48/28'),
ipaddress.ip_network('105.172.145.0/24'),
ipaddress.ip_network('105.172.146.0/24'),
ipaddress.ip_network('105.172.147.0/24'),
ipaddress.ip_network('105.172.149.0/24'),
ipaddress.ip_network('105.172.150.0/23'),
ipaddress.ip_network('105.172.152.0/24'),
ipaddress.ip_network('105.172.153.0/24'),
ipaddress.ip_network('105.172.156.0/24'),
ipaddress.ip_network('105.172.157.0/24'),
ipaddress.ip_network('105.172.158.0/24'),
ipaddress.ip_network('105.172.159.0/24'),
ipaddress.ip_network('105.172.166.0/23'),
ipaddress.ip_network('105.172.168.0/23'),
ipaddress.ip_network('105.172.170.0/23'),
ipaddress.ip_network('105.172.172.0/24'),
ipaddress.ip_network('105.172.173.0/24'),
ipaddress.ip_network('105.172.175.0/24'),
ipaddress.ip_network('105.172.178.0/24'),
ipaddress.ip_network('105.172.179.0/24'),
ipaddress.ip_network('105.172.180.0/24'),
ipaddress.ip_network('105.172.181.0/24'),
ipaddress.ip_network('105.172.185.0/24'),
ipaddress.ip_network('105.172.187.112/28'),
ipaddress.ip_network('105.172.188.0/23'),
ipaddress.ip_network('105.172.191.0/24'),
ipaddress.ip_network('105.172.192.0/22'),
ipaddress.ip_network('105.172.198.0/24'),
ipaddress.ip_network('105.172.199.0/24'),
ipaddress.ip_network('105.172.200.0/24'),
ipaddress.ip_network('105.172.201.0/24'),
ipaddress.ip_network('105.172.202.64/26'),
ipaddress.ip_network('105.172.204.0/24'),
ipaddress.ip_network('105.172.205.0/24'),
ipaddress.ip_network('105.172.206.0/23'),
ipaddress.ip_network('105.172.210.0/24'),
ipaddress.ip_network('105.172.211.0/24'),
ipaddress.ip_network('105.172.216.0/22'),
ipaddress.ip_network('105.172.221.0/24'),
ipaddress.ip_network('105.172.222.0/23'),
ipaddress.ip_network('105.172.225.0/24'),
ipaddress.ip_network('105.172.232.0/24'),
ipaddress.ip_network('105.172.233.0/24'),
ipaddress.ip_network('105.172.234.0/24'),
ipaddress.ip_network('105.172.235.0/24'),
ipaddress.ip_network('105.172.237.0/24'),
ipaddress.ip_network('105.172.238.0/24'),
ipaddress.ip_network('105.172.239.0/24'),
ipaddress.ip_network('105.172.240.0/23'),
ipaddress.ip_network('105.172.242.0/23'),
ipaddress.ip_network('105.172.244.0/23'),
ipaddress.ip_network('105.172.246.0/23'),
ipaddress.ip_network('105.172.248.0/24'),
ipaddress.ip_network('105.172.249.0/24'),
ipaddress.ip_network('105.172.250.192/26'),
ipaddress.ip_network('105.172.251.0/24'),
ipaddress.ip_network('105.172.252.0/24'),
ipaddress.ip_network('105.172.253.0/24'),
ipaddress.ip_network('105.174.0.0/24'),
ipaddress.ip_network('105.174.1.0/24'),
ipaddress.ip_network('105.174.2.0/24'),
ipaddress.ip_network('105.174.3.0/24'),
ipaddress.ip_network('105.174.4.0/22'),
ipaddress.ip_network('105.174.8.0/21'),
ipaddress.ip_network('105.174.16.0/24'),
ipaddress.ip_network('105.174.17.0/24'),
ipaddress.ip_network('105.174.18.0/23'),
ipaddress.ip_network('105.174.20.0/22'),
ipaddress.ip_network('105.174.28.0/24'),
ipaddress.ip_network('105.174.29.0/24'),
ipaddress.ip_network('105.174.30.0/24'),
ipaddress.ip_network('105.174.31.0/24'),
ipaddress.ip_network('105.174.32.0/22'),
ipaddress.ip_network('105.174.37.0/24'),
ipaddress.ip_network('105.174.39.0/24'),
ipaddress.ip_network('105.174.40.0/26'),
ipaddress.ip_network('105.174.40.64/26'),
ipaddress.ip_network('105.174.42.0/23'),
ipaddress.ip_network('105.174.45.0/24'),
ipaddress.ip_network('105.174.46.0/23'),
ipaddress.ip_network('105.174.48.0/24'),
ipaddress.ip_network('105.174.49.0/24'),
ipaddress.ip_network('105.174.51.0/24'),
ipaddress.ip_network('105.174.52.0/22'),
ipaddress.ip_network('109.68.57.0/24'),
ipaddress.ip_network('129.122.128.0/23'),
ipaddress.ip_network('129.122.130.0/23'),
ipaddress.ip_network('129.122.139.0/24'),
ipaddress.ip_network('129.122.140.0/22'),
ipaddress.ip_network('129.122.144.0/24'),
ipaddress.ip_network('129.122.145.0/24'),
ipaddress.ip_network('129.122.153.0/24'),
ipaddress.ip_network('129.122.154.0/24'),
ipaddress.ip_network('129.122.155.0/24'),
ipaddress.ip_network('129.122.157.0/24'),
ipaddress.ip_network('129.122.161.0/24'),
ipaddress.ip_network('129.122.162.0/23'),
ipaddress.ip_network('129.122.164.0/24'),
ipaddress.ip_network('129.122.165.0/24'),
ipaddress.ip_network('129.122.171.0/24'),
ipaddress.ip_network('129.122.172.0/22'),
ipaddress.ip_network('129.122.176.0/24'),
ipaddress.ip_network('129.122.177.0/24'),
ipaddress.ip_network('129.122.186.0/24'),
ipaddress.ip_network('129.122.187.0/24'),
ipaddress.ip_network('129.122.194.0/24'),
ipaddress.ip_network('129.122.195.0/24'),
ipaddress.ip_network('129.122.197.0/24'),
ipaddress.ip_network('129.122.198.0/24'),
ipaddress.ip_network('129.122.199.0/24'),
ipaddress.ip_network('129.122.201.0/24'),
ipaddress.ip_network('129.122.207.0/24'),
ipaddress.ip_network('129.122.209.0/24'),
ipaddress.ip_network('129.122.212.0/24'),
ipaddress.ip_network('129.122.213.0/24'),
ipaddress.ip_network('129.122.216.0/24'),
ipaddress.ip_network('129.122.217.0/24'),
ipaddress.ip_network('129.122.220.0/24'),
ipaddress.ip_network('129.122.221.0/24'),
ipaddress.ip_network('129.122.229.0/24'),
ipaddress.ip_network('129.122.230.0/24'),
ipaddress.ip_network('129.122.231.0/24'),
ipaddress.ip_network('129.122.232.0/22'),
ipaddress.ip_network('129.122.238.0/24'),
ipaddress.ip_network('129.122.239.0/24'),
ipaddress.ip_network('129.122.249.0/24'),
ipaddress.ip_network('129.122.250.0/24'),
ipaddress.ip_network('129.122.251.0/24'),
ipaddress.ip_network('129.122.252.0/24'),
ipaddress.ip_network('129.122.253.0/24'),
ipaddress.ip_network('129.122.254.0/23'),
ipaddress.ip_network('129.230.206.0/24'),
ipaddress.ip_network('146.23.44.0/27'),
ipaddress.ip_network('146.23.44.32/27'),
ipaddress.ip_network('146.75.168.2/31'),
ipaddress.ip_network('146.75.198.0/24'),
ipaddress.ip_network('149.87.164.0/24'),
ipaddress.ip_network('149.87.166.0/24'),
ipaddress.ip_network('154.0.64.0/20'),
ipaddress.ip_network('154.0.96.0/24'),
ipaddress.ip_network('154.0.97.0/24'),
ipaddress.ip_network('154.0.120.0/22'),
ipaddress.ip_network('154.0.127.0/24'),
ipaddress.ip_network('154.65.128.0/20'),
ipaddress.ip_network('154.65.148.0/24'),
ipaddress.ip_network('154.65.149.0/24'),
ipaddress.ip_network('154.66.80.0/24'),
ipaddress.ip_network('154.66.81.1/32'),
ipaddress.ip_network('154.66.81.186/31'),
ipaddress.ip_network('154.66.83.1/32'),
ipaddress.ip_network('154.66.104.0/24'),
ipaddress.ip_network('154.66.105.0/24'),
ipaddress.ip_network('154.71.128.0/21'),
ipaddress.ip_network('154.71.136.0/23'),
ipaddress.ip_network('154.71.139.0/24'),
ipaddress.ip_network('154.71.140.0/22'),
ipaddress.ip_network('154.71.144.0/24'),
ipaddress.ip_network('154.71.145.0/24'),
ipaddress.ip_network('154.71.148.0/24'),
ipaddress.ip_network('154.71.149.0/24'),
ipaddress.ip_network('154.71.150.0/23'),
ipaddress.ip_network('154.71.152.0/24'),
ipaddress.ip_network('154.71.153.0/24'),
ipaddress.ip_network('154.71.154.0/23'),
ipaddress.ip_network('154.71.158.0/23'),
ipaddress.ip_network('154.71.224.0/22'),
ipaddress.ip_network('154.71.228.0/24'),
ipaddress.ip_network('154.71.229.0/24'),
ipaddress.ip_network('154.71.230.0/23'),
ipaddress.ip_network('154.71.233.0/24'),
ipaddress.ip_network('154.71.239.0/24'),
ipaddress.ip_network('154.71.240.0/22'),
ipaddress.ip_network('154.71.245.0/24'),
ipaddress.ip_network('154.71.247.0/24'),
ipaddress.ip_network('154.71.252.0/24'),
ipaddress.ip_network('154.71.253.0/24'),
ipaddress.ip_network('154.116.128.0/18'),
ipaddress.ip_network('154.116.252.0/22'),
ipaddress.ip_network('154.118.192.0/23'),
ipaddress.ip_network('154.118.194.0/24'),
ipaddress.ip_network('154.118.195.0/24'),
ipaddress.ip_network('154.118.198.0/24'),
ipaddress.ip_network('154.118.199.0/24'),
ipaddress.ip_network('154.118.211.0/24'),
ipaddress.ip_network('154.118.212.0/22'),
ipaddress.ip_network('154.118.216.0/24'),
ipaddress.ip_network('154.118.217.0/24'),
ipaddress.ip_network('154.118.219.0/24'),
ipaddress.ip_network('154.118.220.0/24'),
ipaddress.ip_network('154.118.221.0/24'),
ipaddress.ip_network('154.118.222.0/23'),
ipaddress.ip_network('154.127.128.0/22'),
ipaddress.ip_network('154.127.134.0/23'),
ipaddress.ip_network('154.127.136.0/22'),
ipaddress.ip_network('154.127.140.0/23'),
ipaddress.ip_network('154.127.142.0/23'),
ipaddress.ip_network('154.127.144.0/24'),
ipaddress.ip_network('154.127.145.0/24'),
ipaddress.ip_network('154.127.147.0/24'),
ipaddress.ip_network('154.127.148.0/23'),
ipaddress.ip_network('154.127.150.0/24'),
ipaddress.ip_network('154.127.151.0/24'),
ipaddress.ip_network('154.127.152.0/23'),
ipaddress.ip_network('154.127.154.0/24'),
ipaddress.ip_network('154.127.155.0/24'),
ipaddress.ip_network('154.127.156.0/23'),
ipaddress.ip_network('154.127.158.0/23'),
ipaddress.ip_network('154.127.161.0/24'),
ipaddress.ip_network('154.127.162.0/24'),
ipaddress.ip_network('154.127.163.0/24'),
ipaddress.ip_network('154.127.166.0/24'),
ipaddress.ip_network('154.127.167.0/24'),
ipaddress.ip_network('154.127.168.0/23'),
ipaddress.ip_network('154.127.170.0/23'),
ipaddress.ip_network('154.127.172.0/22'),
ipaddress.ip_network('154.127.176.0/24'),
ipaddress.ip_network('154.127.177.0/24'),
ipaddress.ip_network('154.127.178.0/23'),
ipaddress.ip_network('154.127.183.0/24'),
ipaddress.ip_network('154.127.184.0/22'),
ipaddress.ip_network('154.127.188.0/23'),
ipaddress.ip_network('154.127.190.0/23'),
ipaddress.ip_network('154.127.192.0/21'),
ipaddress.ip_network('154.127.200.0/24'),
ipaddress.ip_network('154.127.201.0/24'),
ipaddress.ip_network('154.127.203.0/24'),
ipaddress.ip_network('154.127.204.0/24'),
ipaddress.ip_network('154.127.205.0/24'),
ipaddress.ip_network('154.127.208.0/24'),
ipaddress.ip_network('154.127.209.0/24'),
ipaddress.ip_network('154.127.212.0/24'),
ipaddress.ip_network('154.127.213.0/24'),
ipaddress.ip_network('154.127.222.0/24'),
ipaddress.ip_network('154.127.223.0/24'),
ipaddress.ip_network('154.127.224.0/22'),
ipaddress.ip_network('154.127.228.0/22'),
ipaddress.ip_network('154.127.233.0/24'),
ipaddress.ip_network('154.127.234.0/23'),
ipaddress.ip_network('154.127.236.0/24'),
ipaddress.ip_network('154.127.237.0/24'),
ipaddress.ip_network('154.127.240.0/24'),
ipaddress.ip_network('154.127.241.0/24'),
ipaddress.ip_network('154.127.242.0/24'),
ipaddress.ip_network('154.127.243.0/24'),
ipaddress.ip_network('154.127.248.0/24'),
ipaddress.ip_network('154.127.249.0/24'),
ipaddress.ip_network('154.127.250.0/24'),
ipaddress.ip_network('154.127.251.0/24'),
ipaddress.ip_network('154.127.252.0/23'),
ipaddress.ip_network('154.127.254.0/24'),
ipaddress.ip_network('154.127.255.0/24'),
ipaddress.ip_network('155.89.0.0/18'),
ipaddress.ip_network('155.89.64.0/18'),
ipaddress.ip_network('155.89.128.0/19'),
ipaddress.ip_network('155.89.160.0/19'),
ipaddress.ip_network('155.89.192.0/20'),
ipaddress.ip_network('155.89.221.0/24'),
ipaddress.ip_network('155.89.222.0/23'),
ipaddress.ip_network('157.167.98.0/24'),
ipaddress.ip_network('160.119.240.0/23'),
ipaddress.ip_network('160.119.242.0/23'),
ipaddress.ip_network('160.224.128.0/17'),
ipaddress.ip_network('160.242.17.0/24'),
ipaddress.ip_network('160.242.18.0/23'),
ipaddress.ip_network('160.242.22.0/23'),
ipaddress.ip_network('160.242.24.0/24'),
ipaddress.ip_network('160.242.26.0/24'),
ipaddress.ip_network('160.242.27.0/24'),
ipaddress.ip_network('160.242.30.0/24'),
ipaddress.ip_network('160.242.31.0/24'),
ipaddress.ip_network('162.158.252.0/24'),
ipaddress.ip_network('169.239.32.0/22'),
ipaddress.ip_network('169.239.76.0/24'),
ipaddress.ip_network('169.239.77.0/24'),
ipaddress.ip_network('169.239.78.0/23'),
ipaddress.ip_network('169.239.108.0/24'),
ipaddress.ip_network('169.239.109.0/24'),
ipaddress.ip_network('169.239.110.0/23'),
ipaddress.ip_network('169.239.132.0/23'),
ipaddress.ip_network('169.239.134.0/24'),
ipaddress.ip_network('169.239.135.0/24'),
ipaddress.ip_network('169.255.88.0/22'),
ipaddress.ip_network('172.68.40.0/24'),
ipaddress.ip_network('172.225.98.0/24'),
ipaddress.ip_network('192.12.111.0/24'),
ipaddress.ip_network('196.1.15.0/24'),
ipaddress.ip_network('196.6.255.0/24'),
ipaddress.ip_network('196.8.222.0/24'),
ipaddress.ip_network('196.11.189.0/24'),
ipaddress.ip_network('196.11.234.0/24'),
ipaddress.ip_network('196.13.109.0/24'),
ipaddress.ip_network('196.13.204.0/24'),
ipaddress.ip_network('196.13.243.0/24'),
ipaddress.ip_network('196.29.192.0/24'),
ipaddress.ip_network('196.29.193.0/24'),
ipaddress.ip_network('196.29.194.0/24'),
ipaddress.ip_network('196.29.195.0/24'),
ipaddress.ip_network('196.29.201.240/28'),
ipaddress.ip_network('196.29.202.0/23'),
ipaddress.ip_network('196.29.206.228/30'),
ipaddress.ip_network('196.29.207.0/24'),
ipaddress.ip_network('196.32.192.0/23'),
ipaddress.ip_network('196.32.194.0/24'),
ipaddress.ip_network('196.32.195.0/24'),
ipaddress.ip_network('196.32.196.0/24'),
ipaddress.ip_network('196.32.197.0/24'),
ipaddress.ip_network('196.32.198.0/24'),
ipaddress.ip_network('196.32.199.0/24'),
ipaddress.ip_network('196.41.77.0/24'),
ipaddress.ip_network('196.41.92.0/24'),
ipaddress.ip_network('196.43.197.0/24'),
ipaddress.ip_network('196.43.210.0/24'),
ipaddress.ip_network('196.43.223.0/24'),
ipaddress.ip_network('196.45.160.0/22'),
ipaddress.ip_network('196.46.21.0/24'),
ipaddress.ip_network('196.46.72.0/21'),
ipaddress.ip_network('196.48.36.0/24'),
ipaddress.ip_network('196.49.6.0/24'),
ipaddress.ip_network('196.56.36.0/24'),
ipaddress.ip_network('196.61.76.0/24'),
ipaddress.ip_network('196.61.77.0/24'),
ipaddress.ip_network('196.197.36.0/24'),
ipaddress.ip_network('196.198.36.0/24'),
ipaddress.ip_network('196.199.36.0/24'),
ipaddress.ip_network('196.202.252.0/22'),
ipaddress.ip_network('196.216.52.10/31'),
ipaddress.ip_network('196.216.161.0/24'),
ipaddress.ip_network('196.216.248.0/23'),
ipaddress.ip_network('196.223.1.0/24'),
ipaddress.ip_network('196.223.13.0/24'),
ipaddress.ip_network('196.223.19.0/24'),
ipaddress.ip_network('196.249.192.0/24'),
ipaddress.ip_network('196.249.193.0/24'),
ipaddress.ip_network('196.249.195.0/24'),
ipaddress.ip_network('196.249.196.0/22'),
ipaddress.ip_network('196.249.200.0/24'),
ipaddress.ip_network('196.249.201.0/24'),
ipaddress.ip_network('196.249.224.0/23'),
ipaddress.ip_network('196.249.227.0/24'),
ipaddress.ip_network('196.249.229.0/24'),
ipaddress.ip_network('196.249.230.0/23'),
ipaddress.ip_network('196.249.245.0/24'),
ipaddress.ip_network('196.249.247.0/24'),
ipaddress.ip_network('196.249.254.0/24'),
ipaddress.ip_network('196.249.255.0/24'),
ipaddress.ip_network('197.148.0.0/24'),
ipaddress.ip_network('197.148.1.0/24'),
ipaddress.ip_network('197.148.4.0/24'),
ipaddress.ip_network('197.148.5.0/24'),
ipaddress.ip_network('197.148.6.0/24'),
ipaddress.ip_network('197.148.7.0/24'),
ipaddress.ip_network('197.148.8.0/24'),
ipaddress.ip_network('197.148.9.0/24'),
ipaddress.ip_network('197.148.12.0/24'),
ipaddress.ip_network('197.148.13.0/24'),
ipaddress.ip_network('197.148.15.0/24'),
ipaddress.ip_network('197.148.16.0/24'),
ipaddress.ip_network('197.148.17.0/24'),
ipaddress.ip_network('197.148.19.0/24'),
ipaddress.ip_network('197.148.20.0/24'),
ipaddress.ip_network('197.148.21.0/24'),
ipaddress.ip_network('197.148.22.0/24'),
ipaddress.ip_network('197.148.23.0/24'),
ipaddress.ip_network('197.148.24.0/21'),
ipaddress.ip_network('197.148.32.0/24'),
ipaddress.ip_network('197.148.33.0/24'),
ipaddress.ip_network('197.148.34.0/23'),
ipaddress.ip_network('197.148.38.0/24'),
ipaddress.ip_network('197.148.39.0/24'),
ipaddress.ip_network('197.148.41.0/24'),
ipaddress.ip_network('197.148.43.0/24'),
ipaddress.ip_network('197.148.44.0/23'),
ipaddress.ip_network('197.148.46.0/23'),
ipaddress.ip_network('197.148.48.0/23'),
ipaddress.ip_network('197.148.51.0/24'),
ipaddress.ip_network('197.148.53.0/24'),
ipaddress.ip_network('197.148.56.0/21'),
ipaddress.ip_network('197.148.88.0/24'),
ipaddress.ip_network('197.148.89.64/26'),
ipaddress.ip_network('197.148.89.136/29'),
ipaddress.ip_network('197.148.91.64/26'),
ipaddress.ip_network('197.148.92.0/23'),
ipaddress.ip_network('197.148.94.4/30'),
ipaddress.ip_network('197.148.95.0/24'),
ipaddress.ip_network('197.149.148.0/24'),
ipaddress.ip_network('197.149.149.192/26'),
ipaddress.ip_network('197.149.150.64/26'),
ipaddress.ip_network('197.157.196.0/24'),
ipaddress.ip_network('197.157.197.0/24'),
ipaddress.ip_network('197.157.199.128/25'),
ipaddress.ip_network('197.216.0.0/24'),
ipaddress.ip_network('197.216.2.0/23'),
ipaddress.ip_network('197.216.5.0/24'),
ipaddress.ip_network('197.216.6.0/23'),
ipaddress.ip_network('197.216.12.0/24'),
ipaddress.ip_network('197.216.14.0/23'),
ipaddress.ip_network('197.216.20.0/24'),
ipaddress.ip_network('197.216.21.0/24'),
ipaddress.ip_network('197.216.22.0/23'),
ipaddress.ip_network('197.216.26.0/24'),
ipaddress.ip_network('197.216.27.0/24'),
ipaddress.ip_network('197.216.33.0/24'),
ipaddress.ip_network('197.216.34.0/24'),
ipaddress.ip_network('197.216.35.0/24'),
ipaddress.ip_network('197.216.40.0/23'),
ipaddress.ip_network('197.216.43.0/24'),
ipaddress.ip_network('197.216.44.0/24'),
ipaddress.ip_network('197.216.51.0/24'),
ipaddress.ip_network('197.216.53.0/24'),
ipaddress.ip_network('197.216.56.0/24'),
ipaddress.ip_network('197.216.64.0/20'),
ipaddress.ip_network('197.216.86.0/24'),
ipaddress.ip_network('197.216.87.0/24'),
ipaddress.ip_network('197.216.100.0/22'),
ipaddress.ip_network('197.216.104.0/24'),
ipaddress.ip_network('197.216.105.0/24'),
ipaddress.ip_network('197.216.106.0/23'),
ipaddress.ip_network('197.217.128.0/24'),
ipaddress.ip_network('197.217.129.0/24'),
ipaddress.ip_network('197.217.132.0/24'),
ipaddress.ip_network('197.217.133.0/24'),
ipaddress.ip_network('197.217.134.0/24'),
ipaddress.ip_network('197.217.135.0/24'),
ipaddress.ip_network('197.217.136.0/24'),
ipaddress.ip_network('197.217.137.0/24'),
ipaddress.ip_network('197.217.138.0/24'),
ipaddress.ip_network('197.217.139.0/24'),
ipaddress.ip_network('197.217.140.0/23'),
ipaddress.ip_network('197.217.143.0/24'),
ipaddress.ip_network('197.217.144.0/20'),
ipaddress.ip_network('197.217.192.0/24'),
ipaddress.ip_network('197.234.112.0/26'),
ipaddress.ip_network('197.234.114.0/28'),
ipaddress.ip_network('197.234.117.88/29'),
ipaddress.ip_network('197.234.118.0/23'),
ipaddress.ip_network('197.234.120.0/24'),
ipaddress.ip_network('197.234.122.0/23'),
ipaddress.ip_network('197.234.126.0/23'),
ipaddress.ip_network('197.241.128.0/17'),
ipaddress.ip_network('204.8.204.0/24'),
ipaddress.ip_network('206.237.76.0/24'),
ipaddress.ip_network('206.237.78.0/24'),
ipaddress.ip_network('212.96.25.0/24')
]
for ipv4_range in ipv4_ranges_angola:
if ipaddress.ip_address(ip) in ipv4_range:
return True
return False
# Função para ler o arquivo de entrada e extrair os endereços IP que não estão dentro do intervalo de Portugal ou Angola
def extract_non_portugal_angola_ipv4(input_file, output_file):
with open(input_file, 'r') as infile, open(output_file, 'w') as outfile:
for line in infile:
ip = line.strip()
if not (is_portugal_ipv4(ip) or is_angola_ipv4(ip)):
outfile.write(ip + '\n')
# Verifica se os argumentos foram fornecidos corretamente
if len(sys.argv) != 3:
print("Uso: python script.py arquivo_entrada arquivo_saida")
sys.exit(1)
input_file = sys.argv[1]
output_file = sys.argv[2]
# Chama a função para extrair os endereços IP
extract_non_portugal_angola_ipv4(input_file, output_file)
print("Endereços IP fora do intervalo de IPv4 de Portugal e Angola foram extraídos para", output_file)
Last updated