diff --git a/Interlace/interlace.py b/Interlace/interlace.py index a0ba605..3c0bef7 100644 --- a/Interlace/interlace.py +++ b/Interlace/interlace.py @@ -7,10 +7,9 @@ from Interlace.lib.threader import Pool def build_queue(arguments, output): queue = list() - for target in InputHelper.process_targets(arguments): - for command in InputHelper.process_commands(arguments): - output.terminal(Level.VERBOSE, target, command, "Added to Queue") - queue.append(command) + for command in InputHelper.process_commands(arguments): + output.terminal(Level.VERBOSE, command, "Added to Queue") + queue.append(command) return queue diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 8068990..57b7327 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -19,10 +19,12 @@ class InputHelper(object): return arg @staticmethod - def process_targets(arguments): + def process_commands(arguments): + commands = set() targets = set() + final_commands = set() - # build list of targets from file/input + # process targets first if arguments.target: targets.add(arguments.target) else: @@ -30,20 +32,12 @@ class InputHelper(object): targets.add(target.strip()) print('[DEBUG] Added Target %s' % target.strip()) - # take list of targets and expand CIDR / comma notation + # todo: take list of targets and expand CIDR / comma notation if not arguments.nocidr: - # expand CIDR from net addr + # todo: expand CIDR from net addr pass - # expand comma notation - - # return list of unique hosts - return targets - - @staticmethod - def process_commands(arguments): - commands = set() - final_commands = set() + # todo: expand comma notation print("[DEBUG] Commands argument: %s" % arguments.command) if arguments.command: @@ -54,8 +48,8 @@ class InputHelper(object): commands.add(command.strip()) print("[DEBUG] Added command %s" % command) - targets = InputHelper.process_targets(arguments) - + # expand commands to all known targets + print("[DEBUG] Targets length: %s" % len(targets)) for target in targets: # replace flags print("[DEBUG] ............................................")