Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added timeout on PixieDust WPS attack #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion wifite.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def __init__(self):
self.PIXIE = False
self.WPS_FINDINGS = [] # List of (successful) results of WPS attacks
self.WPS_TIMEOUT = 660 # Time to wait (in seconds) for successful PIN attempt
self.WPS_PIXIE_TIMEOUT = 660 # Time to wait (in seconds) for successful pixie attack
self.WPS_RATIO_THRESHOLD = 0.01 # Lowest percentage of tries/attempts allowed (where tries > 0)
self.WPS_MAX_RETRIES = 0 # Number of times to re-try the same pin before giving up completely.

Expand Down Expand Up @@ -599,6 +600,16 @@ def handle_args(self):
else:
print GR + ' [+]' + W + ' WPS attack timeout set to %s' % (
G + str(self.WPS_TIMEOUT) + " seconds" + W)
if options.pixiet:
try:
self.WPS_PIXIE_TIMEOUT = int(options.pixiet)
except ValueError:
print R + ' [!]' + O + ' invalid timeout: %s' % (R + options.pixiet + W)
except IndexError:
print R + ' [!]' + O + ' no timeout given!' + W
else:
print GR + ' [+]' + W + ' WPS PixieDust attack timeout set to %s' % (
G + str(self.WPS_PIXIE_TIMEOUT) + " seconds" + W)
if options.wpsratio:
try:
self.WPS_RATIO_THRESHOLD = float(options.wpsratio)
Expand Down Expand Up @@ -753,6 +764,8 @@ def build_opt_parser(self):
wps_group.add_argument('--pixie', help='Only use the WPS PixieDust attack', default=False, action='store_true', dest='pixie')
wps_group.add_argument('--wpst', help='Max wait for new retry before giving up (0: never).', action='store',
dest='wpst')
wps_group.add_argument('--pixiet', help='Max wait before giving up on PixieDust attack (0: never).', action='store',
dest='pixiet')
wps_group.add_argument('-wpst', help=argparse.SUPPRESS, action='store', dest='wpst')
wps_group.add_argument('--wpsratio', help='Min ratio of successful PIN attempts/total retries.', action='store',
dest='wpsratio')
Expand Down Expand Up @@ -3336,7 +3349,13 @@ def attack_wps_pixie(self):
# Clear out output file
inf = open(self.RUN_CONFIG.temp + 'out.out', 'w')
inf.close()


if self.RUN_CONFIG.WPS_PIXIE_TIMEOUT > 0 and (time.time() - time_started) > self.RUN_CONFIG.WPS_PIXIE_TIMEOUT:
print R + '\n [!]' + O + ' unable to complete successful try in %d seconds' % (
self.RUN_CONFIG.WPS_PIXIE_TIMEOUT)
print R + ' [+]' + W + ' skipping %s' % (O + self.target.ssid + W)
break

# End of big "while not cracked" loop
if cracked:
if pin != '': print GR + '\n\n [+]' + G + ' PIN found: %s' % (C + pin + W)
Expand Down