2022-09-15 17:54:30 +03:00
|
|
|
import socket
|
|
|
|
from collections import defaultdict
|
|
|
|
from utils import prettyprint
|
|
|
|
|
|
|
|
ips = []
|
|
|
|
dict = defaultdict(list)
|
|
|
|
|
2022-09-16 18:15:04 +03:00
|
|
|
def main(file_data: list):
|
|
|
|
for line in open('domains.txt'):
|
|
|
|
l = line.strip()
|
2022-09-15 17:54:30 +03:00
|
|
|
|
2022-09-16 18:15:04 +03:00
|
|
|
if l.startswith('#') or l == '':
|
|
|
|
continue
|
2022-09-15 17:54:30 +03:00
|
|
|
|
2022-09-16 18:15:04 +03:00
|
|
|
dict[socket.gethostbyname(l) + '/32'].append(l)
|
2022-09-15 17:54:30 +03:00
|
|
|
|
2022-09-16 18:15:04 +03:00
|
|
|
ips = list(dict.keys())
|
2022-09-15 17:54:30 +03:00
|
|
|
|
2022-09-16 18:15:04 +03:00
|
|
|
for ip in ips:
|
|
|
|
file_data.append(prettyprint(ip, ', '.join(dict[ip])) + '\n')
|
|
|
|
|
|
|
|
return file_data
|