当前位置: 首页>>代码示例>>Python>>正文


Python Refactor.check_is_mac方法代码示例

本文整理汇总了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())))
开发者ID:BrunoDB,项目名称:WiFi-Pumpkin,代码行数:49,代码来源:Main.py

示例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())))
开发者ID:apcwowo,项目名称:WiFi-Pumpkin,代码行数:47,代码来源:Main.py

示例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.")
开发者ID:apcwowo,项目名称:WiFi-Pumpkin,代码行数:11,代码来源:WirelessDeauth.py

示例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)
开发者ID:apcwowo,项目名称:WiFi-Pumpkin,代码行数:17,代码来源:WirelessDeauth.py

示例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 = []
开发者ID:apcwowo,项目名称:WiFi-Pumpkin,代码行数:26,代码来源:WirelessDeauth.py


注:本文中的Core.Utils.Refactor.check_is_mac方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。