Implememt 'pillage' argument for option to attack all targets
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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}: '
|
||||
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user