From 001fc19eacee22afe949377220a0a275f8377cf4 Mon Sep 17 00:00:00 2001 From: derv82 Date: Wed, 28 Feb 2018 02:25:15 -0500 Subject: [PATCH] Locked WPS = 'no'. And new Option to ignore old handshakes * Targets with WPS Locked will say "no" under WPS in the target list. * `--new-hs` will ignore existing handshakes. --- py/Arguments.py | 4 ++++ py/Configuration.py | 3 +++ py/Tshark.py | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) 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