From f7d76c8ca1504b61c2b666289a96a866c2f1920d Mon Sep 17 00:00:00 2001 From: z-alami <89426041+z-alami@users.noreply.github.com> Date: Tue, 26 Jul 2022 23:44:46 +0000 Subject: [PATCH] using ipadress module, using ipadress module to find all private address ranges instead of '192.168.0.0/8'. --- ipGeo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipGeo.py b/ipGeo.py index 117785b..0dbc1d6 100644 --- a/ipGeo.py +++ b/ipGeo.py @@ -3,6 +3,7 @@ import requests import csv from colorama import Fore from datetime import date +import ipaddress def read_pcap(pcap_file): ips = [] @@ -24,7 +25,7 @@ def ips_list(ips): ips_lists = [] aborted_ips = [] for ip in ips : - if ip not in ips_lists and '192.168.' not in ip: + if ip not in ips_lists and ipaddress.ip_address(ip).is_global: ips_lists.append(ip) elif ip not in aborted_ips and '192.168.' in ip: aborted_ips.append(ip)