Skip to content

Commit e112373

Browse files
authored
Merge pull request #449 from kimocoder/claude/project-audit-scan-3FEN6
Claude/project audit scan 3 fen6
2 parents 274e721 + c02f976 commit e112373

24 files changed

+139
-114
lines changed

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
packages=[
2020
'wifite',
2121
'wifite/attack',
22+
'wifite/attack/portal',
2223
'wifite/model',
24+
'wifite/native',
2325
'wifite/tools',
26+
'wifite/ui',
2427
'wifite/util',
2528
],
2629
data_files=[

wifite/args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import sys
88

99

10-
class Arguments(object):
10+
class Arguments:
1111
""" Holds arguments used by the Wifite """
1212

1313
def __init__(self, configuration):

wifite/attack/all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Answer(Enum):
2020
Continue = 3
2121
Ignore = 4
2222

23-
class AttackAll(object):
23+
class AttackAll:
2424
@classmethod
2525
def attack_multiple(cls, targets, session=None, session_mgr=None):
2626
"""

wifite/attack/pmkid.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,15 @@ def run_hashcat(self):
224224
if Configuration.skip_crack:
225225
if self.view:
226226
self.view.add_log("Skipping crack phase (--skip-crack flag)")
227-
return self._extracted_from_run_hashcat_44(
227+
return self._handle_hashcat_failure(
228228
'{+} Not cracking pmkid because {C}skip-crack{W} was used{W}')
229229

230230
# Crack it.
231231
if Process.exists(Hashcat.dependency_name):
232232
try:
233233
self.success = self.crack_pmkid_file(pmkid_file)
234234
except KeyboardInterrupt:
235-
return self._extracted_from_run_hashcat_44(
235+
return self._handle_hashcat_failure(
236236
'\n{!} {R}Failed to crack PMKID: {O}Cracking interrupted by user{W}'
237237
)
238238
else:
@@ -244,9 +244,8 @@ def run_hashcat(self):
244244

245245
return True # Even if we don't crack it, capturing a PMKID is 'successful'
246246

247-
# TODO Rename this here and in `run_hashcat`
248-
def _extracted_from_run_hashcat_44(self, arg0):
249-
Color.pl(arg0)
247+
def _handle_hashcat_failure(self, message):
248+
Color.pl(message)
250249
self.success = False
251250
return True
252251

@@ -481,7 +480,7 @@ def crack_pmkid_file(self, pmkid_file):
481480

482481
if key is not None:
483482
log_info('AttackPMKID', f'PMKID cracked successfully! Password: {key}')
484-
return self._extracted_from_crack_pmkid_file_31(key, pmkid_file)
483+
return self._handle_pmkid_crack_success(key, pmkid_file)
485484
# Failed to crack.
486485
if Configuration.wordlist is not None:
487486
log_warning('AttackPMKID', 'PMKID crack failed: passphrase not found in wordlist')
@@ -492,8 +491,7 @@ def crack_pmkid_file(self, pmkid_file):
492491
'{R}Failed {O}Passphrase not found in dictionary.\n')
493492
return False
494493

495-
# TODO Rename this here and in `crack_pmkid_file`
496-
def _extracted_from_crack_pmkid_file_31(self, key, pmkid_file):
494+
def _handle_pmkid_crack_success(self, key, pmkid_file):
497495
# Successfully cracked.
498496
if self.view:
499497
self.view.add_log(f"Successfully cracked PMKID!")
@@ -615,31 +613,29 @@ def save_pmkid(self, pmkid_hash):
615613
"""Saves a copy of the pmkid (handshake) to hs/ directory."""
616614
# Create handshake dir
617615
if self.do_airCRACK:
618-
return self._extracted_from_save_pmkid_6(pmkid_hash)
616+
return self._copy_pmkid_to_file(pmkid_hash)
619617
if not os.path.exists(Configuration.wpa_handshake_dir):
620618
os.makedirs(Configuration.wpa_handshake_dir)
621619

622-
pmkid_file = self._extracted_from_save_pmkid_21('.22000')
620+
pmkid_file = self._generate_pmkid_filepath('.22000')
623621
with open(pmkid_file, 'w') as pmkid_handle:
624622
pmkid_handle.write(pmkid_hash)
625623
pmkid_handle.write('\n')
626624

627625
return pmkid_file
628626

629-
# TODO Rename this here and in `save_pmkid`
630-
def _extracted_from_save_pmkid_21(self, arg0):
627+
def _generate_pmkid_filepath(self, extension):
631628
# Generate filesystem-safe filename from bssid, essid and date
632629
essid_safe = re.sub('[^a-zA-Z0-9]', '', self.target.essid)
633630
bssid_safe = self.target.bssid.replace(':', '-')
634631
date = time.strftime('%Y-%m-%dT%H-%M-%S')
635-
result = f'pmkid_{essid_safe}_{bssid_safe}_{date}{arg0}'
632+
result = f'pmkid_{essid_safe}_{bssid_safe}_{date}{extension}'
636633
result = os.path.join(Configuration.wpa_handshake_dir, result)
637634

638635
Color.p('\n{+} Saving copy of {C}PMKID Hash{W} to {C}%s{W} ' % result)
639636
return result
640637

641-
# TODO Rename this here and in `save_pmkid`
642-
def _extracted_from_save_pmkid_6(self, pmkid_hash):
643-
pmkid_file = self._extracted_from_save_pmkid_21('.cap')
638+
def _copy_pmkid_to_file(self, pmkid_hash):
639+
pmkid_file = self._generate_pmkid_filepath('.cap')
644640
copy(pmkid_hash, pmkid_file)
645641
return pmkid_file

wifite/attack/wpa.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,12 @@ def run(self):
360360

361361
# Check for the --skip-crack flag
362362
if Configuration.skip_crack:
363-
return self._extracted_from_run_30(
363+
return self._handle_attack_failure(
364364
'{+} Not cracking handshake because {C}skip-crack{W} was used{W}'
365365
)
366366
# Check wordlist
367367
if Configuration.wordlist is None:
368-
return self._extracted_from_run_30(
368+
return self._handle_attack_failure(
369369
'{!} {O}Not cracking handshake because wordlist ({R}--dict{O}) is not set'
370370
)
371371
elif not os.path.exists(Configuration.wordlist):
@@ -438,9 +438,8 @@ def run(self):
438438
self.success = True
439439
return self.success
440440

441-
# TODO Rename this here and in `run`
442-
def _extracted_from_run_30(self, arg0):
443-
Color.pl(arg0)
441+
def _handle_attack_failure(self, message):
442+
Color.pl(message)
444443
self.success = False
445444
return False
446445

wifite/attack/wps.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def run(self):
5151
return False
5252

5353
if not Configuration.wps_pixie and self.pixie_dust:
54-
return self._extracted_from_run_14(
54+
return self._handle_wps_skip(
5555
'\r{!} {O}--no-pixie{R} was given, ignoring WPS Pixie-Dust Attack on {O}%s{W}'
5656
)
5757
if not Configuration.wps_no_nullpin and self.null_pin:
@@ -60,7 +60,7 @@ def run(self):
6060
return False
6161

6262
if not Configuration.wps_pin and not self.pixie_dust:
63-
return self._extracted_from_run_14(
63+
return self._handle_wps_skip(
6464
'\r{!} {O}--pixie{R} was given, ignoring WPS PIN Attack on {O}%s{W}'
6565
)
6666

@@ -90,9 +90,8 @@ def run(self):
9090
else:
9191
return self.run_reaver()
9292

93-
# TODO Rename this here and in `run`
94-
def _extracted_from_run_14(self, arg0):
95-
Color.pl(arg0 % self.target.essid)
93+
def _handle_wps_skip(self, message):
94+
Color.pl(message % self.target.essid)
9695
self.success = False
9796
return False
9897

wifite/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .tools.macchanger import Macchanger
88

99

10-
class Configuration(object):
10+
class Configuration:
1111
""" Stores configuration variables and functions for Wifite. """
1212

1313
initialized = False # Flag indicating config has been initialized

wifite/model/attack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from ..config import Configuration
66

77

8-
class Attack(object):
8+
class Attack:
99
"""Contains functionality common to all attacks."""
1010

1111
target_wait = min(60, Configuration.wpa_attack_timeout)

wifite/model/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44

5-
class Client(object):
5+
class Client:
66
"""
77
Holds details for a 'Client' - a wireless device (e.g. computer)
88
that is associated with an Access Point (e.g. router)

wifite/model/handshake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010

1111

12-
class Handshake(object):
12+
class Handshake:
1313

1414
def __init__(self, capfile, bssid=None, essid=None):
1515
self.capfile = capfile

0 commit comments

Comments
 (0)