From 30e6b71c36868ad6d6200a2303822fc12a91755d Mon Sep 17 00:00:00 2001 From: ProDigySML Date: Thu, 10 Jan 2019 03:02:19 -0800 Subject: [PATCH 1/3] Fixed the errors for ports and exclusions --- Interlace/lib/core/input.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 1a819bd..1f20e88 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -66,13 +66,14 @@ class InputHelper(object): final_commands = set() output = OutputHelper(arguments) - if "," in arguments.port: - ports = arguments.port.split(",") - elif "-" in arguments.port: - tmp_ports = arguments.port.split("-") - ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1)) - else: - ports = [arguments.port] + if arguments.port: + if "," in arguments.port: + ports = arguments.port.split(",") + elif "-" in arguments.port: + tmp_ports = arguments.port.split("-") + ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1)) + else: + ports = [arguments.port] # process targets first @@ -86,8 +87,9 @@ class InputHelper(object): if arguments.exclusions: exclusions_ranges.add(arguments.exclusions) else: - for exclusion in arguments.exclusions_list: - exclusions_ranges.add(target.strip()) + if arguments.exclusions_list: + for exclusion in arguments.exclusions_list: + exclusions_ranges.add(target.strip()) # removing elements that may have spaces (helpful for easily processing comma notation) for target in ranges: From 1090f64018bf429ad025c0132af1e310550e6d39 Mon Sep 17 00:00:00 2001 From: ProDigySML Date: Thu, 10 Jan 2019 03:31:54 -0800 Subject: [PATCH 2/3] Fixed errors with ports and exclusions. Also added in domain name compatibility. --- Interlace/lib/core/input.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 1f20e88..c0254aa 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -2,6 +2,7 @@ from argparse import ArgumentParser from netaddr import IPNetwork, IPRange, IPGlob from Interlace.lib.core.output import OutputHelper, Level import os.path +from re import compile class InputHelper(object): @@ -96,6 +97,10 @@ class InputHelper(object): target = target.replace(" ", "") for ips in target.split(","): + # check if it is a domain name + if ips.split(".")[-1][0].isalpha(): + targets.add(ips) + continue # checking for CIDR if not arguments.nocidr and "/" in ips: targets.update(InputHelper._get_cidr_to_ips(ips)) @@ -113,6 +118,10 @@ class InputHelper(object): exclusion = exclusion.replace(" ", "") for ips in exclusion.split(","): + # check if it is a domain name + if ips.split(".")[-1][0].isalpha(): + targets.add(ips) + continue # checking for CIDR if not arguments.nocidr and "/" in ips: exclusions.update(InputHelper._get_cidr_to_ips(ips)) @@ -138,16 +147,24 @@ class InputHelper(object): # replace flags for command in commands: tmp_command = command - for port in ports: + if arguments.port: + 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) + command = str(command).replace("_port_", str(port)) + if arguments.realport: + command = str(command).replace("_realport_", arguments.realport) + final_commands.add(command) + output.terminal(Level.VERBOSE, command, "Added after processing") + else: 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_", str(port)) - if arguments.realport: - command = str(command).replace("_realport_", arguments.realport) final_commands.add(command) output.terminal(Level.VERBOSE, command, "Added after processing") From 6b2ebcf71750fddc9482ab8e4678fb29f342fb10 Mon Sep 17 00:00:00 2001 From: Michael Skelton <886344+codingo@users.noreply.github.com> Date: Thu, 10 Jan 2019 21:37:33 +1000 Subject: [PATCH 3/3] Update __version__.py --- Interlace/lib/core/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interlace/lib/core/__version__.py b/Interlace/lib/core/__version__.py index 8d23f10..a842075 100644 --- a/Interlace/lib/core/__version__.py +++ b/Interlace/lib/core/__version__.py @@ -1,2 +1,2 @@ -__version__ = '1.1' +__version__ = '1.1.1'