コード例 #1
0
ファイル: Main.py プロジェクト: Neykl/WiFi-Pumpkin
 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
0
ファイル: PopupModels.py プロジェクト: MGKhKhD/WiFi-Pumpkin
 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
0
ファイル: Main.py プロジェクト: apcwowo/WiFi-Pumpkin
 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()
コード例 #4
0
ファイル: PackagesUI.py プロジェクト: webkodex/WiFi-Pumpkin
 def __init__(self, parent=None, *args):
     super(PumpkinModule, self).__init__(parent)
     self.setWindowIcon(QIcon('rsc/icon.ico'))
     self.module_network = Refactor
     self.configure = frm_Settings()
     self.Ftemplates = frm_PhishingManager()
     self.interfaces = Refactor.get_interfaces()
コード例 #5
0
 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('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))
コード例 #6
0
 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()
コード例 #7
0
 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.')
コード例 #8
0
 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.')
コード例 #9
0
ファイル: ArpPosion.py プロジェクト: Neykl/WiFi-Pumpkin
 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()
コード例 #10
0
ファイル: ArpPosion.py プロジェクト: apcwowo/WiFi-Pumpkin
 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()
コード例 #11
0
ファイル: Macchanger.py プロジェクト: apcwowo/WiFi-Pumpkin
 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)
コード例 #12
0
ファイル: Main.py プロジェクト: BrunoDB/WiFi-Pumpkin
 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))
コード例 #13
0
ファイル: Macchanger.py プロジェクト: Neykl/WiFi-Pumpkin
 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)
コード例 #14
0
ファイル: Main.py プロジェクト: apcwowo/WiFi-Pumpkin
 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))
コード例 #15
0
ファイル: UpdateFake.py プロジェクト: Neykl/WiFi-Pumpkin
 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])
コード例 #16
0
ファイル: Main.py プロジェクト: Neykl/WiFi-Pumpkin
 def refrash_interface(self):
     self.selectCard.clear()
     n = Refactor.get_interfaces()['all']
     for i,j in enumerate(n):
         if search('wlan', j):
             self.selectCard.addItem(n[i])
コード例 #17
0
ファイル: Main.py プロジェクト: MGKhKhD/WiFi-Pumpkin
    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
        if self.PopUpPlugins.check_sslstrip.isChecked() and not self.PopUpPlugins.check_sergioProxy.isChecked():
            self.Threadsslstrip = Thread_sslstrip(self.ConfigTwin['PortRedirect'],
            self.plugins,self.ProxyPluginsTAB._PluginsToLoader)
            self.Threadsslstrip.setObjectName("sslstrip")
            self.Apthreads['RougeAP'].append(self.Threadsslstrip)
            self.Threadsslstrip.start()

        elif not self.PopUpPlugins.check_sslstrip.isChecked() and 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)
            self.Threadsslstrip.start()

        elif self.PopUpPlugins.check_sergioProxy.isChecked() and 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)
            self.Threadsslstrip.start()


        if self.PopUpPlugins.check_netcreds.isChecked():
            Thread_netcreds = ProcessThread(['python','Plugins/net-creds/net-creds.py','-i',
            self.FSettings.xmlSettings('netcreds', 'interface',None,False)])
            Thread_netcreds.setName('Net-Creds')
            self.Apthreads['RougeAP'].append(Thread_netcreds)
            Thread_netcreds.start()

        if self.PopUpPlugins.check_dns2proy.isChecked():
            Thread_dns2proxy = ProcessThread(['python','Plugins/dns2proxy/dns2proxy.py'])
            Thread_dns2proxy.setName('Dns2Proxy')
            self.Apthreads['RougeAP'].append(Thread_dns2proxy)
            Thread_dns2proxy.start()

        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)
コード例 #18
0
 def loadCard(self):
     n = Refactor.get_interfaces()['all']
     for i, j in enumerate(n):
         if search("wlan", j):
             self.get_placa.addItem(n[i])
コード例 #19
0
ファイル: UpdateFake.py プロジェクト: apcwowo/WiFi-Pumpkin
 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])
