Skip to content

Commit

Permalink
Merge pull request #10 from codingo/ports-par
Browse files Browse the repository at this point in the history
Added in port parsing with comma delimiter
  • Loading branch information
codingo authored Jan 6, 2019
2 parents 3bb65f6 + 924aa63 commit e64e91a
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Interlace/lib/core/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def process_commands(arguments):
final_commands = set()
output = OutputHelper(arguments)

ports = arguments.port.split(",")

# process targets first
if arguments.target:
ranges.add(arguments.target)
Expand Down Expand Up @@ -98,16 +100,19 @@ def process_commands(arguments):
for target in targets:
# replace flags
for command in commands:
command = str(command).replace("_target_", target)
command = str(command).replace("_host_", target)
if arguments.output:
command = str(command).replace("_output_", arguments.output)
if arguments.port:
command = str(command).replace("_port_", arguments.port)
if arguments.realport:
command = str(command).replace("_realport_", arguments.realport)
final_commands.add(command)
output.terminal(Level.VERBOSE, command, "Added after processing")
tmp_command = command
for port in ports:
command = tmp_command
command = str(command).replace("_target_", target)
command = str(command).replace("_host_", target)
if arguments.output:
command = str(command).replace("_output_", arguments.output)
if arguments.port:
command = str(command).replace("_port_", port)
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

Expand Down

0 comments on commit e64e91a

Please sign in to comment.