本文整理汇总了Python中Core.Utils.Refactor.check_is_mac方法的典型用法代码示例。如果您正苦于以下问题:Python Refactor.check_is_mac方法的具体用法?Python Refactor.check_is_mac怎么用?Python Refactor.check_is_mac使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.Utils.Refactor
的用法示例。
在下文中一共展示了Refactor.check_is_mac方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GetDHCPRequests
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import check_is_mac [as 别名]
def GetDHCPRequests(self,data):
if len(data) == 8:
if Refactor.check_is_mac(data[4]):
if data[4] not in self.APclients.keys():
self.APclients[data[4]] = {'IP': data[2],
'device': sub(r'[)|(]',r'',data[5]),'in_tables': False,}
self.StatusDHCPRequests(data[4],self.APclients[data[4]])
elif len(data) == 9:
if Refactor.check_is_mac(data[5]):
if data[5] not in self.APclients.keys():
self.APclients[data[5]] = {'IP': data[2],
'device': sub(r'[)|(]',r'',data[6]),'in_tables': False,}
self.StatusDHCPRequests(data[5],self.APclients[data[5]])
elif len(data) == 7:
if Refactor.check_is_mac(data[4]):
if data[4] not in self.APclients.keys():
leases = IscDhcpLeases('/var/lib/dhcp/dhcpd.leases')
hostname = None
try:
for item in leases.get():
if item.ethernet == data[4]:
hostname = item.hostname
if hostname == None:
item = leases.get_current()
hostname = item[data[4]]
except:
hostname = 'unknown'
if hostname == None:hostname = 'unknown'
self.APclients[data[4]] = {'IP': data[2],'device': hostname,
'in_tables': False,}
self.StatusDHCPRequests(data[4],self.APclients[data[4]])
Headers = []
for mac in self.APclients.keys():
if self.APclients[mac]['in_tables'] == False:
self.APclients[mac]['in_tables'] = True
self.THeaders['mac-address'].append(mac)
self.THeaders['ip-address'].append(self.APclients[mac]['IP'])
self.THeaders['device'].append(self.APclients[mac]['device'])
for n, key in enumerate(self.THeaders.keys()):
Headers.append(key)
for m, item in enumerate(self.THeaders[key]):
item = QTableWidgetItem(item)
item.setTextAlignment(Qt.AlignVCenter | Qt.AlignCenter)
self.TabInfoAP.setItem(m, n, item)
self.TabInfoAP.setHorizontalHeaderLabels(self.THeaders.keys())
self.connectedCount.setText(str(len(self.APclients.keys())))
示例2: GetDHCPRequests
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import check_is_mac [as 别名]
def GetDHCPRequests(self, data):
if len(data) == 8:
if Refactor.check_is_mac(data[4]):
if data[4] not in self.APclients.keys():
self.APclients[data[4]] = {"IP": data[2], "device": data[5], "in_tables": False}
self.StatusDHCPRequests(data[4])
elif len(data) == 9:
if Refactor.check_is_mac(data[5]):
if data[5] not in self.APclients.keys():
self.APclients[data[5]] = {"IP": data[2], "device": data[6], "in_tables": False}
self.StatusDHCPRequests(data[5])
elif len(data) == 7:
if Refactor.check_is_mac(data[4]):
if data[4] not in self.APclients.keys():
leases = IscDhcpLeases("Settings/dhcp/dhcpd.leases")
hostname = None
try:
for item in leases.get():
if item.ethernet == data[4]:
hostname = item.hostname
if hostname == None:
item = leases.get_current()
hostname = item[data[4]]
except:
hostname = "unknown"
if hostname == None:
hostname = "unknown"
self.APclients[data[4]] = {"IP": data[2], "device": hostname, "in_tables": False}
self.StatusDHCPRequests(data[4])
self.APclients[data[4]] = {"IP": data[2], "device": hostname, "in_tables": False}
Headers = []
for mac in self.APclients.keys():
if self.APclients[mac]["in_tables"] == False:
self.APclients[mac]["in_tables"] = True
self.THeaders["mac-address"].append(mac)
self.THeaders["ip-address"].append(self.APclients[mac]["IP"])
self.THeaders["device"].append(self.APclients[mac]["device"])
for n, key in enumerate(self.THeaders.keys()):
Headers.append(key)
for m, item in enumerate(self.THeaders[key]):
item = QTableWidgetItem(item)
item.setTextAlignment(Qt.AlignVCenter | Qt.AlignCenter)
self.TabInfoAP.setItem(m, n, item)
self.TabInfoAP.setHorizontalHeaderLabels(self.THeaders.keys())
self.connectedCount.setText(str(len(self.APclients.keys())))
示例3: list_clicked
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import check_is_mac [as 别名]
def list_clicked(self, index):
itms = self.list.selectedIndexes()
for i in itms:
attack = str(i.data().toString()).split()
for i in attack:
if Refactor.check_is_mac(i.replace(" ", "")):
self.linetarget.setText(str(i))
if self.linetarget.text() == "":
QMessageBox.information(self, "MacAddress", "Error check the Mac Target, please set the mac valid.")
示例4: monitorThreadScan
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import check_is_mac [as 别名]
def monitorThreadScan(self, apData):
apData = list(apData.split("|"))
if not str(apData[0]) in self.ApsCaptured.keys():
self.ApsCaptured[str(apData[0])] = apData
if Refactor.check_is_mac(str(apData[0])):
self.data["Channel"].append(self.ApsCaptured[str(apData[0])][1])
self.data["Essid"].append(self.ApsCaptured[str(apData[0])][2])
self.data["Bssid"].append(str(apData[0]))
Headers = []
for n, key in enumerate(self.data.keys()):
Headers.append(key)
for m, item in enumerate(self.data[key]):
item = QTableWidgetItem(item)
item.setTextAlignment(Qt.AlignVCenter | Qt.AlignCenter)
self.tables.setItem(m, n, item)
示例5: scan_diveces_airodump
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import check_is_mac [as 别名]
def scan_diveces_airodump(self):
dirpath = "Settings/Dump"
if not path.isdir(dirpath):
makedirs(dirpath)
self.data = {"Bssid": [], "Essid": [], "Channel": []}
exit_air = airdump_start(self.interface)
self.fix = False
if exit_air == None:
self.cap = get_network_scan()
if self.cap != None:
for i in self.cap:
i = i.split("||")
if Refactor.check_is_mac(i[2]):
Headers = []
self.data["Channel"].append(i[0])
self.data["Essid"].append(i[1])
self.data["Bssid"].append(i[2])
for n, key in enumerate(self.data.keys()):
Headers.append(key)
for m, item in enumerate(self.data[key]):
item = QTableWidgetItem(item)
item.setTextAlignment(Qt.AlignVCenter | Qt.AlignCenter)
self.tables.setItem(m, n, item)
self.cap = []