mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-18 07:14:20 +01:00
Added _host_
This commit is contained in:
@@ -8,7 +8,7 @@ from Interlace.lib.threader import Pool
|
|||||||
def build_queue(arguments, output):
|
def build_queue(arguments, output):
|
||||||
queue = list()
|
queue = list()
|
||||||
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.THREAD, command, "Added to Queue")
|
||||||
queue.append(command)
|
queue.append(command)
|
||||||
return queue
|
return queue
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from netaddr import IPNetwork, IPRange, IPGlob
|
from netaddr import IPNetwork, IPRange, IPGlob
|
||||||
|
from Interlace.lib.core.output import OutputHelper, Level
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
|
|
||||||
@@ -61,6 +62,7 @@ class InputHelper(object):
|
|||||||
ranges = set()
|
ranges = set()
|
||||||
targets = set()
|
targets = set()
|
||||||
final_commands = set()
|
final_commands = set()
|
||||||
|
output = OutputHelper(arguments)
|
||||||
|
|
||||||
# process targets first
|
# process targets first
|
||||||
if arguments.target:
|
if arguments.target:
|
||||||
@@ -73,7 +75,6 @@ class InputHelper(object):
|
|||||||
for target in ranges:
|
for target in ranges:
|
||||||
target = target.replace(" ", "")
|
target = target.replace(" ", "")
|
||||||
|
|
||||||
# todo: take list of targets and expand CIDR / comma notation
|
|
||||||
for ips in target.split(","):
|
for ips in target.split(","):
|
||||||
# checking for CIDR
|
# checking for CIDR
|
||||||
if not arguments.nocidr and "/" in ips:
|
if not arguments.nocidr and "/" in ips:
|
||||||
@@ -98,6 +99,7 @@ class InputHelper(object):
|
|||||||
# replace flags
|
# replace flags
|
||||||
for command in commands:
|
for command in commands:
|
||||||
command = str(command).replace("_target_", target)
|
command = str(command).replace("_target_", target)
|
||||||
|
command = str(command).replace("_host_", target)
|
||||||
if arguments.output:
|
if arguments.output:
|
||||||
command = str(command).replace("_output_", arguments.output)
|
command = str(command).replace("_output_", arguments.output)
|
||||||
if arguments.port:
|
if arguments.port:
|
||||||
@@ -105,6 +107,8 @@ class InputHelper(object):
|
|||||||
if arguments.realport:
|
if arguments.realport:
|
||||||
command = str(command).replace("_realport_", arguments.realport)
|
command = str(command).replace("_realport_", arguments.realport)
|
||||||
final_commands.add(command)
|
final_commands.add(command)
|
||||||
|
output.terminal(Level.VERBOSE, command, "Added after processing")
|
||||||
|
|
||||||
return final_commands
|
return final_commands
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user