diff --git a/py/Arguments.py b/py/Arguments.py index 7aaa55a..b47e715 100644 --- a/py/Arguments.py +++ b/py/Arguments.py @@ -183,11 +183,15 @@ class Arguments(object): type=str, help=Color.s('File containing passwords for cracking (default: {G}%s{W})') % Configuration.wordlist) + + # TODO: Uncomment the --strip option once it works + ''' wpa.add_argument('--strip', action='store_true', dest='wpa_strip_handshake', default=False, - help=Color.s('Strip unnecessary packets from handshake capture using tshark or pyrit')) + help=Color.s('Strip unnecessary packets from handshake capture using tshark')) + ''' wpa.add_argument('-strip', help=argparse.SUPPRESS, action='store_true', dest='wpa_strip_handshake') # WPS diff --git a/py/AttackWPA.py b/py/AttackWPA.py index 98b3902..20f3197 100644 --- a/py/AttackWPA.py +++ b/py/AttackWPA.py @@ -195,9 +195,14 @@ class AttackWPA(Attack): cap_filename = 'handshake_%s_%s_%s.cap' % (essid_safe, bssid_safe, date) cap_filename = os.path.join(Configuration.wpa_handshake_dir, cap_filename) - Color.p('{+} saving copy of {C}handshake{W} to {C}%s{W} ' % cap_filename) - copy(handshake.capfile, cap_filename) - Color.pl('{G}saved{W}') + if Configuration.wpa_strip_handshake: + Color.p("{+} {C}stripping{W} non-handshake packets, saving to {G}%s{W}..." % cap_filename) + handshake.strip(outfile=cap_filename) + Color.pl('{G}saved{W}') + else: + Color.p('{+} saving copy of {C}handshake{W} to {C}%s{W} ' % cap_filename) + copy(handshake.capfile, cap_filename) + Color.pl('{G}saved{W}') # Update handshake to use the stored handshake file for future operations handshake.capfile = cap_filename diff --git a/py/Configuration.py b/py/Configuration.py index d95a676..81589c1 100644 --- a/py/Configuration.py +++ b/py/Configuration.py @@ -57,6 +57,7 @@ class Configuration(object): Configuration.wpa_deauth_timeout = 10 # Wait time between deauths Configuration.wpa_attack_timeout = 500 # Wait time before failing Configuration.wpa_handshake_dir = "hs" # Dir to store handshakes + Configuration.wpa_strip_handshake = False # Strip non-handshake packets # Default dictionary for cracking Configuration.wordlist = None @@ -174,6 +175,9 @@ class Configuration(object): 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) + if args.wpa_strip_handshake: + Configuration.wpa_strip_handshake = True + Color.pl("{+} {C}option:{W} will {G}strip{W} non-handshake packets") # WPS if args.wps_filter: diff --git a/py/Handshake.py b/py/Handshake.py index 0312c2f..0e27d83 100644 --- a/py/Handshake.py +++ b/py/Handshake.py @@ -316,7 +316,8 @@ class Handshake(object): cmd = [ 'tshark', '-r', self.capfile, # input file - '-R', 'wlan.fc.type_subtype == 0x08 || eapol', # filter + '-R', 'wlan.fc.type_subtype == 0x08 || wlan.fc.type_subtype == 0x05 || eapol', # filter + '-2', # tshark: -R without -2 is deprecated. '-w', outfile # output file ] proc = Process(cmd)