def start_sniffer(self, interface, hop_channels=True, fixed_channel=7): self.running_interface = interface try: card = NetworkCard(interface) if card.get_mode().lower() != 'monitor': card.set_mode('monitor') except: print "[-] Could not set card to monitor mode. Card might be busy." return for plugin in self.plugins: plugin.pre_scanning() self.sniffer_running = True self.sniffing_thread = Thread( target=self.sniff_packets) self.sniffing_thread.start() if hop_channels: hopper_thread = Thread( target=self.hop_channels) hopper_thread.start() else: try: card = NetworkCard(interface) card.set_channel(fixed_channel) if card.get_channel() == fixed_channel: print "[+] Set fixed channel to {}".format(fixed_channel) else: print "[-] Could not change channel, try unplugging your interface." print "[/] Channel is on {}".format(card.get_channel()) except: print "[-] Cannot set channel at the moment."
def hop_channels(self): # Hop through channels to get find more beacons try: card = NetworkCard(self.running_interface) while self.sniffer_running: current_channel = card.get_channel() if current_channel <= 12: card.set_channel(current_channel + 1) else: card.set_channel(1) sleep(1) except Exception as e: pass # The sniffer has already been aborted
def start_sniffer(self, interface, hop_channels=True, fixed_channel=7): self.running_interface = interface card = NetworkCard(interface) if card.get_mode() != 'monitor': card.set_mode('monitor') self.sniffing_thread = Thread(target=self.sniff_packets) self.sniffer_running = True self.sniffing_thread.start() if hop_channels: hopper_thread = Thread(target=self.hop_channels) hopper_thread.start() else: card = NetworkCard(interface) card.set_channel(fixed_channel)
def hop_channels(self): """ Hops through the available channels to find more access points. """ try: card = NetworkCard(self.running_interface) available_channels = card.get_available_channels() n_available_channels = len(available_channels) current_channel_index = 0 while self.sniffer_running: try: if self.configs["hop_channels"].lower() == "true": if current_channel_index < n_available_channels: card.set_channel( available_channels[current_channel_index]) else: card.set_channel(1) current_channel_index = 0 else: card.set_channel( int(self.configs["fixed_sniffing_channel"])) sleep(.25) except Exception: pass current_channel_index += 1 except Exception: pass # The sniffer has already been aborted
def hop_channels(self): """ Hops through the available channels to find more access points. """ try: card = NetworkCard(self.running_interface) available_channels = card.get_available_channels() n_available_channels = len(available_channels) current_channel_index = 0 while self.sniffer_running: try: if self.configs["hop_channels"].lower() == "true": if current_channel_index < n_available_channels: card.set_channel(available_channels[current_channel_index]) else: card.set_channel(1) current_channel_index = 0 else: card.set_channel(int(self.configs["fixed_sniffing_channel"])) sleep(.25) except Exception: pass current_channel_index += 1 except Exception: pass # The sniffer has already been aborted
def hop_channels(self): # Hop through channels to get find more beacons try: card = NetworkCard(self.running_interface) available_channels = card.get_available_channels() n_available_channels = len(available_channels) current_channel_index = 0 while self.sniffer_running: try: if current_channel_index < n_available_channels: card.set_channel(available_channels[current_channel_index]) else: card.set_channel(1) current_channel_index = 0 sleep(.25) except Exception as e: pass current_channel_index += 1 except Exception as e: pass # The sniffer has already been aborted
def pre_injection(self): card = NetworkCard(self.running_interface) card.set_channel(self.fixed_channel)
def pre_deauth(self): card = NetworkCard(self.running_interface) card.set_channel(self.fixed_channel)
def pre_injection(self): card = NetworkCard(self.running_interface) card.set_channel(self.fixed_channel)