Ignore error when parsing Client row.

Explanation of bug (Why error wasn't being caught):

```
try:
    ...
except IndexError, ValueError:
    # Only catches IndexError.
    # ValueError is a *variable* holding the IndexError !
```
This commit is contained in:
derv82
2018-02-27 04:20:21 -05:00
parent 080e674aa6
commit af5e3aaca9
2 changed files with 5 additions and 10 deletions

View File

@@ -193,7 +193,7 @@ class Airodump(object):
# The current row corresponds to a "Client" (computer) # The current row corresponds to a "Client" (computer)
try: try:
client = Client(row) client = Client(row)
except IndexError, ValueError: except (IndexError, ValueError) as e:
# Skip if we can't parse the client row # Skip if we can't parse the client row
continue continue

View File

@@ -21,15 +21,10 @@ class Client(object):
5 BSSID, (Access Point's MAC address) 5 BSSID, (Access Point's MAC address)
6 Probed ESSIDs 6 Probed ESSIDs
''' '''
try: self.station = fields[0].strip()
self.station = fields[0].strip() self.power = int(fields[3].strip())
self.power = int(fields[3].strip()) self.packets = int(fields[4].strip())
self.packets = int(fields[4].strip()) self.bssid = fields[5].strip()
self.bssid = fields[5].strip()
except ValueError, e:
print "\nValueError ({})".format(e)
print "\twhile parsing {}".format(fields)
raise e
def __str__(self): def __str__(self):