コード例 #20
0
    def window_qt(self):
        self.mForm = QFormLayout()
        self.statusbar = QStatusBar()
        system = QLabel("Deauthentication::")
        self.statusbar.addWidget(system)
        self.Controlador = QLabel("")
        self.AttackStatus(False)

        self.tables = QTableWidget(5,3)
        self.tables.setFixedWidth(350)
        self.tables.setRowCount(100)
        self.tables.setFixedHeight(250)
        self.tables.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tables.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.tables.clicked.connect(self.select_target)
        self.tables.resizeColumnsToContents()
        self.tables.resizeRowsToContents()
        self.tables.horizontalHeader().resizeSection(1,120)
        self.tables.horizontalHeader().resizeSection(0,60)
        self.tables.horizontalHeader().resizeSection(2,158)
        self.tables.verticalHeader().setVisible(False)
        Headers = []
        for n, key in enumerate(self.data.keys()):
            Headers.append(key)
        self.tables.setHorizontalHeaderLabels(Headers)


        self.linetarget = QLineEdit(self)
        self.input_client = QLineEdit(self)
        self.input_client.setText("ff:ff:ff:ff:ff:ff")
        self.btn_enviar = QPushButton("Send Attack", self)
        self.btn_enviar.clicked.connect(self.attack_deauth)
        self.btn_scan_start = QPushButton("Start scan", self)
        self.btn_scan_start.clicked.connect(self.SettingsScan)
        self.btn_stop = QPushButton("Stop  Attack ", self)
        self.btn_stop.clicked.connect(self.kill_thread)
        self.btn_scan_stop = QPushButton('Stop scan',self)
        self.btn_scan_stop.clicked.connect(self.kill_scanAP)
        self.btn_enviar.setFixedWidth(170)
        self.btn_stop.setFixedWidth(170)
        self.btn_scan_stop.setEnabled(False)
        self.btn_stop.setEnabled(False)

        #icons
        self.btn_scan_start.setIcon(QIcon("rsc/network.png"))
        self.btn_scan_stop.setIcon(QIcon('rsc/network_off.png'))
        self.btn_enviar.setIcon(QIcon("rsc/start.png"))
        self.btn_stop.setIcon(QIcon("rsc/Stop.png"))


        self.get_placa = QComboBox(self)

        n = Refactor.get_interfaces()['all']
        for i,j in enumerate(n):
            if search("wlan", j):
                self.get_placa.addItem(n[i])

        #grid options
        self.Grid = QGridLayout()
        self.options_scan = self.xmlcheck.xmlSettings("scanner_AP", "select", None, False)

        self.Grid.addWidget(self.get_placa,0,1)
        self.Grid.addWidget(self.btn_scan_start,0,2)
        self.Grid.addWidget(self.btn_scan_stop,0,3)

        self.Grid.addWidget(QLabel("bssid:"),1,0)
        self.Grid.addWidget(QLabel("{0:>20}".format('Client:')),1,2)
        self.Grid.addWidget(self.linetarget,1,1)
        self.Grid.addWidget(self.input_client,1,3)


        self.form0  = QGridLayout()
        self.form0.addWidget(self.tables,0,0)

        self.mForm.addRow(self.btn_enviar, self.btn_stop)
        self.mForm.addRow(self.statusbar)
        self.Main.addLayout(self.form0)
        self.Main.addLayout(self.Grid)
        self.Main.addLayout(self.mForm)
        self.setLayout(self.Main)
コード例 #21
0
ファイル: ProbeRequest.py プロジェクト: apcwowo/WiFi-Pumpkin
 def loadCard(self):
     n = Refactor.get_interfaces()['all']
     for i,j in enumerate(n):
         if search("wlan", j):
             self.get_placa.addItem(n[i])
コード例 #22
0
ファイル: Main.py プロジェクト: apcwowo/WiFi-Pumpkin
    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)
        #     Thread_dhcp .start()
        else:
            return QMessageBox.information(self, "DHCP", selected_dhcp + " not found.")
        self.Started(True)
        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")

        # thread plugins
        if self.PopUpPlugins.check_sslstrip.isChecked():
            Thread_sslstrip = Threadsslstrip(self.ConfigTwin["PortRedirect"])
            Thread_sslstrip.setObjectName("sslstrip")
            self.Apthreads["RougeAP"].append(Thread_sslstrip)
            Thread_sslstrip.start()

        if self.PopUpPlugins.check_netcreds.isChecked():
            Thread_netcreds = ProcessThread(
                [
                    "python",
                    "Plugins/net-creds/net-creds.py",
                    "-i",
                    self.FSettings.xmlSettings("netcreds", "interface", None, False),
                ]
            )
            Thread_netcreds.setName("Net-Creds")
            self.Apthreads["RougeAP"].append(Thread_netcreds)
            Thread_netcreds.start()

        if self.PopUpPlugins.check_dns2proy.isChecked():
            Thread_dns2proxy = ProcessThread(["python", "Plugins/dns2proxy/dns2proxy.py"])
            Thread_dns2proxy.setName("Dns2Proxy")
            self.Apthreads["RougeAP"].append(Thread_dns2proxy)
            Thread_dns2proxy.start()

        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)
