Detect when reaver does not support --pixie-dust, use bully if possible.

This commit is contained in:
derv82
2018-09-01 14:11:34 -07:00
parent 5d77cb63a3
commit d7c51461f6
2 changed files with 28 additions and 9 deletions

View File

@@ -44,14 +44,28 @@ class AttackWPS(Attack):
self.success = False self.success = False
return False return False
if Configuration.use_bully and Bully.exists() or not Reaver.exists(): if not Reaver.exists() and Bully.exists():
# Use bully if reaver isn't available
return self.run_bully() return self.run_bully()
elif self.pixie_dust and not Reaver.is_pixiedust_supported() and Bully.exists():
elif Reaver.exists(): # Use bully if reaver can't do pixie-dust
return self.run_reaver() return self.run_bully()
elif Configuration.use_bully:
else: # Use bully if asked by user
return self.run_bully()
elif not Reaver.exists():
# Print error if reaver isn't found (bully not available)
if self.pixie_dust:
Color.pl('\r{!} {R}Skipping WPS Pixie-Dust attack: {O}reaver{R} not found.{W}')
else:
Color.pl('\r{!} {R}Skipping WPS PIN attack: {O}reaver{R} not found.{W}')
return False return False
elif self.pixie_dust and not Reaver.is_pixiedust_supported():
# Print error if reaver can't support pixie-dust (bully not available)
Color.pl('\r{!} {R}Skipping WPS attack: {O}reaver{R} does not support {O}--pixie-dust{W}')
return False
else:
return self.run_reaver()
def run_bully(self): def run_bully(self):

View File

@@ -343,9 +343,14 @@ class Configuration(object):
'(no {O}Pixie-Dust{W}) on targets') '(no {O}Pixie-Dust{W}) on targets')
if args.use_bully: if args.use_bully:
cls.use_bully = args.use_bully from tools.bully import Bully
Color.pl('{+} {C}option:{W} use {C}bully{W} instead of {C}reaver{W} ' + if not Bully.exists():
'for WPS Attacks') Color.pl('{!} {R}Bully not found. Defaulting to {O}reaver{W}')
cls.use_bully = False
else:
cls.use_bully = args.use_bully
Color.pl('{+} {C}option:{W} use {C}bully{W} instead of {C}reaver{W} ' +
'for WPS Attacks')
if args.wps_pixie_timeout: if args.wps_pixie_timeout:
cls.wps_pixie_timeout = args.wps_pixie_timeout cls.wps_pixie_timeout = args.wps_pixie_timeout