Filter multicast/broadcast BSSIDs from appearing in target list
Should resolve #32
This commit is contained in:
@@ -211,17 +211,12 @@ class Airodump(object):
|
||||
|
||||
else:
|
||||
# The current row corresponds to a "Target" (router)
|
||||
try:
|
||||
target = Target(row)
|
||||
|
||||
if target.essid_len == 0:
|
||||
# Ignore empty/blank ESSIDs
|
||||
pass
|
||||
|
||||
if target.channel == "-1":
|
||||
# Ignore -1 channel
|
||||
pass
|
||||
|
||||
targets.append(target)
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
return targets
|
||||
|
||||
@staticmethod
|
||||
|
||||
19
py/Target.py
19
py/Target.py
@@ -3,6 +3,8 @@
|
||||
|
||||
from Color import Color
|
||||
|
||||
import re
|
||||
|
||||
class Target(object):
|
||||
'''
|
||||
Holds details for a "Target" aka Access Point (e.g. router).
|
||||
@@ -60,6 +62,23 @@ class Target(object):
|
||||
|
||||
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):
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user