2.1.2: Quiet decloak. Support ESSIDs with commas and trailing spaces
Decloaked ESSIDs will have a "*" next to their name. For #78 While testing, I found that Wifite did not parse Airodump's CSV correctly. Specifically, ESSIDs with commas or trailing spaces. Fixed in this commit. Also fixed hidden ESSID detection introduced by the new CSV parsing logic.
This commit is contained in:
@@ -12,7 +12,7 @@ class Configuration(object):
|
||||
|
||||
initialized = False # Flag indicating config has been initialized
|
||||
temp_dir = None # Temporary directory
|
||||
version = '2.1.1'
|
||||
version = '2.1.2'
|
||||
|
||||
@staticmethod
|
||||
def initialize(load_interface=True):
|
||||
|
||||
@@ -52,14 +52,18 @@ class Target(object):
|
||||
|
||||
self.essid_known = True
|
||||
self.essid_len = int(fields[12].strip())
|
||||
self.essid = fields[13].strip()
|
||||
if self.essid == '\\x00' * self.essid_len or self.essid.strip() == '':
|
||||
self.essid = fields[13]
|
||||
if self.essid == '\\x00' * self.essid_len or \
|
||||
self.essid == 'x00' * self.essid_len or \
|
||||
self.essid.strip() == '':
|
||||
# Don't display "\x00..." for hidden ESSIDs
|
||||
self.essid = None # '(%s)' % self.bssid
|
||||
self.essid_known = False
|
||||
|
||||
self.wps = None
|
||||
|
||||
self.decloaked = False # If ESSID was hidden but we decloaked it.
|
||||
|
||||
self.clients = []
|
||||
|
||||
self.validate()
|
||||
@@ -84,7 +88,7 @@ class Target(object):
|
||||
Specifically formatted for the "scanning" table view.
|
||||
'''
|
||||
|
||||
max_essid_len = 25
|
||||
max_essid_len = 24
|
||||
essid = self.essid if self.essid_known else "(%s)" % self.bssid
|
||||
# Trim ESSID (router name) if needed
|
||||
if len(essid) > max_essid_len:
|
||||
@@ -99,6 +103,10 @@ class Target(object):
|
||||
# Unknown ESSID
|
||||
essid = Color.s("{O}%s" % essid)
|
||||
|
||||
# Add a "*" if we decloaked the ESSID
|
||||
decloaked_char = '*' if self.decloaked else ' '
|
||||
essid += Color.s("{P}%s" % decloaked_char)
|
||||
|
||||
if show_bssid:
|
||||
bssid = Color.s('{O}%s ' % self.bssid)
|
||||
else:
|
||||
|
||||
@@ -45,7 +45,7 @@ class Airodump(object):
|
||||
|
||||
# For tracking decloaked APs (previously were hidden)
|
||||
self.decloaking = False
|
||||
self.decloaked_targets = []
|
||||
self.decloaked_bssids = set()
|
||||
self.decloaked_times = {} # Map of BSSID(str) -> epoch(int) of last deauth
|
||||
|
||||
|
||||
@@ -161,7 +161,8 @@ class Airodump(object):
|
||||
if old_target.bssid != new_target.bssid: continue
|
||||
if new_target.essid_known and not old_target.essid_known:
|
||||
# We decloaked a target!
|
||||
self.decloaked_targets.append(new_target)
|
||||
new_target.decloaked = True
|
||||
self.decloaked_bssids.add(new_target.bssid)
|
||||
|
||||
if self.pid.poll() is not None:
|
||||
raise Exception('Airodump has stopped')
|
||||
@@ -185,7 +186,11 @@ class Airodump(object):
|
||||
if type(line) is bytes: line = line.decode('utf-8')
|
||||
line = line.replace('\0', '')
|
||||
lines.append(line)
|
||||
csv_reader = csv.reader(lines, delimiter=',')
|
||||
csv_reader = csv.reader(lines,
|
||||
delimiter=',',
|
||||
quoting=csv.QUOTE_ALL,
|
||||
skipinitialspace=True,
|
||||
escapechar='\\')
|
||||
|
||||
hit_clients = False
|
||||
for row in csv_reader:
|
||||
@@ -317,4 +322,3 @@ if __name__ == '__main__':
|
||||
Color.pl(' {G}%s %s' % (str(idx).rjust(3), target.to_str()))
|
||||
|
||||
Configuration.delete_temp()
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@ class Scanner(object):
|
||||
# We found the target we want
|
||||
return
|
||||
|
||||
for target in self.targets:
|
||||
if target.bssid in airodump.decloaked_bssids:
|
||||
target.decloaked = True
|
||||
|
||||
self.print_targets()
|
||||
|
||||
target_count = len(self.targets)
|
||||
@@ -61,11 +65,6 @@ class Scanner(object):
|
||||
outline += " {G}%d{W} target(s)," % target_count
|
||||
outline += " {G}%d{W} client(s)." % client_count
|
||||
outline += " {O}Ctrl+C{W} when ready "
|
||||
decloaked = airodump.decloaked_targets
|
||||
if len(decloaked) > 0:
|
||||
outline += "(decloaked"
|
||||
outline += " {C}%d{W} ESSIDs:" % len(decloaked)
|
||||
outline += " {G}%s{W}) " % ", ".join([x.essid for x in decloaked])
|
||||
Color.clear_entire_line()
|
||||
Color.p(outline)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user