garfbot/garfpy/iputils.py
2024-10-05 16:50:19 +00:00

20 lines
526 B
Python

import ipaddress
def is_private(target):
try:
ip_obj = ipaddress.ip_address(target)
if ip_obj.is_private:
return True
except ValueError:
if "crate.lan" in target.lower():
return True
if "crate.zip" in target.lower():
return True
if "memtec.org" in target.lower():
return True
if "crateit.net" in target.lower():
return True
if "garfbot.art" in target.lower():
return True
return False