From 80f8e7cde354e5f12d049c1cb67cba4df94e009f Mon Sep 17 00:00:00 2001 From: alexander rymdeko-harvey Date: Mon, 9 Jul 2018 10:35:13 -0400 Subject: [PATCH] version 2.0.5 --- VERSION | 2 +- simplydomain/__init__.py | 161 +++++++++++++++++++++------------------ 2 files changed, 86 insertions(+), 77 deletions(-) diff --git a/VERSION b/VERSION index 2165f8f..e010258 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.4 +2.0.5 diff --git a/simplydomain/__init__.py b/simplydomain/__init__.py index e057d80..2d35ca6 100644 --- a/simplydomain/__init__.py +++ b/simplydomain/__init__.py @@ -31,6 +31,18 @@ def __raw_depth_check(value): + """Check if value is positive int. + + Arguments: + value {number} -- value to check + + Returns: + number -- value that was checked + + Raises: + argparse.ArgumentTypeError -- is an invalid positive int value + argparse.ArgumentTypeError -- is too large of a keyspace for raw depth + """ ivalue = int(value) if ivalue <= 0: raise argparse.ArgumentTypeError( @@ -50,10 +62,7 @@ def __load_config(): return config.__json_config -def __set_logging(value): - """ - sets the logging function outlet. - """ +def __set_logging(value='INFO'): if value == 'CRITICAL': __core_logger.start(logging.CRITICAL) if value == 'ERROR': @@ -66,15 +75,7 @@ def __set_logging(value): __core_logger.start(logging.DEBUG) -def __parse_values( - domain, - debug, - verbose, - wordlist_bruteforce, - wordlist_count, - raw_bruteforce, - raw_depth -): +def __parse_values(domain, debug, verbose, wordlist_bruteforce, wordlist_count, raw_bruteforce, raw_depth): parser = argparse.ArgumentParser() parser.add_argument("DOMAIN", help="domain to query") # opts @@ -116,26 +117,30 @@ def __parse_values( return parser.parse_args(args) -def execute_raw_bruteforce( - domain, - config={}, - dnsservers=[], - debug='CRITICAL', - verbose=False, - wordlist_count=0, - return_type='json', - wordlist_bruteforce=False, - raw_bruteforce=True, - raw_depth=2 -): - """ - executes the main search function of simplydomain: - config: sets the JSON config settings for the opperation - dnsservers: sets a list of top DNS servers to resolve. - debug: sets the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) - verbose: sets the verbose count - wordlist_count: cound to brute 1-1000000 - return_type: (dict | json) +def execute_raw_bruteforce(domain, config={}, dnsservers=[], debug='CRITICAL', verbose=False, wordlist_count=0, return_type='json', wordlist_bruteforce=False, raw_bruteforce=True, raw_depth=2): + """Executes only the raw bruteforce search function of simplydomain. + + Executes the static raw brute-force module of simplydomain. + This allows simplydomain to generate all applicable RFC character + sets off a subdomain keyspace. This can range from 1 char() to 5 char() + which can feasibly be brute forced. + + Arguments: + domain {str} -- domain to search + + Keyword Arguments: + config {dict} -- sets the JSON config settings for the opperation (default: {{}}) + dnsservers {list} -- sets a list of top DNS servers to resolve (default: {[]}) + debug {str} -- sets the python logging setting: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: {'CRITICAL'}) + verbose {bool} -- sets the verbosity count (default: {False}) + wordlist_count {number} -- count to bruteforce from the word list 0-1,000,000 (default: {0}) + return_type {str} -- sets the return output type to (default: {'json'}) + wordlist_bruteforce {bool} -- enable wordlist bruteforce (default: {False}) + raw_bruteforce {bool} -- enable raw bruteforce (default: {True}) + raw_depth {number} -- depth of keyspace (default: {2}) + + Returns: + str -- (dict | json) object """ __set_logging(debug) if not config: @@ -155,26 +160,29 @@ def execute_raw_bruteforce( return cr.execute_raw_bruteforce(return_type=return_type) -def execute_wordlist_bruteforce( - domain, - config={}, - dnsservers=[], - debug='CRITICAL', - verbose=False, - wordlist_count=100, - return_type='json', - wordlist_bruteforce=True, - raw_bruteforce=False, - raw_depth=0 -): - """ - executes the main search function of simplydomain: - config: sets the JSON config settings for the opperation - dnsservers: sets a list of top DNS servers to resolve. - debug: sets the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) - verbose: sets the verbose count - wordlist_count: cound to brute 1-1000000 - return_type: (dict | json) +def execute_wordlist_bruteforce(domain, config={}, dnsservers=[], debug='CRITICAL', verbose=False, wordlist_count=100, return_type='json', wordlist_bruteforce=True, raw_bruteforce=False, raw_depth=0): + """Executes only the wordlist bruteforce search function of simplydomain. + + Executes the static wordlist brute-force module of simplydomain. + This allows simplydomain to get a range() of X subdomains for to be brute-forced. + This can range from 1-1 Million words. + + Arguments: + domain {str} -- domain to search + + Keyword Arguments: + config {dict} -- sets the JSON config settings for the opperation (default: {{}}) + dnsservers {list} -- sets a list of top DNS servers to resolve (default: {[]}) + debug {str} -- sets the python logging setting: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: {'CRITICAL'}) + verbose {bool} -- sets the verbosity count (default: {False}) + wordlist_count {number} -- count to bruteforce from the word list 0-1,000,000 (default: {100}) + return_type {str} -- sets the return output type to (default: {'json'}) + wordlist_bruteforce {bool} -- enable wordlist bruteforce (default: {True}) + raw_bruteforce {bool} -- enable raw bruteforce (default: {False}) + raw_depth {number} -- depth of keyspace (default: {0}) + + Returns: + str -- (dict | json) object """ __set_logging(debug) if not config: @@ -194,29 +202,30 @@ def execute_wordlist_bruteforce( return cr.execute_bruteforce(return_type=return_type) -def execute_search( - domain, - config={}, - dnsservers=[], - debug='CRITICAL', - verbose=False, - wordlist_bruteforce=True, - wordlist_count=100, - raw_bruteforce=True, - raw_depth=3, - return_type='json', -): - """ - executes the main search function of simplydomain: - config: sets the JSON config settings for the opperation - dnsservers: sets a list of top DNS servers to resolve. - debug: sets the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) - verbose: sets the verbose count - wordlist_bruteforce: sets to use worlist brute static module - wordlist_count: cound to brute 1-1000000 - raw_bruteforce: set to try to brute force keyspace - raw_depth: set to 1-5 - return_type: (dict | json) +def execute_search(domain, config={}, dnsservers=[], debug='CRITICAL', verbose=False, wordlist_bruteforce=True, wordlist_count=100, raw_bruteforce=True, raw_depth=3, return_type='json'): + """Executes the main search function(s) of simplydomain. + + simplydomain consists of many Dynamic modules and Static modules too + allow a programmer to search a large subset of sources for subdomains + easily. Within the simplydomain API, this concept is broken down into + executing a large scale search function, and specific Static modules. + + Arguments: + domain {str} -- domain to search + + Keyword Arguments: + config {dict} -- sets the JSON config settings for the opperation (default: {{}}) + dnsservers {list} -- sets a list of top DNS servers to resolve (default: {[]}) + debug {str} -- sets the python logging setting: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: {'CRITICAL'}) + verbose {bool} -- sets the verbosity count (default: {False}) + wordlist_bruteforce {bool} -- enable wordlist bruteforce (default: {True}) + wordlist_count {number} -- count to bruteforce from the word list 0-1,000,000 (default: {100}) + raw_bruteforce {bool} -- enable raw bruteforce (default: {True}) + raw_depth {number} -- enable raw bruteforce (default: {3}) + return_type {str} -- sets the return output type to (default: {'json'}) + + Returns: + str -- (dict | json) object """ __set_logging(debug) if not config: