-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_com_dictionary.py
51 lines (41 loc) · 1.04 KB
/
dot_com_dictionary.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import socket
import sys
import whois
import socks
socket.setdefaulttimeout(2)
sockproto = socket.AF_INET6
s = socks.socksocket(sockproto)
s.settimeout(2)
i = 0
en_dictionary = open('words_alpha.txt')
file_output = open('dot_coms.txt', 'a')
for line in en_dictionary:
i += 1
# if i == 100:
# break
word = line.splitlines()
url = word[0] + '.com'
try:
whois.whois(url)
except whois.parser.PywhoisError:
file_output.write(word[0] + '\n')
print(i)
# print(word)
except socket.timeout:
file_output.write(word[0] + ' TIMEOUT' + '\n')
print(i)
# print(word, " TIMEOUT")
continue
# if not resp.name:
# print(word)
# else:
# pass
# print(resp.name)
# resp = subprocess.call(['ping', '-l', '2', '-n', '2', '-w', '3', url])
#
# if resp == 1:
# print(word)
en_dictionary.close()
file_output.close()
sys.exit(0)
# WIP: Ping every *.com domain name in the english dictionary to check which ones are still unclaimed