mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-17 06:44:23 +01:00
Added in port parsing with comma delimiter
This commit is contained in:
@@ -64,6 +64,8 @@ class InputHelper(object):
|
|||||||
final_commands = set()
|
final_commands = set()
|
||||||
output = OutputHelper(arguments)
|
output = OutputHelper(arguments)
|
||||||
|
|
||||||
|
ports = arguments.port.split(",")
|
||||||
|
|
||||||
# process targets first
|
# process targets first
|
||||||
if arguments.target:
|
if arguments.target:
|
||||||
ranges.add(arguments.target)
|
ranges.add(arguments.target)
|
||||||
@@ -98,16 +100,19 @@ class InputHelper(object):
|
|||||||
for target in targets:
|
for target in targets:
|
||||||
# replace flags
|
# replace flags
|
||||||
for command in commands:
|
for command in commands:
|
||||||
command = str(command).replace("_target_", target)
|
tmp_command = command
|
||||||
command = str(command).replace("_host_", target)
|
for port in ports:
|
||||||
if arguments.output:
|
command = tmp_command
|
||||||
command = str(command).replace("_output_", arguments.output)
|
command = str(command).replace("_target_", target)
|
||||||
if arguments.port:
|
command = str(command).replace("_host_", target)
|
||||||
command = str(command).replace("_port_", arguments.port)
|
if arguments.output:
|
||||||
if arguments.realport:
|
command = str(command).replace("_output_", arguments.output)
|
||||||
command = str(command).replace("_realport_", arguments.realport)
|
if arguments.port:
|
||||||
final_commands.add(command)
|
command = str(command).replace("_port_", port)
|
||||||
output.terminal(Level.VERBOSE, command, "Added after processing")
|
if arguments.realport:
|
||||||
|
command = str(command).replace("_realport_", arguments.realport)
|
||||||
|
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