From 2d3f7ea38ffc3b4390e2ecc8fe1aa3af2e7adb2f Mon Sep 17 00:00:00 2001 From: Brian Pow Date: Sun, 7 Jun 2015 00:32:51 +0800 Subject: [PATCH] wifite now prompts for entering targets again if no targets is selected. Minor message tweak --- changelog.md | 4 ++++ wifite.py | 32 +++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 7d61682..7832ef3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# Version 2.0 Rev 102 # +- wifite now prompts for entering targets again if no targets is selected. +- Minor message tweak + # Version 2.0 Rev 101 # - Support to aircrack-ng 1.2-rc2 improved. diff --git a/wifite.py b/wifite.py index aaead5c..5992ee5 100755 --- a/wifite.py +++ b/wifite.py @@ -203,7 +203,7 @@ class RunConfiguration: """ def __init__(self): - self.REVISION = 101; + self.REVISION = 102; self.PRINTED_SCANNING = False #INTERFACE @@ -752,7 +752,7 @@ def handle_args(self): self.WPS_SAVE = not options.wpsnosave if not options.wpsnosave: - println_info(('WPS %ssession%s file saving ' + G + 'enabled' + W)%(G,W)) + println_info(('WPS %s.wpc%s file saving ' + G + 'enabled' + W)%(G,W)) if options.wpsratio != None: if options.wpsratio > 0: @@ -1531,25 +1531,35 @@ def scan(self, iface,channel=0, tried_rtl8187_fix=False): targets = sorted(targets, key=lambda t: t.power, reverse=True) #victims = [] + victim_must_exist=False + if self.RUN_CONFIG.SHOW_TARGET != "": targets=self.filter_targets(targets,clients,self.RUN_CONFIG.SHOW_TARGET) self.print_targets(targets, clients, self.RUN_CONFIG.SCAN_MAX_ROW_SHOW, self.RUN_CONFIG.COLUMN,self.RUN_CONFIG.SPACING) if(self.RUN_CONFIG.ATTACK_TARGET == ""): - ri = raw_input((GR + "\n [+]" + W + " enter " + G + "target numbers" + W + " (" + G + "1-%s" + W + ")") % (str(len(targets))) + \ - (" separated by commas, range (e.g.'" + G + "1-2" + W + "'), or wildcards: %s, ") % (G + 'c[num/range]' + W + ' for channel, ' + G + 'p[>=,>,=,<,<=][num]' + W + ' for power, ' + G + 'wep' + W + ', ' + G + 'wep[num of client]' + W + ' or ' + G + 'wep+' + W + " with client, " + G + 'wpa' + W + ' (same syntax as wep), ' + G + 'wps[0,1]' + W + '(0=no, 1=yes), ' + G + 'e[SSID][+]' +W +', ' + G + 'b[BSSID][+]' + W + ' or ' + G + 'all' + W) + \ - "blank input = " + G + "all" + W + ", add " + G + '-' + W + " before to remove:" ) + ri = self.get_input(len(targets)) + victim_must_exist= True else: ri=self.RUN_CONFIG.ATTACK_TARGET - victims=self.filter_targets(targets, clients, ri) - - if len(victims) == 0: - println_warning('no targets selected.' + W) - self.RUN_CONFIG.exit_gracefully(0) - + + while True: + victims=self.filter_targets(targets, clients, ri) + if len(victims) == 0: + println_warning('no targets selected.' + W) + if victim_must_exist: + ri=self.get_input(len(targets)); + else: + self.RUN_CONFIG.exit_gracefully(0) + else: + break print '' println_info('%s%d%s target%s selected.' % (G, len(victims), W, '' if len(victims) == 1 else 's')) return (victims, clients) + def get_input(self, max): + return raw_input((GR + "\n [+]" + W + " enter " + G + "target numbers" + W + " (" + G + "1-%s" + W + ")") % (str(max)) + \ + (" separated by commas, range (e.g.'" + G + "1-2" + W + "'), or wildcards: %s, ") % (G + 'c[num/range]' + W + ' for channel, ' + G + 'p[>=,>,=,<,<=][num]' + W + ' for power, ' + G + 'wep' + W + ', ' + G + 'wep[num of client]' + W + ' or ' + G + 'wep+' + W + " with client, " + G + 'wpa' + W + ' (same syntax as wep), ' + G + 'wps[0,1]' + W + '(0=no, 1=yes), ' + G + 'e[SSID][+]' +W +', ' + G + 'b[BSSID][+]' + W + ' or ' + G + 'all' + W) + \ + "blank input = " + G + "all" + W + ", add " + G + '-' + W + " before to remove:" ) def deauth(self, target, clients, time_started, iface, wait = False): cmd = ['aireplay-ng', '--ignore-negative-one',