forked from Cl0udG0d/SZhe_Scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIPMessage.py
54 lines (48 loc) · 1.43 KB
/
IPMessage.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
import get_message
import re
class IPMessage:
def __init__(self,ip):
self.ip=ip
def GetBindingIP(self):
print("正在进行IP历史解析记录!")
try:
return get_message.GetBindingIP(self.ip)
except Exception as e:
print(e)
return "None"
def GetSiteStation(self):
print("正在进行旁站查询!")
try:
return get_message.GetSiteStation(self.ip)
except Exception as e:
print(e)
return "None"
def CScanConsole(self):
print("正在进行C段信息搜集!")
try:
return get_message.CScanConsole(self.ip)
except Exception as e:
print(e)
return "Unknow"
def FindIpAdd(self):
print("正在查找IP地址查询")
try:
return get_message.FindIpAdd(self.ip)
except Exception as e:
print(e)
return "None"
if __name__=='__main__':
url="39.99.162.116:8000"
pattern = re.compile('^\d+\.\d+\.\d+\.\d+(:(\d+))?$')
# 判断IP是否存在端口
if pattern.findall(url) and ":" in url:
infourl = url.split(":")[0]
else:
infourl = url
print(infourl)
test=IPMessage(infourl)
print("end!")
print(test.GetBindingIP())
print(test.GetSiteStation())
print(test.CScanConsole())
print(test.FindIpAdd())