-
Notifications
You must be signed in to change notification settings - Fork 28
/
test.py
113 lines (103 loc) · 1.81 KB
/
test.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import whois
DOMAINS = '''
google.com
www.fsdfsdfsdfsd.google.com
google.org
google.net
google.pl
google.co
google.co.uk
google.jp
google.co.jp
google.de
google.cc
google.ru
google.us
google.eu,whois.markmonitor.com
google.me
google.be
google.biz
google.info
google.it
google.cz
google.fr
google.lv
google.kz
google.by
google.am
google.com.ua
google.kg
google.help
google.tv
google.link
google.com.sg
e2e4.online,whois.nic.ru
napaster.name,whois.nic.ru
XN--C1AAY4A.XN--P1AI
гугл.рф
nic.pw
nic.bid,whois.nic.bid
nic.host,whois.nic.host
nic.online,whois.nic.online
nic.party,whois.nic.party
nic.pro,whois.nic.pro
nic.review,whois.nic.review
nic.site,whois.nic.site
nic.space,whois.nic.space
nic.top,whois.nic.top
nic.website,whois.nic.website
nic.win,whois.nic.win
whois.aero
test.taxi
test.foundation
nic.ir
test.technology
test.im
nic.co.ua
nic.travel
google.ee
nic.company
nic.delivery
nic.services
nic.systems
nic.network
nic.cl
nic.company
nic.in
test.com.br
nic.ge,whois.nic.ge
nic.рус
whois.twnic.net.tw
nic.онлайн
nic.studio,whois.identitydigital.services
google.id
'''
def parse(data):
if "," in data:
data = data.split(',')
if len(data) == 1:
query(data[0])
elif len(data) == 2:
query(data[0], data[1])
else:
query(data)
def query(domain, host=None):
print('-' * 80)
print("Domain: {0}, host: {1}".format(domain, host))
w = whois.query(domain, host, ignore_returncode=1)
if w:
wd = w.__dict__
for k, v in wd.items():
print('%20s\t"%s"' % (k, v))
def main():
if len(sys.argv) > 1:
domains = sys.argv[1:]
else:
domains = DOMAINS.split('\n')
for data in domains:
if data: parse(data)
if __name__ == "__main__":
main()