2024-11-28 12:19:28 +03:00

20 lines
466 B
Python

import os
import socket
import traceback
data = open('ips.txt').read().splitlines()
f = open('gips.txt','w')
for it in data:
try:
hostname = socket.gethostbyaddr(it)
hs = hostname[0].lower()
if hs.startswith('rate') and hs.endswith('google.com'):
print(f'GootHost {hs} ip: {it}')
f.write(f'{it}\n')
except:
print(traceback.format_exc())
hostname=''
print(f'{it} -- {hostname}')