Bully works. Pixie and PIN attacks are separate attacks.
This commit is contained in:
@@ -53,9 +53,12 @@ class AttackAll(object):
|
||||
elif 'WPA' in target.encryption:
|
||||
# WPA can have multiple attack vectors:
|
||||
|
||||
# WPS
|
||||
if target.wps:
|
||||
# WPS
|
||||
attacks.append(AttackWPS(target))
|
||||
if Configuration.wps_pixie:
|
||||
attacks.append(AttackWPS(target, pixie_dust=True))
|
||||
if Configuration.wps_pin:
|
||||
attacks.append(AttackWPS(target, pixie_dust=False))
|
||||
|
||||
# PMKID
|
||||
attacks.append(AttackPMKID(target))
|
||||
|
||||
@@ -6,10 +6,11 @@ from ..util.color import Color
|
||||
from ..config import Configuration
|
||||
|
||||
class AttackWPS(Attack):
|
||||
def __init__(self, target):
|
||||
def __init__(self, target, pixie_dust=False):
|
||||
super(AttackWPS, self).__init__(target)
|
||||
self.success = False
|
||||
self.crack_result = None
|
||||
self.pixie_dust = pixie_dust
|
||||
|
||||
def run(self):
|
||||
''' Run all WPS-related attacks '''
|
||||
@@ -27,6 +28,18 @@ class AttackWPS(Attack):
|
||||
self.success = False
|
||||
return False
|
||||
|
||||
if not Configuration.wps_pixie and self.pixie_dust:
|
||||
Color.pl('\r{!} {O}--no-pixie{R} set, ignoring WPS attack on ' +
|
||||
'{O}%s{W}' % self.target.essid)
|
||||
self.success = False
|
||||
return False
|
||||
|
||||
if not Configuration.wps_pin and not self.pixie_dust:
|
||||
Color.pl('\r{!} {O}--no-pin{R} set, ignoring WPS attack on ' +
|
||||
'{O}%s{W}' % self.target.essid)
|
||||
self.success = False
|
||||
return False
|
||||
|
||||
if Configuration.use_bully:
|
||||
return self.run_bully()
|
||||
else:
|
||||
@@ -36,47 +49,21 @@ class AttackWPS(Attack):
|
||||
|
||||
|
||||
def run_bully(self):
|
||||
# Bully: Pixie-dust
|
||||
from ..tools.bully import Bully
|
||||
bully = Bully(self.target)
|
||||
bully = Bully(self.target, pixie_dust=self.pixie_dust)
|
||||
bully.run()
|
||||
bully.stop()
|
||||
self.crack_result = bully.crack_result
|
||||
self.success = self.crack_result is not None
|
||||
if self.success:
|
||||
return True
|
||||
|
||||
# Bully: WPS PIN Attack
|
||||
return self.success
|
||||
|
||||
|
||||
def run_reaver(self):
|
||||
from ..tools.reaver import Reaver
|
||||
reaver = Reaver(self.target)
|
||||
|
||||
# Reaver: PixieDust then WPS PIN attack.
|
||||
for pixie_dust in [True, False]:
|
||||
if pixie_dust and not Configuration.wps_pixie:
|
||||
continue # Avoid Pixie-Dust attack
|
||||
if not pixie_dust and not Configuration.wps_pin:
|
||||
continue # Avoid PIN attack
|
||||
|
||||
if Configuration.wps_pixie and pixie_dust and \
|
||||
not reaver.is_pixiedust_supported():
|
||||
Color.pl('{!} {R}your version of "reaver" does not support the ' +
|
||||
'{O}WPS pixie-dust attack{W}')
|
||||
continue
|
||||
|
||||
reaver = Reaver(self.target, pixie_dust=pixie_dust)
|
||||
try:
|
||||
reaver.run()
|
||||
except KeyboardInterrupt:
|
||||
Color.pl('\n{!} {O}Interrupted{W}')
|
||||
continue
|
||||
self.crack_result = reaver.crack_result
|
||||
self.success = self.crack_result is not None
|
||||
if self.success:
|
||||
return True
|
||||
|
||||
return False
|
||||
reaver = Reaver(self.target, pixie_dust=self.pixie_dust)
|
||||
reaver.run()
|
||||
self.crack_result = reaver.crack_result
|
||||
self.success = self.crack_result is not None
|
||||
return self.success
|
||||
|
||||
|
||||
Reference in New Issue
Block a user