Skip to content

Commit 406c4b4

Browse files
committed
wps: add cache to pixie dust to avoid duplicate 'reaver' calls
1 parent 4e4980e commit 406c4b4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

wifite/attack/wps.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ def run(self):
6363
return self._extracted_from_run_14(
6464
'\r{!} {O}--pixie{R} was given, ignoring WPS PIN Attack on {O}%s{W}'
6565
)
66+
67+
# Cache pixie-dust support check to avoid duplicate reaver -h calls
68+
reaver_supports_pixie = Reaver.is_pixiedust_supported() if self.pixie_dust else True
69+
6670
if not Reaver.exists() and Bully.exists():
6771
# Use bully if reaver isn't available
6872
return self.run_bully()
69-
elif self.pixie_dust and not Reaver.is_pixiedust_supported() and Bully.exists():
73+
elif self.pixie_dust and not reaver_supports_pixie and Bully.exists():
7074
# Use bully if reaver can't do pixie-dust
7175
return self.run_bully()
7276
elif Configuration.use_bully:
@@ -79,7 +83,7 @@ def run(self):
7983
else:
8084
Color.pl('\r{!} {R}Skipping WPS PIN attack: {O}reaver{R} not found.{W}')
8185
return False
82-
elif self.pixie_dust and not Reaver.is_pixiedust_supported():
86+
elif self.pixie_dust and not reaver_supports_pixie:
8387
# Print error if reaver can't support pixie-dust (bully not available)
8488
Color.pl('\r{!} {R}Skipping WPS attack: {O}reaver{R} does not support {O}--pixie-dust{W}')
8589
return False

0 commit comments

Comments
 (0)