From 6a13d64c75dfc993f4749aeb8c421e7d6d3bbb34 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Mon, 26 Feb 2018 13:50:27 +0100 Subject: [PATCH] Implememt 'pillage' argument for option to attack all targets --- py/Arguments.py | 5 +++++ py/Configuration.py | 4 ++++ py/Scanner.py | 49 ++++++++++++++++++++++++--------------------- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/py/Arguments.py b/py/Arguments.py index 6560793..a6855d0 100644 --- a/py/Arguments.py +++ b/py/Arguments.py @@ -77,6 +77,11 @@ class Arguments(object): metavar="[num]", default=None, help=Color.s('Number of deauth packets to send (default: {G}%d{W})' % Configuration.num_deauths)) + glob.add_argument('-p', + action='store', + dest='pillage', + type=bool, + help=Color.s('Pillage "All" mode to attack everything (default: {G}ask{W})')) # WEP wep = parser.add_argument_group('WEP-RELATED') diff --git a/py/Configuration.py b/py/Configuration.py index b248e42..fc97378 100644 --- a/py/Configuration.py +++ b/py/Configuration.py @@ -29,6 +29,7 @@ class Configuration(object): Configuration.verbose = 0 # Verbosity level. Configuration.scan_time = 0 # Scan time + Configuration.all_targets = False # Run attacks against all targets automatically Configuration.tx_power = 0 # Wifi transmit power (0 is default) Configuration.interface = None @@ -143,6 +144,9 @@ class Configuration(object): if args.scan_time: Configuration.scan_time = args.scan_time Color.pl('{+} {C}option:{W} scan time {G}%d{W}' % args.scan_time) + if args.pillage: + Configuration.verbose = args.pillage + Color.pl('{+} {C}option:{W} pillage {G}%d{W}' % args.verbose) if args.verbose: Configuration.verbose = args.verbose Color.pl('{+} {C}option:{W} verbosity level {G}%d{W}' % args.verbose) diff --git a/py/Scanner.py b/py/Scanner.py index f64baae..dc0640e 100644 --- a/py/Scanner.py +++ b/py/Scanner.py @@ -157,30 +157,33 @@ class Scanner(object): + " You may need to wait longer," + " or you may have issues with your wifi card") - self.print_targets() - Color.clear_entire_line() - input_str = '{+} select target(s)' - input_str += ' ({G}1-%d{W})' % len(self.targets) - input_str += ' separated by commas, dashes' - input_str += ' or {G}all{W}: ' - - chosen_targets = [] - for choice in raw_input(Color.s(input_str)).split(','): - if choice == 'all': - chosen_targets = self.targets - break - if '-' in choice: - # User selected a range - (lower,upper) = [int(x) - 1 for x in choice.split('-')] - for i in xrange(lower, min(len(self.targets), upper)): - chosen_targets.append(self.targets[i]) - elif choice.isdigit(): - choice = int(choice) - 1 - chosen_targets.append(self.targets[choice]) - else: - pass - return chosen_targets + if not (Configuration.pillage is True): + self.print_targets() + Color.clear_entire_line() + input_str = '{+} select target(s)' + input_str += ' ({G}1-%d{W})' % len(self.targets) + input_str += ' separated by commas, dashes' + input_str += ' or {G}all{W}: ' + chosen_targets = [] + + for choice in raw_input(Color.s(input_str)).split(','): + if choice == 'all': + chosen_targets = self.targets + break + if '-' in choice: + # User selected a range + (lower,upper) = [int(x) - 1 for x in choice.split('-')] + for i in xrange(lower, min(len(self.targets), upper)): + chosen_targets.append(self.targets[i]) + elif choice.isdigit(): + choice = int(choice) - 1 + chosen_targets.append(self.targets[choice]) + else: + pass + return chosen_targets + else: + return self.targets if __name__ == '__main__': # Example displays targets and selects the appropriate one