本文整理汇总了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()))
示例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))