本文整理汇总了Python中Core.Utils.Refactor.get_interfaces方法的典型用法代码示例。如果您正苦于以下问题:Python Refactor.get_interfaces方法的具体用法?Python Refactor.get_interfaces怎么用?Python Refactor.get_interfaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.Utils.Refactor
的用法示例。
在下文中一共展示了Refactor.get_interfaces方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: refrash_interface
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def refrash_interface(self):
self.ComboIface.clear()
n = Refactor.get_interfaces()["all"]
for i, j in enumerate(n):
if search("at", j) or search("wlan", j):
self.ComboIface.addItem(n[i])
self.discoveryIface()
示例2: refrash_interface
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def refrash_interface(self):
self.ComboIface.clear()
n = Refactor.get_interfaces()['all']
for i,j in enumerate(n):
if search('at',j) or search('wl',j):
self.ComboIface.addItem(n[i])
self.discoveryIface()
示例3: __init__
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def __init__(self,parent=None,*args):
super(PumpkinModule, self).__init__(parent)
self.setWindowIcon(QIcon('Icons/icon.ico'))
self.module_network = Refactor
self.configure = frm_Settings()
self.Ftemplates = frm_PhishingManager()
self.interfaces = Refactor.get_interfaces()
示例4: D_attack
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def D_attack(self):
interface = Refactor.get_interfaces()['activated']
if interface != None:
self.check.setText("[ ON ]")
self.check.setStyleSheet("QLabel { color : green; }")
self.threadstar = ThreadAttackStar(interface)
self.connect(self.threadstar,SIGNAL("Activated ( QString )"),self.getloggerAttack)
self.threadstar.setObjectName("DHCP Starvation")
self.threadstar.start()
return
QMessageBox.information(self, 'Interface Not found', 'None detected network interface try again.')
示例5: __init__
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def __init__(self, parent=None):
super(frm_Arp_Poison, self).__init__(parent)
self.setWindowTitle('Arp Posion Attack ')
self.setWindowIcon(QIcon('rsc/icon.ico'))
self.Main = QVBoxLayout()
self.owd = getcwd()
self.control = False
self.interfaces = Refactor.get_interfaces()
self.configure = frm_Settings()
self.Ftemplates = frm_PhishingManager()
self.module_network = Refactor
self.loadtheme(self.configure.XmlThemeSelected())
self.data = {'IPaddress':[], 'Hostname':[], 'MacAddress':[]}
self.ThreadDirc = {'Arp_posion':[]}
global threadloading
self.GUI()
示例6: mConfigure
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def mConfigure(self):
self.get_interfaces = Refactor.get_interfaces()
try:
self.EditGateway.setText(
[self.get_interfaces[x] for x in self.get_interfaces.keys() if x == 'gateway'][0])
except:pass
self.EditApName.setText(self.FSettings.Settings.get_setting('accesspoint','APname'))
self.EditChannel.setText(self.FSettings.Settings.get_setting('accesspoint','channel'))
self.ConfigTwin['PortRedirect'] = self.FSettings.redirectport.text()
for i,j in enumerate(self.get_interfaces['all']):
if search('wl', j):self.selectCard.addItem(self.get_interfaces['all'][i])
driftnet = popen('which driftnet').read().split('\n')
ettercap = popen('which ettercap').read().split('\n')
dhcpd = popen('which dhcpd').read().split("\n")
dnsmasq = popen('which dnsmasq').read().split("\n")
hostapd = popen('which hostapd').read().split("\n")
lista = [ '/usr/sbin/airbase-ng', ettercap[0],driftnet[0],dhcpd[0],dnsmasq[0],hostapd[0]]
for i in lista:self.ConfigTwin['ProgCheck'].append(path.isfile(i))
示例7: MacGUI
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def MacGUI(self):
self.form_mac = QFormLayout()
self.i_mac = QLineEdit(self)
self.combo_card = QComboBox(self)
self.btn_random = QPushButton("Random MAC")
self.btn_random.setIcon(QIcon("rsc/refresh.png"))
self.btn_save = QPushButton("Save")
self.btn_save.setIcon(QIcon("rsc/Save.png"))
self.btn_save.clicked.connect(self.change_macaddress)
self.btn_random.clicked.connect(self.action_btn_random)
self.cards = Refactor.get_interfaces()['all']
self.combo_card.addItems(self.cards)
self.connect(self.combo_card, SIGNAL('activated(QString)'), self.combo_clicked)
self.form_mac.addRow(self.combo_card,self.i_mac)
self.form_mac.addRow("MAC Random: ", self.btn_random)
self.form_mac.addRow(self.btn_save)
self.Main.addLayout(self.form_mac)
self.setLayout(self.Main)
示例8: mConfigure
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def mConfigure(self):
self.get_interfaces = Refactor.get_interfaces()
try:
self.EditGateway.setText([self.get_interfaces[x] for x in self.get_interfaces.keys() if x == "gateway"][0])
except:
pass
self.EditApName.setText(self.FSettings.xmlSettings("AP", "name", None, False))
self.EditChannel.setText(self.FSettings.xmlSettings("channel", "mchannel", None, False))
self.ConfigTwin["PortRedirect"] = self.FSettings.redirectport.text()
for i, j in enumerate(self.get_interfaces["all"]):
if search("wlan", j):
self.selectCard.addItem(self.get_interfaces["all"][i])
driftnet = popen("which driftnet").read().split("\n")
ettercap = popen("which ettercap").read().split("\n")
dhcpd = popen("which dhcpd").read().split("\n")
dnsmasq = popen("which dnsmasq").read().split("\n")
hostapd = popen("which hostapd").read().split("\n")
lista = ["/usr/sbin/airbase-ng", ettercap[0], driftnet[0], dhcpd[0], dnsmasq[0], hostapd[0]]
for i in lista:
self.ConfigTwin["ProgCheck"].append(path.isfile(i))
示例9: StartApFake
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def StartApFake(self):
if len(self.selectCard.currentText()) == 0:
return QMessageBox.warning(self,'Error interface ','Network interface is not found')
if not type(self.SoftDependencies()) is bool: return
self.interfacesLink = Refactor.get_interfaces()
if len(self.EditGateway.text()) == 0 or self.interfacesLink['activated'] == None:
return QMessageBox.warning(self,'Internet Connection','No internet connection not found, '
'sorry WiFi-Pumpkin tool requires an internet connection to mount MITM attack. '
'check your connection and try again')
if str(self.selectCard.currentText()) == self.interfacesLink['activated']:
iwconfig = Popen(['iwconfig'], stdout=PIPE,shell=False,stderr=PIPE)
for line in iwconfig.stdout.readlines():
if str(self.selectCard.currentText()) in line:
return QMessageBox.warning(self,'Wireless Interface',
'An connection with {} has been detected '
' : Device or resource busy\n{}'.format(
str(self.selectCard.currentText()),line))
import platform
if platform.dist()[0] == 'Kali':
if str(self.interfacesLink['activated']).startswith('wl'):
return QMessageBox.information(self,'Error network card',
'You are connected with interface wireless, try again with local connection')
dh, gateway = self.PumpSettingsTAB.getPumpkinSettings()['router'],str(self.EditGateway.text())
if dh[:len(dh)-len(dh.split('.').pop())] == gateway[:len(gateway)-len(gateway.split('.').pop())]:
return QMessageBox.warning(self,'DHCP Server Settings',
'The DHCP server check if range ip class is same.'
'it works, but not share internet connection in some case.\n'
'for fix this, You need change on tab (Pumpkin-Settings -> Class Ranges)'
'now you have choose the Class range different of your network.')
self.btn_start_attack.setDisabled(True)
popen('ulimit -n 64000')
self.APactived = self.FSettings.Settings.get_setting('accesspoint','using')
if self.APactived == 'hostapd':
self.ConfigTwin['AP_iface'] = str(self.selectCard.currentText())
if str(self.interfacesLink['activated']).startswith('eth') or \
str(self.interfacesLink['activated']).startswith('enp'):
try:
check_output(['nmcli','radio','wifi',"off"])
except Exception:
try:
check_output(['nmcli','nm','wifi',"off"])
except Exception as e:
return QMessageBox.warning(self,'Error nmcli',e)
finally:
call(['rfkill', 'unblock' ,'wifi'])
elif str(self.interfacesLink['activated']).startswith('wl'):
if not Refactor.settingsNetworkManager(self.ConfigTwin['AP_iface'],Remove=False):
return QMessageBox.warning(self,'Network Manager',
'Not found file NetworkManager.conf in folder /etc/NetworkManager/')
leases = '/var/lib/dhcp/dhcpd.leases'
if not path.exists(leases[:-12]):
mkdir(leases[:-12])
if not path.isfile(leases):
with open(leases,'wb') as leaconf:
leaconf.close()
uid = getpwnam('root').pw_uid
gid = getgrnam('root').gr_gid
chown(leases, uid, gid)
self.CoreSettings()
ignore = ('interface=','ssid=','channel=')
with open('Settings/hostapd.conf','w') as apconf:
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
popen('ifconfig {} up'.format(str(self.selectCard.currentText())))
selected_dhcp = self.FSettings.Settings.get_setting('accesspoint','dhcp_server')
if selected_dhcp == 'iscdhcpserver':
Thread_dhcp = ThRunDhcp(['sudo','dhcpd','-d','-f','-lf','/var/lib/dhcp/dhcpd.leases','-cf',
'/etc/dhcp/dhcpd.conf',self.ConfigTwin['AP_iface']])
Thread_dhcp.sendRequest.connect(self.GetDHCPRequests)
Thread_dhcp.setObjectName('DHCP')
self.Apthreads['RougeAP'].append(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)
#.........这里部分代码省略.........
示例10: refrash_interface
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def refrash_interface(self):
self.selectCard.clear()
n = Refactor.get_interfaces()['all']
for i,j in enumerate(n):
if search('wl', j):
self.selectCard.addItem(n[i])
示例11: StartApFake
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def StartApFake(self):
if len(self.selectCard.currentText()) == 0:
return QMessageBox.warning(self, "Error interface", "Network interface not supported :(")
if len(self.EditGateway.text()) == 0:
return QMessageBox.warning(self, "Error Gateway", "gateway not found")
if not self.ConfigTwin["ProgCheck"][5]:
return QMessageBox.information(self, "Error Hostapd", "hostapd not installed")
dhcp_select = self.FSettings.xmlSettings("dhcp", "dhcp_server", None, False)
if dhcp_select == "iscdhcpserver":
if not self.ConfigTwin["ProgCheck"][3]:
return QMessageBox.warning(self, "Error dhcp", "isc-dhcp-server not installed")
elif dhcp_select == "dnsmasq":
if not self.ConfigTwin["ProgCheck"][4]:
return QMessageBox.information(self, "Error dhcp", "dnsmasq not installed")
if str(Refactor.get_interfaces()["activated"]).startswith("wlan"):
return QMessageBox.information(
self, "Error network card", "You are connected with interface wireless, try again with local connection"
)
self.btn_start_attack.setDisabled(True)
self.APactived = self.FSettings.xmlSettings("accesspoint", "actived", None, False)
if self.APactived == "airbase-ng":
self.ConfigTwin["interface"] = str(set_monitor_mode(self.selectCard.currentText()).setEnable())
self.FSettings.xmlSettings("interface", "monitor_mode", self.ConfigTwin["interface"], False)
# airbase thread
Thread_airbase = ProcessThread(
[
"airbase-ng",
"-c",
str(self.EditChannel.text()),
"-e",
self.EditApName.text(),
"-F",
"Logs/Caplog/" + asctime(),
self.ConfigTwin["interface"],
]
)
Thread_airbase.name = "Airbase-ng"
self.Apthreads["RougeAP"].append(Thread_airbase)
Thread_airbase.start()
# settings
while True:
if Thread_airbase.iface != None:
self.ConfigTwin["AP_iface"] = [x for x in Refactor.get_interfaces()["all"] if search("at", x)][0]
self.FSettings.xmlSettings("netcreds", "interface", self.ConfigTwin["AP_iface"], False)
break
self.CoreSettings()
elif self.APactived == "hostapd":
self.FSettings.xmlSettings("netcreds", "interface", str(self.selectCard.currentText()), False)
self.ConfigTwin["AP_iface"] = str(self.selectCard.currentText())
try:
check_output(["nmcli", "radio", "wifi", "off"])
except CalledProcessError:
try:
check_output(["nmcli", "nm", "wifi", "off"])
except CalledProcessError as e:
return QMessageBox.warning(self, "Error nmcli", e)
call(["rfkill", "unblock", "wlan"])
self.CoreSettings()
ignore = ("interface=", "ssid=", "channel=")
with open("Settings/hostapd.conf", "w") as apconf:
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)
self.Thread_hostapd.start()
# thread dhcp
selected_dhcp = self.FSettings.xmlSettings("dhcp", "dhcp_server", None, False)
if selected_dhcp == "iscdhcpserver":
Thread_dhcp = ThRunDhcp(
[
"sudo",
"dhcpd",
"-d",
"-f",
"-lf",
"Settings/dhcp/dhcpd.leases",
"-cf",
"/etc/dhcp/dhcpd.conf",
self.ConfigTwin["AP_iface"],
]
)
Thread_dhcp.sendRequest.connect(self.GetDHCPRequests)
Thread_dhcp.setObjectName("DHCP")
self.Apthreads["RougeAP"].append(Thread_dhcp)
Thread_dhcp.start()
##### 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)
#.........这里部分代码省略.........
示例12: refrash_interface
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def refrash_interface(self):
self.get_placa.clear()
n = Refactor.get_interfaces()['all']
for i,j in enumerate(n):
if search('wlan', j):
self.get_placa.addItem(n[i])
示例13: loadCard
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def loadCard(self):
n = Refactor.get_interfaces()['all']
for i,j in enumerate(n):
if search("wlan", j):
self.get_placa.addItem(n[i])
示例14: refresh_interface
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def refresh_interface(self,cb):
cb.clear()
n = Refactor.get_interfaces()['all']
for i,j in enumerate(n):
if n[i] != '':
cb.addItem(n[i])
示例15: StartApFake
# 需要导入模块: from Core.Utils import Refactor [as 别名]
# 或者: from Core.Utils.Refactor import get_interfaces [as 别名]
def StartApFake(self):
if len(self.selectCard.currentText()) == 0:
return QMessageBox.warning(self,'Error interface ','Network interface is not found')
if len(self.EditGateway.text()) == 0:
return QMessageBox.warning(self,'Error Gateway','gateway is not found')
if not self.ConfigTwin['ProgCheck'][5]:
return QMessageBox.information(self,'Error Hostapd','hostapd is not installed')
dhcp_select = self.FSettings.xmlSettings('dhcp','dhcp_server',None,False)
if dhcp_select == 'iscdhcpserver':
if not self.ConfigTwin['ProgCheck'][3]:
return QMessageBox.warning(self,'Error dhcp','isc-dhcp-server is not installed')
elif dhcp_select == 'dnsmasq':
if not self.ConfigTwin['ProgCheck'][4]:
return QMessageBox.information(self,'Error dhcp','dnsmasq is not installed')
if str(Refactor.get_interfaces()['activated']).startswith('wl'):
return QMessageBox.information(self,'Error network card',
'You are connected with interface wireless, try again with local connection')
self.btn_start_attack.setDisabled(True)
self.APactived = self.FSettings.xmlSettings('accesspoint','actived',None,False)
if self.APactived == 'airbase-ng':
self.ConfigTwin['interface'] = str(set_monitor_mode(self.selectCard.currentText()).setEnable())
self.FSettings.xmlSettings('interface', 'monitor_mode',self.ConfigTwin['interface'],False)
# airbase thread
Thread_airbase = ProcessThread(['airbase-ng',
'-c', str(self.EditChannel.text()), '-e', self.EditApName.text(),
'-F', 'Logs/Caplog/'+asctime(),self.ConfigTwin['interface']])
Thread_airbase.name = 'Airbase-ng'
self.Apthreads['RougeAP'].append(Thread_airbase)
Thread_airbase.start()
# settings
while True:
if Thread_airbase.iface != None:
self.ConfigTwin['AP_iface'] = [x for x in Refactor.get_interfaces()['all'] if search('at',x)][0]
self.FSettings.xmlSettings('netcreds', 'interface',self.ConfigTwin['AP_iface'],False)
break
self.CoreSettings()
elif self.APactived == 'hostapd':
self.FSettings.xmlSettings('netcreds','interface',
str(self.selectCard.currentText()),False)
self.ConfigTwin['AP_iface'] = str(self.selectCard.currentText())
try:
check_output(['nmcli','radio','wifi',"off"])
except CalledProcessError:
try:
check_output(['nmcli','nm','wifi',"off"])
except CalledProcessError as e:
return QMessageBox.warning(self,'Error nmcli',e)
call(['rfkill', 'unblock' ,'wifi'])
self.CoreSettings()
ignore = ('interface=','ssid=','channel=')
with open('Settings/hostapd.conf','w') as apconf:
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)
self.Thread_hostapd.start()
# thread dhcp
selected_dhcp = self.FSettings.xmlSettings('dhcp','dhcp_server',None,False)
if selected_dhcp == 'iscdhcpserver':
Thread_dhcp = ThRunDhcp(['sudo','dhcpd','-d','-f','-lf','Settings/dhcp/dhcpd.leases','-cf',
'/etc/dhcp/dhcpd.conf',self.ConfigTwin['AP_iface']])
Thread_dhcp.sendRequest.connect(self.GetDHCPRequests)
Thread_dhcp.setObjectName('DHCP')
self.Apthreads['RougeAP'].append(Thread_dhcp)
Thread_dhcp.start()
##### 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()
else:return QMessageBox.information(self,'DHCP',selected_dhcp + ' not found.')
self.Started(True)
self.ProxyPluginsTAB.GroupSettings.setEnabled(False)
self.FSettings.xmlSettings('statusAP','value','True',False)
if self.FSettings.check_redirect.isChecked() or not self.PopUpPlugins.check_sslstrip.isChecked():
popen('iptables -t nat -A PREROUTING -p udp -j DNAT --to {}'.format(str(self.EditGateway.text())))
self.FSettings.xmlSettings('sslstrip_plugin','status','False',False)
self.PopUpPlugins.check_sslstrip.setChecked(False)
self.PopUpPlugins.unset_Rules('sslstrip')
if self.PopUpPlugins.check_sslstrip.isChecked() or not self.PopUpPlugins.check_dns2proy.isChecked():
popen('iptables -t nat -A PREROUTING -p udp -j DNAT --to {}'.format(str(self.EditGateway.text())))
# load ProxyPLugins
self.plugin_classes = Plugin.PluginProxy.__subclasses__()
self.plugins = {}
for p in self.plugin_classes:
self.plugins[p._name] = p()
# thread plugins
#.........这里部分代码省略.........