mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-17 23:04:24 +01:00
Fixed target itteration bug
This commit is contained in:
@@ -7,10 +7,9 @@ from Interlace.lib.threader import Pool
|
|||||||
|
|
||||||
def build_queue(arguments, output):
|
def build_queue(arguments, output):
|
||||||
queue = list()
|
queue = list()
|
||||||
for target in InputHelper.process_targets(arguments):
|
for command in InputHelper.process_commands(arguments):
|
||||||
for command in InputHelper.process_commands(arguments):
|
output.terminal(Level.VERBOSE, command, "Added to Queue")
|
||||||
output.terminal(Level.VERBOSE, target, command, "Added to Queue")
|
queue.append(command)
|
||||||
queue.append(command)
|
|
||||||
return queue
|
return queue
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,12 @@ class InputHelper(object):
|
|||||||
return arg
|
return arg
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def process_targets(arguments):
|
def process_commands(arguments):
|
||||||
|
commands = set()
|
||||||
targets = set()
|
targets = set()
|
||||||
|
final_commands = set()
|
||||||
|
|
||||||
# build list of targets from file/input
|
# process targets first
|
||||||
if arguments.target:
|
if arguments.target:
|
||||||
targets.add(arguments.target)
|
targets.add(arguments.target)
|
||||||
else:
|
else:
|
||||||
@@ -30,20 +32,12 @@ class InputHelper(object):
|
|||||||
targets.add(target.strip())
|
targets.add(target.strip())
|
||||||
print('[DEBUG] Added Target %s' % 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:
|
if not arguments.nocidr:
|
||||||
# expand CIDR from net addr
|
# todo: expand CIDR from net addr
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# expand comma notation
|
# todo: expand comma notation
|
||||||
|
|
||||||
# return list of unique hosts
|
|
||||||
return targets
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def process_commands(arguments):
|
|
||||||
commands = set()
|
|
||||||
final_commands = set()
|
|
||||||
|
|
||||||
print("[DEBUG] Commands argument: %s" % arguments.command)
|
print("[DEBUG] Commands argument: %s" % arguments.command)
|
||||||
if arguments.command:
|
if arguments.command:
|
||||||
@@ -54,8 +48,8 @@ class InputHelper(object):
|
|||||||
commands.add(command.strip())
|
commands.add(command.strip())
|
||||||
print("[DEBUG] Added command %s" % command)
|
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:
|
for target in targets:
|
||||||
# replace flags
|
# replace flags
|
||||||
print("[DEBUG] ............................................")
|
print("[DEBUG] ............................................")
|
||||||
|
|||||||
Reference in New Issue
Block a user