Skip to content

Commit

Permalink
version 2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
killswitch-GUI committed Jul 9, 2018
1 parent b7ccbb1 commit 80f8e7c
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 77 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.4
2.0.5
161 changes: 85 additions & 76 deletions simplydomain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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':
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 80f8e7c

Please sign in to comment.