diff --git a/Interlace/lib/core/.input.py.swp b/Interlace/lib/core/.input.py.swp new file mode 100644 index 0000000..8b239c6 Binary files /dev/null and b/Interlace/lib/core/.input.py.swp differ 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 0a576dd..97e30a8 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -18,16 +18,30 @@ class InputHelper(object): return arg + @staticmethod + 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 + 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, arguments.nocidr)) + return targets @staticmethod @@ -57,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( @@ -96,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/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", 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) |