Remove --strip option

Tried to make it work but alas, no dice.
This commit is contained in:
derv82
2017-05-15 01:24:50 -04:00
parent 7adcff07b0
commit a8d16d1b69
4 changed files with 19 additions and 5 deletions

View File

@@ -183,11 +183,15 @@ class Arguments(object):
type=str, type=str,
help=Color.s('File containing passwords for cracking (default: {G}%s{W})') help=Color.s('File containing passwords for cracking (default: {G}%s{W})')
% Configuration.wordlist) % Configuration.wordlist)
# TODO: Uncomment the --strip option once it works
'''
wpa.add_argument('--strip', wpa.add_argument('--strip',
action='store_true', action='store_true',
dest='wpa_strip_handshake', dest='wpa_strip_handshake',
default=False, 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') wpa.add_argument('-strip', help=argparse.SUPPRESS, action='store_true', dest='wpa_strip_handshake')
# WPS # WPS

View File

@@ -195,9 +195,14 @@ class AttackWPA(Attack):
cap_filename = 'handshake_%s_%s_%s.cap' % (essid_safe, bssid_safe, date) cap_filename = 'handshake_%s_%s_%s.cap' % (essid_safe, bssid_safe, date)
cap_filename = os.path.join(Configuration.wpa_handshake_dir, cap_filename) 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) if Configuration.wpa_strip_handshake:
copy(handshake.capfile, cap_filename) Color.p("{+} {C}stripping{W} non-handshake packets, saving to {G}%s{W}..." % cap_filename)
Color.pl('{G}saved{W}') 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 # Update handshake to use the stored handshake file for future operations
handshake.capfile = cap_filename handshake.capfile = cap_filename

View File

@@ -57,6 +57,7 @@ class Configuration(object):
Configuration.wpa_deauth_timeout = 10 # Wait time between deauths Configuration.wpa_deauth_timeout = 10 # Wait time between deauths
Configuration.wpa_attack_timeout = 500 # Wait time before failing Configuration.wpa_attack_timeout = 500 # Wait time before failing
Configuration.wpa_handshake_dir = "hs" # Dir to store handshakes Configuration.wpa_handshake_dir = "hs" # Dir to store handshakes
Configuration.wpa_strip_handshake = False # Strip non-handshake packets
# Default dictionary for cracking # Default dictionary for cracking
Configuration.wordlist = None Configuration.wordlist = None
@@ -174,6 +175,9 @@ class Configuration(object):
if args.wpa_handshake_dir: if args.wpa_handshake_dir:
Configuration.wpa_handshake_dir = 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) 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 # WPS
if args.wps_filter: if args.wps_filter:

View File

@@ -316,7 +316,8 @@ class Handshake(object):
cmd = [ cmd = [
'tshark', 'tshark',
'-r', self.capfile, # input file '-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 '-w', outfile # output file
] ]
proc = Process(cmd) proc = Process(cmd)