コード例 #23
0
ファイル: Main.py プロジェクト: tUn4/WiFi-Pumpkin
    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)

        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
        if self.PopUpPlugins.check_sslstrip.isChecked(
        ) and not self.PopUpPlugins.check_sergioProxy.isChecked():
            self.Threadsslstrip = Thread_sslstrip(
                self.ConfigTwin['PortRedirect'], self.plugins,
                self.ProxyPluginsTAB._PluginsToLoader)
            self.Threadsslstrip.setObjectName("sslstrip")
            self.Apthreads['RougeAP'].append(self.Threadsslstrip)

        elif not self.PopUpPlugins.check_sslstrip.isChecked(
        ) and 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)

        elif self.PopUpPlugins.check_sergioProxy.isChecked(
        ) and 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)

        if self.PopUpPlugins.check_dns2proy.isChecked():
            Thread_dns2proxy = ProcessThread(
                ['python', 'Plugins/dns2proxy/dns2proxy.py'])
            Thread_dns2proxy.setName('Dns2Proxy')
            self.Apthreads['RougeAP'].append(Thread_dns2proxy)

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

        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']:
            thread.start()
            self.progress.setText(thread.getNameThread())
            self.progress.update_bar_simple(20)
            QThread.sleep(3)
        self.progress.setValue(100)
        self.progress.change_color('grey')
        self.progress.setText('')
        if self.FSettings.Settings.get_setting('dockarea',
                                               'advanced',
                                               format=bool):
            self.PumpSettingsTAB.doCheckAdvanced()
            if hasattr(self, 'dockAreaList'):
                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()
コード例 #24
0
ファイル: ProbeRequest.py プロジェクト: apcwowo/WiFi-Pumpkin
 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])
コード例 #25
0
ファイル: Main.py プロジェクト: Neykl/WiFi-Pumpkin
    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)
        #     Thread_dhcp .start()
        else:return QMessageBox.information(self,'DHCP',selected_dhcp + ' not found.')
        self.Started(True)
        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')

        # thread plugins
        if self.PopUpPlugins.check_sslstrip.isChecked():
            Thread_sslstrip = Threadsslstrip(self.ConfigTwin['PortRedirect'])
            Thread_sslstrip.setObjectName("sslstrip")
            self.Apthreads['RougeAP'].append(Thread_sslstrip)
            Thread_sslstrip.start()

        if self.PopUpPlugins.check_netcreds.isChecked():
            Thread_netcreds = ProcessThread(['python','Plugins/net-creds/net-creds.py','-i',
            self.FSettings.xmlSettings('netcreds', 'interface',None,False)])
            Thread_netcreds.setName('Net-Creds')
            self.Apthreads['RougeAP'].append(Thread_netcreds)
            Thread_netcreds.start()

        if self.PopUpPlugins.check_dns2proy.isChecked():
            Thread_dns2proxy = ProcessThread(['python','Plugins/dns2proxy/dns2proxy.py'])
            Thread_dns2proxy.setName('Dns2Proxy')
            self.Apthreads['RougeAP'].append(Thread_dns2proxy)
            Thread_dns2proxy.start()

        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)
コード例 #26
0
ファイル: Main.py プロジェクト: BrunoDB/WiFi-Pumpkin
 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])
