From c3ac5fbaaa0e9847cbd5961bed38c4ce6b148a24 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 10 Jan 2024 15:04:45 +0100 Subject: [PATCH] Fixup in bully and reaver (few fixes) --- wifite/tools/hashcat.py | 9 ++------- wifite/tools/reaver.py | 30 ++++++------------------------ 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/wifite/tools/hashcat.py b/wifite/tools/hashcat.py index 6814aad6c..c22c26895 100755 --- a/wifite/tools/hashcat.py +++ b/wifite/tools/hashcat.py @@ -96,11 +96,6 @@ class HcxDumpTool(Dependency): dependency_url = 'apt install hcxdumptool' def __init__(self, target, pcapng_file): - # Create filterlist - filterlist = Configuration.temp('pmkid.filterlist') - with open(filterlist, 'w') as filter_handle: - filter_handle.write(target.bssid.replace(':', '')) - if os.path.exists(pcapng_file): os.remove(pcapng_file) @@ -180,7 +175,7 @@ def get_pmkid_hash(self, pcapng_file): if os.path.exists(self.pmkid_file): os.remove(self.pmkid_file) - command = ['hcxpcapngtool', f'--pmkid={self.pmkid_file}', pcapng_file] + command = 'hcxpcapngtool -o ' + self.pmkid_file + " " + pcapng_file hcxpcap_proc = Process(command) hcxpcap_proc.wait() @@ -197,7 +192,7 @@ def get_pmkid_hash(self, pcapng_file): matching_pmkid_hash = None for line in output.split('\n'): fields = line.split('*') - if len(fields) >= 3 and fields[1].lower() == self.bssid: + if len(fields) >= 3 and fields[3].lower() == self.bssid: # Found it matching_pmkid_hash = line break diff --git a/wifite/tools/reaver.py b/wifite/tools/reaver.py index 592879073..c9dad7e93 100755 --- a/wifite/tools/reaver.py +++ b/wifite/tools/reaver.py @@ -1,21 +1,16 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +import os +import re +import time -import contextlib -from .dependency import Dependency from .airodump import Airodump -from .bully import Bully # for PSK retrieval -from ..model.attack import Attack +from .dependency import Dependency from ..config import Configuration +from ..model.attack import Attack from ..model.wps_result import CrackResultWPS from ..util.color import Color from ..util.process import Process from ..util.timer import Timer -import os -import time -import re - class Reaver(Attack, Dependency): dependency_required = False @@ -52,14 +47,12 @@ def __init__(self, target, pixie_dust=True, null_pin=False): '--channel', self.target.channel, '-vv', '-N', - '-O', 'reaver_output.pcap' ] if pixie_dust: - self.reaver_cmd.extend(['--pixie-dust', '1']) + self.reaver_cmd.extend(['-K']) # Pixie-dust attack if null_pin: - # self.reaver_cmd.extend(['-O', 'reaver_output.pcap']) # This is for logging output self.reaver_cmd.extend(['-p', '']) # NULL PIN attack parameter self.reaver_proc = None @@ -186,17 +179,6 @@ def parse_crack_result(self, stdout): else: self.pattack('{G}Cracked WPS PIN: {C}%s' % pin, newline=True) - # Try to derive PSK from PIN using Bully - self.pattack('{W}Retrieving PSK using {C}bully{W}...') - psk = None - with contextlib.suppress(KeyboardInterrupt): - psk = Bully.get_psk_from_pin(self.target, pin) - if psk is None: - Color.pl('') - self.pattack('{R}Failed {O}to get PSK using bully', newline=True) - else: - self.pattack('{G}Cracked WPS PSK: {C}%s' % psk, newline=True) - crack_result = CrackResultWPS(self.target.bssid, ssid, pin, psk) crack_result.dump() return crack_result