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


Python Refactor.get_interface_mac方法代码示例

本文整理汇总了Python中Core.Utils.Refactor.get_interface_mac方法的典型用法代码示例。如果您正苦于以下问题:Python Refactor.get_interface_mac方法的具体用法?Python Refactor.get_interface_mac怎么用?Python Refactor.get_interface_mac使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Core.Utils.Refactor的用法示例。


在下文中一共展示了Refactor.get_interface_mac方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: StartApFake

# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interface_mac [as 别名]

#.........这里部分代码省略.........
                for i in self.SettingsAP['hostapd']:apconf.write(i)
                for config in str(self.FSettings.ListHostapd.toPlainText()).split('\n'):
                    if not config.startswith('#') and len(config) > 0:
                        if not config.startswith(ignore):
                            apconf.write(config+'\n')
                apconf.close()
            self.Thread_hostapd = ProcessHostapd({'hostapd':['-d','Settings/hostapd.conf']})
            self.Thread_hostapd.setObjectName('hostapd')
            self.Thread_hostapd.statusAP_connected.connect(self.GetHostapdStatus)
            self.Apthreads['RougeAP'].append(self.Thread_hostapd)

        # thread dhcp
        print('[*] Configuring dhcpd...')
        popen('ifconfig {} up'.format(str(self.selectCard.currentText())))
        selected_dhcp = self.FSettings.Settings.get_setting('accesspoint','dhcp_server')
        if selected_dhcp == 'iscdhcpserver':
            self.Thread_dhcp = ThRunDhcp(['dhcpd','-d','-f','-lf','/var/lib/dhcp/dhcpd.leases','-cf',
            '/etc/dhcp/dhcpd.conf',self.ConfigTwin['AP_iface']])
            self.Thread_dhcp.sendRequest.connect(self.GetDHCPRequests)
            self.Thread_dhcp.setObjectName('DHCP')
            self.Apthreads['RougeAP'].append(self.Thread_dhcp)

        ##### dnsmasq disabled
        # elif selected_dhcp == 'dnsmasq':
        #     Thread_dhcp = ThRunDhcp(['dnsmasq','-C','Core/config/dnsmasq.conf','-d'])
        #     self.connect(Thread_dhcp ,SIGNAL('Activated ( QString ) '), self.dhcpLog)
        #     Thread_dhcp .setObjectName('DHCP')
        #     self.Apthreads['RougeAP'].append(Thread_dhcp)
        #     Thread_dhcp .start()
        self.Started(True)
        self.ProxyPluginsTAB.GroupSettings.setEnabled(False)
        self.FSettings.Settings.set_setting('accesspoint','statusAP',True)
        self.FSettings.Settings.set_setting('accesspoint','interfaceAP',str(self.selectCard.currentText()))


        # load ProxyPLugins
        self.plugin_classes = Plugin.PluginProxy.__subclasses__()
        self.plugins = {}
        for p in self.plugin_classes:
            self.plugins[p._name] = p()

        if self.PopUpPlugins.check_netcreds.isChecked():
            self.Thread_netcreds = ProcessThread({'python':['Plugins/net-creds/net-creds.py','-i',
            str(self.selectCard.currentText())]})
            self.Thread_netcreds.setObjectName('Net-Creds')
            self.Apthreads['RougeAP'].append(self.Thread_netcreds)

        if self.PopUpPlugins.check_dns2proy.isChecked():
            self.Thread_dns2proxy = ProcessThread({'python':['Plugins/dns2proxy/dns2proxy.py','-i',
            str(self.selectCard.currentText())]})
            self.Thread_dns2proxy.setObjectName('Dns2Proxy')
            self.Apthreads['RougeAP'].append(self.Thread_dns2proxy)

        # thread plugins
        if self.PopUpPlugins.check_dns2proy.isChecked():
            self.Threadsslstrip = Thread_sslstrip(self.ConfigTwin['PortRedirect'],
            self.plugins,self.ProxyPluginsTAB._PluginsToLoader)
            self.Threadsslstrip.setObjectName("sslstrip2")
            self.Apthreads['RougeAP'].append(self.Threadsslstrip)

        elif self.PopUpPlugins.check_sergioProxy.isChecked():
            self.Threadsslstrip = Thread_sergioProxy(self.ConfigTwin['PortRedirect'],
            self.plugins,self.ProxyPluginsTAB._PluginsToLoader)
            self.Threadsslstrip.setObjectName("sslstrip")
            self.Apthreads['RougeAP'].append(self.Threadsslstrip)


        iptables = []
        for index in xrange(self.FSettings.ListRules.count()):
           iptables.append(str(self.FSettings.ListRules.item(index).text()))
        for rules in iptables:
            if search('--append FORWARD --in-interface',
            rules):popen(rules.replace('$$',self.ConfigTwin['AP_iface']))
            elif search('--append POSTROUTING --out-interface',rules):
                popen(rules.replace('$$',str(Refactor.get_interfaces()['activated'])))
            else:popen(rules)

        #self.PumpSettingsTAB.GroupArea.setEnabled(False)
        self.progress.change_color('#FFA500')
        for thread in self.Apthreads['RougeAP']:
            self.progress.update_bar_simple(20)
            QThread.sleep(3)
            thread.start()
        self.progress.setValue(100)
        self.progress.change_color('#FFA500')
        self.progress.setText('')
        if self.FSettings.Settings.get_setting('dockarea','advanced',format=bool):
            QThread.sleep(3)
            self.PumpSettingsTAB.doCheckAdvanced()
            if hasattr(self,'dockAreaList'):
                print('-------------------------------')
                filelist = [ f for f in listdir('Logs/AccessPoint/.') if f.endswith('.log.offset') ]
                for f in filelist: system('rm Logs/AccessPoint/{}'.format(f))
                for dock in self.dockAreaList.keys():
                    self.dockAreaList[dock].RunThread()
        if self.PopUpPlugins.check_noproxy.isChecked() or self.PopUpPlugins.check_sergioProxy.isChecked():
            popen('iptables -t nat -A PREROUTING -p udp -j DNAT --to {}'.format(str(self.EditGateway.text())))
        print('AP::[{}] Running...'.format(self.EditApName.text()))
        print('AP::BSSID::[{}] CH {}'.format(Refactor.get_interface_mac(
        self.selectCard.currentText()),self.EditChannel.text()))
开发者ID:BraianNunes,项目名称:WiFi-Pumpkin,代码行数:104,代码来源:Main.py

示例2: combo_clicked

# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interface_mac [as 别名]
 def combo_clicked(self, device):
     if device == '':
         self.i_mac.setText('Not Found')
         return
     self.i_mac.setText(Refactor.get_interface_mac(device))
开发者ID:apcwowo,项目名称:WiFi-Pumpkin,代码行数:7,代码来源:Macchanger.py


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