Filter multicast/broadcast BSSIDs from appearing in target list

Should resolve #32
This commit is contained in:
derv82
2017-06-11 17:48:19 -04:00
parent b9c90b3d48
commit ebdde675e9
2 changed files with 26 additions and 12 deletions

View File

@@ -211,17 +211,12 @@ class Airodump(object):
else: else:
# The current row corresponds to a "Target" (router) # The current row corresponds to a "Target" (router)
try:
target = Target(row) target = Target(row)
if target.essid_len == 0:
# Ignore empty/blank ESSIDs
pass
if target.channel == "-1":
# Ignore -1 channel
pass
targets.append(target) targets.append(target)
except Exception:
continue
return targets return targets
@staticmethod @staticmethod

View File

@@ -3,6 +3,8 @@
from Color import Color from Color import Color
import re
class Target(object): class Target(object):
''' '''
Holds details for a "Target" aka Access Point (e.g. router). Holds details for a "Target" aka Access Point (e.g. router).
@@ -60,6 +62,23 @@ class Target(object):
self.clients = [] self.clients = []
self.validate()
def validate(self):
''' Checks that the target is valid. '''
if self.essid_len == 0:
raise Exception("Ignoring target with empty/blank ESSID (length: 0)")
elif self.channel == "-1":
raise Exception("Ignoring target with Negative-One (-1) channel")
# Filter broadcast/multicast BSSIDs, see https://github.com/derv82/wifite2/issues/32
bssid_broadcast = re.compile(r"^(ff:ff:ff:ff:ff:ff|00:00:00:00:00:00)$")
if bssid_broadcast.match(self.bssid):
raise Exception("Ignoring target with Broadcast BSSID (%s)" % self.bssid)
bssid_multicast = re.compile(r"^(01:00:5e|01:80:c2|33:33)")
if bssid_multicast.match(self.bssid):
raise Exception("Ignoring target with Multicast BSSID (%s)" % self.bssid)
def __str__(self): def __str__(self):
''' '''