forked from Cl0udG0d/SZhe_Scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DomainMessage.py
84 lines (74 loc) · 2.91 KB
/
DomainMessage.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
import GetMessage
from Init import redispool
class DomainMessage:
def __init__(self, domain):
self.domain = domain
self.redispool = redispool
self.TrueDomain = self.domain.split('.', 1)[1]
def GetSubDomain(self):
redispool.append("runlog", "正在使用主动与被动方式获取{}目标子域名!\n".format(self.domain))
print("正在使用主动与被动方式获取目标子域名!")
try:
SubDomainBurst = GetMessage.SubDomainBurst(self.TrueDomain, self.redispool)
SubDomainOnline = GetMessage.GetSubDomain(self.domain)
SubDomain = SubDomainBurst + SubDomainOnline
return SubDomain
except Exception as e:
print(e)
return "None"
def GetWhoisMessage(self):
redispool.append("runlog", "正在获取网站{}Whois信息!\n".format(self.domain))
print("正在获取网站Whois信息!")
try:
return GetMessage.GetWhois(self.TrueDomain)
except Exception as e:
print(e)
return "None"
def GetBindingIP(self):
redispool.append("runlog", "正在获取{}域名历史解析记录 :D\n".format(self.domain))
print("正在获取域名历史解析记录 :D")
try:
return GetMessage.GetBindingIP(self.domain)
except Exception as e:
print(e)
return "None"
def GetSiteStation(self):
redispool.append("runlog", "正在进行{}旁站查询 :)\n".format(self.domain))
print("正在进行旁站查询 :)")
try:
return GetMessage.GetSiteStation(self.domain)
except Exception as e:
print(e)
return "None"
def GetRecordInfo(self):
redispool.append("runlog", "正在获取{}域名的公开备案信息 :-)\n".format(self.domain))
print("正在获取域名的公开备案信息 :-)")
try:
return GetMessage.GetRecordInfo(self.domain)
except Exception as e:
print(e)
return "None"
def FindDomainAdd(self):
redispool.append("runlog", "正在获取{}域名映射的真实地址!\n".format(self.domain))
print("正在获取域名映射的真实地址!")
if "/" in self.domain:
host=self.domain.split("/")[0]
else:
host=self.domain
try:
return GetMessage.FindDomainAdd(host)
except Exception as e:
print(e)
return "None"
if __name__ == '__main__':
test = DomainMessage("www.nowcoder.com")
try:
print(test.GetSiteStation())
print(test.GetBindingIP())
print(test.GetWhoisMessage())
print(test.GetRecordInfo())
print(test.FindDomainAdd())
print(test.GetSubDomain())
except Exception as e:
print(e)
pass