diff --git a/py/Arguments.py b/py/Arguments.py index 4fa9c46..d68e856 100644 --- a/py/Arguments.py +++ b/py/Arguments.py @@ -188,6 +188,10 @@ class Arguments(object): help=Color.s('Time to wait before failing WPA attack (default: {G}%d sec{W})') % Configuration.wpa_attack_timeout) wpa.add_argument('-wpat', help=argparse.SUPPRESS, action='store', dest='wpa_attack_timeout', type=int) + wpa.add_argument('--new-hs', + action='store_true', + dest='ignore_old_handshakes', + help=Color.s('Captures new handshakes, ignores existing handshakes in ./hs (default: {G}off{W})')) wpa.add_argument('--hs-dir', action='store', dest='wpa_handshake_dir', diff --git a/py/Configuration.py b/py/Configuration.py index 5a84344..efc2c11 100644 --- a/py/Configuration.py +++ b/py/Configuration.py @@ -188,6 +188,9 @@ class Configuration(object): if args.wpa_attack_timeout: Configuration.wpa_attack_timeout = args.wpa_attack_timeout Color.pl('{+} {C}option:{W} will stop WPA handshake capture after {G}%d seconds{W}' % args.wpa_attack_timeout) + if args.ignore_old_handshakes: + Configuration.ignore_old_handshakes = True + Color.pl("{+} {C}option:{W} will {O}ignore{W} existing handshakes (force capture)") if args.wpa_handshake_dir: Configuration.wpa_handshake_dir = args.wpa_handshake_dir Color.pl('{+} {C}option:{W} will store handshakes to {G}%s{W}' % args.wpa_handshake_dir) diff --git a/py/Tshark.py b/py/Tshark.py index 9713f04..b55ac73 100644 --- a/py/Tshark.py +++ b/py/Tshark.py @@ -51,8 +51,9 @@ class Tshark(object): if ',' not in line: continue bssid, locked = line.split(',') - # TODO: Ignore if WPS is locked? - bssids.add(bssid.upper()) + # Ignore if WPS is locked? + if '1' not in locked: + bssids.add(bssid.upper()) for t in targets: t.wps = t.bssid.upper() in bssids