diff --git a/Wifite.py b/Wifite.py index 606654a..9946008 100755 --- a/Wifite.py +++ b/Wifite.py @@ -86,8 +86,10 @@ class Wifite(object): else: targets = s.select_targets() + attacked_targets = 0 targets_remaining = len(targets) for index, t in enumerate(targets): + attacked_targets += 1 targets_remaining -= 1 Color.pl('\n{+} ({G}%d{W}/{G}%d{W})' % (index + 1, len(targets)) + @@ -133,7 +135,7 @@ class Wifite(object): if attack.success: attack.crack_result.save() - Color.pl("{+} Finished attacking {C}%d{W} target(s), exiting" % len(targets)) + Color.pl("{+} Finished attacking {C}%d{W} target(s), exiting" % attacked_targets) def print_banner(self): diff --git a/py/Scanner.py b/py/Scanner.py index 79d4b73..f24492a 100644 --- a/py/Scanner.py +++ b/py/Scanner.py @@ -169,11 +169,13 @@ class Scanner(object): if '-' in choice: # User selected a range (lower,upper) = [int(x) - 1 for x in choice.split('-')] - for i in xrange(lower, upper): + for i in xrange(lower, min(len(self.targets), upper)): chosen_targets.append(self.targets[i]) - else: + elif choice.isdigit(): choice = int(choice) - 1 chosen_targets.append(self.targets[choice]) + else: + pass return chosen_targets