From 950f547008d8c29be8e015dbc81d5e36707e2ffc Mon Sep 17 00:00:00 2001 From: codingo Date: Sun, 6 Jan 2019 12:04:53 +1000 Subject: [PATCH 1/2] Fixed reference bug --- Interlace/lib/core/input.py | 12 ++++++++++++ Interlace/lib/threader.py | 1 + 2 files changed, 13 insertions(+) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 0a576dd..5990cfd 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -18,16 +18,28 @@ class InputHelper(object): return arg + @staticmethod + def expand_targets(targets): + # expand CIDR from net addr + # expand comma notation + + # return list of unique hosts + return targets + @staticmethod def process_targets(arguments): targets = set() + # build list of targets from file/input if arguments.target: targets.add(arguments.target) else: for target in arguments.target_list: targets.add(target.strip()) + # take list of targets and expand CIDR / comma notation + targets = set(arguments.expand_targets(targets)) + return targets @staticmethod diff --git a/Interlace/lib/threader.py b/Interlace/lib/threader.py index 5786f4a..3e60d76 100644 --- a/Interlace/lib/threader.py +++ b/Interlace/lib/threader.py @@ -58,6 +58,7 @@ class Pool(object): for thread in threads: thread.join() +# test harness if __name__ == "__main__": tasks = ["sleep 1", "sleep 2", From 7b084d73d28bc45463ca9be89ce51179a14ca959 Mon Sep 17 00:00:00 2001 From: codingo Date: Sun, 6 Jan 2019 12:16:04 +1000 Subject: [PATCH 2/2] Added --no-cidr --- Interlace/lib/core/.input.py.swp | Bin 0 -> 16384 bytes Interlace/lib/core/__version__.py | 2 +- Interlace/lib/core/input.py | 17 +++++++++++++---- README.md | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 Interlace/lib/core/.input.py.swp diff --git a/Interlace/lib/core/.input.py.swp b/Interlace/lib/core/.input.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..8b239c60c416319ffdd03d51ce9dc17df5d48519 GIT binary patch literal 16384 zcmeI3ONboD8OJMjtXHhWjuS|7acLKMX06@XRb(a7+5=wnh!zwO@=9O`jC;Ckc020n zYE^enW_@r7H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=zL6-!-`Xdc z&b}p#^=lZ==xGUL2&6DVh#|(-6Rjpk$`t*6wt-Fov2@38O&~ib4>P8jIntk>(zA?a z)t|GlpGZ|cj_JyUjCA?A4P3GQG;ae&^Z(yqUi~f1!D;?q?C<{yb9(`fgJp0OT)}+) zui&TPFgO5cp8s2<9f146L9hfUzi$F}I0c*nP64NYQ@|YxIP!7so=STh>w+QfxED)rx9)c|Chy*q^`#R)@Ak(y?Xa!p^$oW<7Xx zH*X+RS7HIdWHrGEtP0bv0RH*AAI4rZrblC8fK_1Z<=K4772@jpb2ezyW~?mP=|1g% zPTg6;X3}Ii^j+*SVr?{mzmWBqd0X}JVz?Z;lC)<<6-dFu{snvG%LxB0UsZ*PJD!MB L+w!#6+mY#0oqTw( literal 0 HcmV?d00001 diff --git a/Interlace/lib/core/__version__.py b/Interlace/lib/core/__version__.py index 24a343f..c01247e 100644 --- a/Interlace/lib/core/__version__.py +++ b/Interlace/lib/core/__version__.py @@ -1,2 +1,2 @@ -__version__ = '0.01' +__version__ = '1.0' diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 5990cfd..97e30a8 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -19,8 +19,10 @@ class InputHelper(object): return arg @staticmethod - def expand_targets(targets): - # expand CIDR from net addr + def expand_targets(targets, dont_expand_cidr): + if not dont_expand_cidr: + # expand CIDR from net addr + pass # expand comma notation # return list of unique hosts @@ -38,7 +40,7 @@ class InputHelper(object): targets.add(target.strip()) # take list of targets and expand CIDR / comma notation - targets = set(arguments.expand_targets(targets)) + targets = set(arguments.expand_targets(targets, arguments.nocidr)) return targets @@ -69,7 +71,8 @@ class InputParser(object): targets.add_argument( '-t', dest='target', required=False, - help='Specify a target or domain name.' + help='Specify a target or domain name either in comma format, ' + 'CIDR notation, or a single target.' ) targets.add_argument( @@ -108,6 +111,12 @@ class InputParser(object): ) + parser.add_argument( + '--no-cidr', dest='nocidr', action='store_true', default=False, + help='If set then CIDR notation in a target file will not be automatically ' + 'be expanded into individual hosts.' + ) + parser.add_argument( '--no-color', dest='nocolor', action='store_true', default=False, help='If set then any foreground or background colours will be ' diff --git a/README.md b/README.md index 48b19d7..657059e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A threading management application that allows controlled execution of multiple | Argument | Description | |------------|--------------------------------------------------------------------------------------------------------------| -| -t | Specify a target or domain name | +| -t | Specify a target or domain name either in comma format, CIDR notation, or as an individual host. | | -tL | Specify a list of targets or domain names | | -threads | Specify the maximum number of threads to run at any one time (DEFAULT:5) | | -timeout | Specify a timeout value in seconds for any one thread (DEFAULT:600) |