コード例 #27
0
ファイル: Main.py プロジェクト: BrunoDB/WiFi-Pumpkin
    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)


        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
        if self.PopUpPlugins.check_sslstrip.isChecked() and not self.PopUpPlugins.check_sergioProxy.isChecked():
            self.Threadsslstrip = Thread_sslstrip(self.ConfigTwin['PortRedirect'],
            self.plugins,self.ProxyPluginsTAB._PluginsToLoader)
            self.Threadsslstrip.setObjectName("sslstrip")
            self.Apthreads['RougeAP'].append(self.Threadsslstrip)

        elif not self.PopUpPlugins.check_sslstrip.isChecked() and 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)

        elif self.PopUpPlugins.check_sergioProxy.isChecked() and 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)

        if self.PopUpPlugins.check_dns2proy.isChecked():
            Thread_dns2proxy = ProcessThread(['python','Plugins/dns2proxy/dns2proxy.py'])
            Thread_dns2proxy.setName('Dns2Proxy')
            self.Apthreads['RougeAP'].append(Thread_dns2proxy)

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

        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']:
            thread.start()
            self.progress.setText(thread.getNameThread())
            self.progress.update_bar_simple(20)
            QThread.sleep(3)
        self.progress.setValue(100)
        self.progress.change_color('grey')
        self.progress.setText('')
        if self.FSettings.Settings.get_setting('dockarea','advanced',format=bool):
            self.PumpSettingsTAB.doCheckAdvanced()
            if hasattr(self,'dockAreaList'):
                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()
コード例 #28
0
    def window_qt(self):
        self.mForm = QFormLayout()
        self.statusbar = QStatusBar()
        system = QLabel("Deauthentication::")
        self.statusbar.addWidget(system)
        self.Controlador = QLabel("")
        self.AttackStatus(False)

        self.tables = QTableWidget(5, 3)
        self.tables.setFixedWidth(350)
        self.tables.setRowCount(100)
        self.tables.setFixedHeight(250)
        self.tables.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.tables.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.tables.clicked.connect(self.select_target)
        self.tables.resizeColumnsToContents()
        self.tables.resizeRowsToContents()
        self.tables.horizontalHeader().resizeSection(1, 120)
        self.tables.horizontalHeader().resizeSection(0, 60)
        self.tables.horizontalHeader().resizeSection(2, 158)
        self.tables.verticalHeader().setVisible(False)
        Headers = []
        for n, key in enumerate(self.data.keys()):
            Headers.append(key)
        self.tables.setHorizontalHeaderLabels(Headers)

        self.linetarget = QLineEdit(self)
        self.input_client = QLineEdit(self)
        self.input_client.setText("ff:ff:ff:ff:ff:ff")
        self.btn_enviar = QPushButton("Send Attack", self)
        self.btn_enviar.clicked.connect(self.attack_deauth)
        self.btn_scan_start = QPushButton("Start scan", self)
        self.btn_scan_start.clicked.connect(self.SettingsScan)
        self.btn_stop = QPushButton("Stop  Attack ", self)
        self.btn_stop.clicked.connect(self.kill_thread)
        self.btn_scan_stop = QPushButton("Stop scan", self)
        self.btn_scan_stop.clicked.connect(self.kill_scanAP)
        self.btn_enviar.setFixedWidth(170)
        self.btn_stop.setFixedWidth(170)
        self.btn_scan_stop.setEnabled(False)
        self.btn_stop.setEnabled(False)

        # icons
        self.btn_scan_start.setIcon(QIcon("rsc/network.png"))
        self.btn_scan_stop.setIcon(QIcon("rsc/network_off.png"))
        self.btn_enviar.setIcon(QIcon("rsc/start.png"))
        self.btn_stop.setIcon(QIcon("rsc/Stop.png"))

        self.get_placa = QComboBox(self)

        n = Refactor.get_interfaces()["all"]
        for i, j in enumerate(n):
            if search("wlan", j):
                self.get_placa.addItem(n[i])

        # grid options
        self.Grid = QGridLayout()
        self.options_scan = self.xmlcheck.xmlSettings("scanner_AP", "select", None, False)

        self.Grid.addWidget(self.get_placa, 0, 1)
        self.Grid.addWidget(self.btn_scan_start, 0, 2)
        self.Grid.addWidget(self.btn_scan_stop, 0, 3)

        self.Grid.addWidget(QLabel("bssid:"), 1, 0)
        self.Grid.addWidget(QLabel("{0:>20}".format("Client:")), 1, 2)
        self.Grid.addWidget(self.linetarget, 1, 1)
        self.Grid.addWidget(self.input_client, 1, 3)

        self.form0 = QGridLayout()
        self.form0.addWidget(self.tables, 0, 0)

        self.mForm.addRow(self.btn_enviar, self.btn_stop)
        self.mForm.addRow(self.statusbar)
        self.Main.addLayout(self.form0)
        self.Main.addLayout(self.Grid)
        self.Main.addLayout(self.mForm)
        self.setLayout(self.Main)