[wpa.py] Fixed TypeError in python3

"TypeError: cannot use a string pattern on a bytes-like object"
The exception only happens in python3, python2 is all right.
This commit is contained in:
ZhaoChunsheng
2018-06-09 22:40:51 +08:00
committed by GitHub
parent 96e846aa82
commit 92917a4bbd

View File

@@ -187,8 +187,8 @@ class AttackWPA(Attack):
current_key = '' current_key = ''
while crack_proc.poll() is None: while crack_proc.poll() is None:
line = crack_proc.pid.stdout.readline() line = crack_proc.pid.stdout.readline()
match_nums = aircrack_nums_re.search(line) match_nums = aircrack_nums_re.search(line.decode('utf-8'))
match_keys = aircrack_key_re.search(line) match_keys = aircrack_key_re.search(line.decode('utf-8'))
if match_nums: if match_nums:
num_tried = int(match_nums.group(1)) num_tried = int(match_nums.group(1))
num_total = int(match_nums.group(2)) num_total = int(match_nums.group(2))