def getParser(): DEFAULT_VALUES = configuration.returnListOfConfigurationValues("searchfy") # Capturing errors just in case the option is not found in the configuration try: excludeList = [DEFAULT_VALUES["exclude_platforms"]] except: excludeList = [] parser = argparse.ArgumentParser(description='searchfy.py - Piece of software that performs a query on the platforms in OSRFramework.', prog='searchfy.py', epilog='Check the README.md file for further details on the usage of this program or follow us on Twitter in <http://twitter.com/i3visio>.', add_help=False) parser._optionals.title = "Input options (one required)" # Adding the main options groupMain = parser.add_mutually_exclusive_group(required=True) groupMain.add_argument('--license', required=False, action='store_true', default=False, help='shows the GPLv3+ license and exists.') groupMain.add_argument('-q', '--queries', metavar='<searches>', nargs='+', action='store', help = 'the list of queries to be performed).') listAll = platform_selection.getAllPlatformNames("searchfy") # Configuring the processing options groupProcessing = parser.add_argument_group('Processing arguments', 'Configuring the way in which searchfy will process the identified profiles.') groupProcessing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.') groupProcessing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>' ) groupProcessing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.') groupProcessing.add_argument('-p', '--platforms', metavar='<platform>', choices=listAll, nargs='+', required=False, default=DEFAULT_VALUES["platforms"] ,action='store', help='select the platforms where you want to perform the search amongst the following: ' + str(listAll) + '. More than one option can be selected.') groupProcessing.add_argument('--process', required=False, default =False ,action='store_true', help='whether to process the info in the profiles recovered. NOTE: this would be much slower.') groupProcessing.add_argument('-w', '--web_browser', required=False, action='store_true', help='opening the URIs returned in the default web browser.') groupProcessing.add_argument('-x', '--exclude', metavar='<platform>', choices=listAll, nargs='+', required=False, default=excludeList, action='store', help='select the platforms that you want to exclude from the processing.') # About options groupAbout = parser.add_argument_group('About arguments', 'Showing additional information about this program.') groupAbout.add_argument('-h', '--help', action='help', help='shows this help and exists.') groupAbout.add_argument('--version', action='version', version='[%(prog)s] OSRFramework ' + osrframework.__version__, help='shows the version of the program and exists.') return parser
def getParser(): import osrframework.utils.configuration as configuration DEFAULT_VALUES = configuration.returnListOfConfigurationValues("searchfy") parser = argparse.ArgumentParser(description='searchfy.py - Piece of software that performs a query on the platforms in OSRFramework.', prog='searchfy.py', epilog='Check the README.md file for further details on the usage of this program or follow us on Twitter in <http://twitter.com/i3visio>.', add_help=False) parser._optionals.title = "Input options (one required)" # Defining the mutually exclusive group for the main options groupMain = parser.add_mutually_exclusive_group(required=True) # Adding the main options groupMain.add_argument('--license', required=False, action='store_true', default=False, help='shows the GPLv3+ license and exists.') groupMain.add_argument('-q', '--queries', metavar='<searches>', nargs='+', action='store', help = 'the list of queries to be performed).') listAll = platform_selection.getAllPlatformNames("searchfy") # Configuring the processing options groupProcessing = parser.add_argument_group('Processing arguments', 'Configuring the way in which searchfy will process the identified profiles.') #groupProcessing.add_argument('-L', '--logfolder', metavar='<path_to_log_folder', required=False, default = './logs', action='store', help='path to the log folder. If none was provided, ./logs is assumed.') # Getting a sample header for the output files groupProcessing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'mtz', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default = DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.') groupProcessing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default = DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>' ) groupProcessing.add_argument('-m', '--maltego', required=False, action='store_true', help='Parameter specified to let usufy.py know that he has been launched by a Maltego Transform.') groupProcessing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default = DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.') groupProcessing.add_argument('-p', '--platforms', metavar='<platform>', choices=listAll, nargs='+', required=False, default = DEFAULT_VALUES["platforms"] ,action='store', help='select the platforms where you want to perform the search amongst the following: ' + str(listAll) + '. More than one option can be selected.') groupProcessing.add_argument('--process', required=False, default =False ,action='store_true', help='whether to process the info in the profiles recovered. NOTE: this would be much slower.') groupProcessing.add_argument('-w', '--web_browser', required=False, action='store_true', help='opening the URIs returned in the default web browser.') # About options groupAbout = parser.add_argument_group('About arguments', 'Showing additional information about this program.') groupAbout.add_argument('-h', '--help', action='help', help='shows this help and exists.') #groupAbout.add_argument('-v', '--verbose', metavar='<verbosity>', choices=[0, 1, 2], required=False, action='store', default=1, help='select the verbosity level: 0 - none; 1 - normal (default); 2 - debug.', type=int) groupAbout.add_argument('--version', action='version', version='%(prog)s ' +" " +__version__, help='shows the version of the program and exists.') return parser
def getParser(): DEFAULT_VALUES = configuration.returnListOfConfigurationValues("domainfy") # Capturing errors just in case the option is not found in the configuration try: excludeList = [DEFAULT_VALUES["exclude_platforms"]] except: excludeList = [] parser = argparse.ArgumentParser(description='checkfy - Finding potential email addresses based on a list of known aliases and a pattern.', prog='checkfy', epilog='Check the README.md file for further details on the usage of this program or follow us on Twitter in <http://twitter.com/i3visio>.', add_help=False, conflict_handler='resolve') parser._optionals.title = "Input options (one required)" # Adding the main options groupMainOptions = parser.add_mutually_exclusive_group(required=True) groupMainOptions.add_argument('--license', required=False, action='store_true', default=False, help='shows the GPLv3+ license and exists.') groupMainOptions.add_argument('-n', '--nicks', metavar='<nicks>', nargs='+', action='store', help = 'the list of nicks to be checked in the domains selected.') groupMainOptions.add_argument('-N', '--nicks_file', metavar='<nicks_file>', action='store', help = 'the file with the list of nicks to be checked in the domains selected.') # Configuring the processing options groupProcessing = parser.add_argument_group('Processing arguments', 'Configuring the way in which mailfy will process the identified profiles.') groupProcessing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.') groupProcessing.add_argument('-p', '--pattern', metavar='<pattern>', action='store', help='The pattern that the generated email address SHOULD match.', required=True) groupProcessing.add_argument('-t', '--type', metavar='<type>', default="twitter", action='store', choices=["twitter", "regexp"], help='The type of pattern provided. It can be either the style used by Twitter to show the pattern suggestions or a regular expression.', required=False) groupProcessing.add_argument('--quiet', required=False, action='store_true', default=False, help='tells the program not to show anything.') # About options groupAbout = parser.add_argument_group('About arguments', 'Showing additional information about this program.') groupAbout.add_argument('-h', '--help', action='help', help='shows this help and exists.') groupAbout.add_argument('--version', action='version', version='[%(prog)s] OSRFramework ' + osrframework.__version__, help='shows the version of the program and exists.') return parser
def getParser(): import osrframework.utils.configuration as configuration DEFAULT_VALUES = configuration.returnListOfConfigurationValues("usufy") # Capturing errors just in case the option is not found in the configuration try: excludeList = [DEFAULT_VALUES["exclude_platforms"]] except: excludeList = [] # Recovering all the possible options platOptions = platform_selection.getAllPlatformNames("usufy") parser = argparse.ArgumentParser(description='usufy.py - Piece of software that checks the existence of a profile for a given user in up to ' + str(len(platOptions)-1)+ ' different platforms.', prog='usufy.py', epilog='Check the README.md file for further details on the usage of this program or follow us on Twitter in <http://twitter.com/i3visio>.', add_help=False) parser._optionals.title = "Input options (one required)" # Defining the mutually exclusive group for the main options groupMainOptions = parser.add_mutually_exclusive_group(required=True) # Adding the main options groupMainOptions.add_argument('--info', metavar='<action>', choices=['list_platforms', 'list_tags'], action='store', help='select the action to be performed amongst the following: list_platforms (list the details of the selected platforms), list_tags (list the tags of the selected platforms). Afterwards, it exists.') groupMainOptions.add_argument('--license', required=False, action='store_true', default=False, help='shows the GPLv3+ license and exists.') groupMainOptions.add_argument('-b', '--benchmark', action='store_true', default=False, help='perform the benchmarking tasks.') groupMainOptions.add_argument('-f', '--fuzz', metavar='<path_to_fuzzing_list>', action='store', type=argparse.FileType('r'), help='this option will try to find usufy-like URLs. The list of fuzzing platforms in the file should be (one per line): <BASE_DOMAIN>\t<VALID_NICK>') groupMainOptions.add_argument('-l', '--list', metavar='<path_to_nick_list>', action='store', type=argparse.FileType('r'), help='path to the file where the list of nicks to verify is stored (one per line).') groupMainOptions.add_argument('-n', '--nicks', metavar='<nick>', nargs='+', action='store', help = 'the list of nicks to process (at least one is required).') groupMainOptions.add_argument('--show_tags', action='store_true', default=False, help='it will show the platforms grouped by tags.') # Selecting the platforms where performing the search groupPlatforms = parser.add_argument_group('Platform selection arguments', 'Criteria for selecting the platforms where performing the search.') groupPlatforms.add_argument('-p', '--platforms', metavar='<platform>', choices=platOptions, nargs='+', required=False, default=DEFAULT_VALUES["platforms"], action='store', help='select the platforms where you want to perform the search amongst the following: ' + str(platOptions) + '. More than one option can be selected.') groupPlatforms.add_argument('-t', '--tags', metavar='<tag>', default = [], nargs='+', required=False, action='store', help='select the list of tags that fit the platforms in which you want to perform the search. More than one option can be selected.') groupPlatforms.add_argument('-x', '--exclude', metavar='<platform>', choices=platOptions, nargs='+', required=False, default=excludeList, action='store', help='select the platforms that you want to exclude from the processing.') # Configuring the processing options groupProcessing = parser.add_argument_group('Processing arguments', 'Configuring the way in which usufy will process the identified profiles.') groupProcessing.add_argument('--avoid_download', required=False, action='store_true', default=False, help='argument to force usufy NOT to store the downloadable version of the profiles.') groupProcessing.add_argument('--avoid_processing', required=False, action='store_true', default=False, help='argument to force usufy NOT to perform any processing task with the valid profiles.') groupProcessing.add_argument('--fuzz_config', metavar='<path_to_fuzz_list>', action='store', type=argparse.FileType('r'), help='path to the fuzzing config details. Wildcards such as the domains or the nicknames should come as: <DOMAIN>, <USERNAME>.') groupProcessing.add_argument('--nonvalid', metavar='<not_valid_characters>', required=False, default = '\\|<>=', action='store', help="string containing the characters considered as not valid for nicknames." ) groupProcessing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'mtz', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.') groupProcessing.add_argument('-L', '--logfolder', metavar='<path_to_log_folder', required=False, default = './logs', action='store', help='path to the log folder. If none was provided, ./logs is assumed.') groupProcessing.add_argument('-m', '--maltego', required=False, action='store_true', help='parameter specified to let usufy.py know that he has been launched by a Maltego Transform.') groupProcessing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.') groupProcessing.add_argument('-w', '--web_browser', required=False, action='store_true', help='opening the uris returned in the default web browser.') # Getting a sample header for the output files groupProcessing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' ) groupProcessing.add_argument('-T', '--threads', metavar='<num_threads>', required=False, action='store', default=int(DEFAULT_VALUES["threads"]), type=int, help='write down the number of threads to be used (default 32). If 0, the maximum number possible will be used, which may make the system feel unstable.') # About options groupAbout = parser.add_argument_group('About arguments', 'Showing additional information about this program.') groupAbout.add_argument('-h', '--help', action='help', help='shows this help and exists.') groupAbout.add_argument('-v', '--verbose', metavar='<verbosity>', choices=[0, 1, 2], required=False, action='store', default=1, help='select the verbosity level: 0 - none; 1 - normal (default); 2 - debug.', type=int) groupAbout.add_argument('--version', action='version', version='%(prog)s ' +__version__, help='shows the version of the program and exists.') return parser
def getParser(): import osrframework.utils.configuration as configuration DEFAULT_VALUES = configuration.returnListOfConfigurationValues("mailfy") # Capturing errors just in case the option is not found in the configuration try: excludeList = [DEFAULT_VALUES["exclude_domains"]] except: excludeList = [] parser = argparse.ArgumentParser(description='mailfy.py - Checking the existence of a given mail.', prog='mailfy.py', epilog='Check the README.md file for further details on the usage of this program or follow us on Twitter in <http://twitter.com/i3visio>.', add_help=False) parser._optionals.title = "Input options (one required)" # Defining the mutually exclusive group for the main options groupMainOptions = parser.add_mutually_exclusive_group(required=True) # Adding the main options groupMainOptions.add_argument('--license', required=False, action='store_true', default=False, help='shows the GPLv3+ license and exists.') groupMainOptions.add_argument('-m', '--emails', metavar='<emails>', nargs='+', action='store', help = 'the list of emails to be checked.') groupMainOptions.add_argument('-M', '--emails_file', metavar='<emails_file>', action='store', help = 'the file with the list of emails.') groupMainOptions.add_argument('-n', '--nicks', metavar='<nicks>', nargs='+', action='store', help = 'the list of nicks to be checked in the domains selected.') groupMainOptions.add_argument('-N', '--nicks_file', metavar='<nicks_file>', action='store', help = 'the file with the list of nicks to be checked in the domains selected.') groupMainOptions.add_argument('--create_emails', metavar='<nicks_file>', action='store', help = 'the file with the list of nicks to be created in the domains selected.') # Configuring the processing options groupProcessing = parser.add_argument_group('Processing arguments', 'Configuring the way in which mailfy will process the identified profiles.') #groupProcessing.add_argument('-L', '--logfolder', metavar='<path_to_log_folder', required=False, default = './logs', action='store', help='path to the log folder. If none was provided, ./logs is assumed.') groupProcessing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'mtz', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.') groupProcessing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.') groupProcessing.add_argument('-d', '--domains', metavar='<candidate_domains>', nargs='+', choices=['all'] + EMAIL_DOMAINS, action='store', help='list of domains where the nick will be looked for.', required=False, default=DEFAULT_VALUES["domains"]) groupProcessing.add_argument('-x', '--exclude', metavar='<domain>', choices=EMAIL_DOMAINS, nargs='+', required=False, default=excludeList, action='store', help="select the domains to be excluded from the search.") # Getting a sample header for the output files groupProcessing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' ) groupProcessing.add_argument('-T', '--threads', metavar='<num_threads>', required=False, action='store', default = int(DEFAULT_VALUES["threads"]), type=int, help='write down the number of threads to be used (default 16). If 0, the maximum number possible will be used, which may make the system feel unstable.') groupProcessing.add_argument('--quiet', required=False, action='store_true', default=False, help='tells the program not to show anything.') # About options groupAbout = parser.add_argument_group('About arguments', 'Showing additional information about this program.') groupAbout.add_argument('-h', '--help', action='help', help='shows this help and exists.') #groupAbout.add_argument('-v', '--verbose', metavar='<verbosity>', choices=[0, 1, 2], required=False, action='store', default=1, help='select the verbosity level: 0 - none; 1 - normal (default); 2 - debug.', type=int) groupAbout.add_argument('--version', action='version', version='%(prog)s ' +" " +__version__, help='shows the version of the program and exists.') return parser
def getParser(): DEFAULT_VALUES = configuration.returnListOfConfigurationValues("domainfy") # Capturing errors just in case the option is not found in the configuration try: excludeList = [DEFAULT_VALUES["exclude_platforms"]] except: excludeList = [] parser = argparse.ArgumentParser(description='domainfy - Checking the existence of domains.', prog='domainfy', epilog='Check the README.md file for further details on the usage of this program or follow us on Twitter in <http://twitter.com/i3visio>.', add_help=False, conflict_handler='resolve') parser._optionals.title = "Input options (one required)" # Adding the main options groupMainOptions = parser.add_mutually_exclusive_group(required=True) groupMainOptions.add_argument('--license', required=False, action='store_true', default=False, help='shows the GPLv3+ license and exists.') groupMainOptions.add_argument('-n', '--nicks', metavar='<nicks>', nargs='+', action='store', help = 'the list of nicks to be checked in the domains selected.') groupMainOptions.add_argument('-N', '--nicks_file', metavar='<nicks_file>', action='store', help = 'the file with the list of nicks to be checked in the domains selected.') # Configuring the processing options groupProcessing = parser.add_argument_group('Processing arguments', 'Configuring the way in which mailfy will process the identified profiles.') groupProcessing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.') groupProcessing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.') groupProcessing.add_argument('-t', '--tlds', metavar='<tld_type>', nargs='+', choices=["all", "none"] + TLD.keys(), action='store', help='List of tld types where the nick will be looked for.', required=False, default=DEFAULT_VALUES["tlds"]) groupProcessing.add_argument('-u', '--user_defined', metavar='<new_tld>', nargs='+', action='store', help='Additional TLD that will be searched.', required=False, default = DEFAULT_VALUES["user_defined"]) groupProcessing.add_argument('-x', '--exclude', metavar='<domain>', nargs='+', required=False, default=excludeList, action='store', help="select the domains to be avoided. The format should include the initial '.'.") groupProcessing.add_argument('--whois', required=False, action='store_true', default=False, help='tells the program to launch whois queries.') # Getting a sample header for the output files groupProcessing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' ) groupProcessing.add_argument('-T', '--threads', metavar='<num_threads>', required=False, action='store', default= int(DEFAULT_VALUES["threads"]), type=int, help='write down the number of threads to be used (default 16). If 0, the maximum number possible will be used, which may make the system feel unstable.') groupProcessing.add_argument('--quiet', required=False, action='store_true', default=False, help='tells the program not to show anything.') # About options groupAbout = parser.add_argument_group('About arguments', 'Showing additional information about this program.') groupAbout.add_argument('-h', '--help', action='help', help='shows this help and exists.') groupAbout.add_argument('--version', action='version', version='[%(prog)s] OSRFramework ' + osrframework.__version__, help='shows the version of the program and exists.') return parser
def getParser(): import osrframework.utils.configuration as configuration DEFAULT_VALUES = configuration.returnListOfConfigurationValues("entify") parser = argparse.ArgumentParser(description='entify.py - entify.py is a program designed to extract using regular expressions all the entities from the files on a given folder. This software also provides an interface to look for these entities in any given text.', prog='entify.py', epilog="Check the README.md file for further details on the usage of this program or follow us on Twitter in <http://twitter.com/i3visio>.", add_help=False) parser._optionals.title = "Input options (one required)" # Adding the main options # Defining the mutually exclusive group for the main options groupMainOptions = parser.add_mutually_exclusive_group(required=True) listAll = regexp_selection.getAllRegexpNames() groupMainOptions.add_argument('-r', '--regexp', metavar='<name>', choices=listAll, action='store', nargs='+', help='select the regular expressions to be looked for amongst the following: ' + str(listAll)) groupMainOptions.add_argument('-R', '--new_regexp', metavar='<regular_expression>', action='store', help='add a new regular expression, for example, for testing purposes.') # Adding the main options # Defining the mutually exclusive group for the main options groupInput = parser.add_mutually_exclusive_group(required=True) groupInput.add_argument('-i', '--input_folder', metavar='<path_to_input_folder>', default=None, action='store', help='path to the folder to analyse.') groupInput.add_argument('-w', '--web', metavar='<url>', action='store', default=None, help='URI to be recovered and analysed.') # adding the option groupProcessing = parser.add_argument_group('Processing arguments', 'Configuring the processing parameters.') groupProcessing.add_argument('-e', '--extension', metavar='<sum_ext>', nargs='+', choices=['csv', 'gml', 'json', 'mtz', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default = DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.') groupProcessing.add_argument('-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default = DEFAULT_VALUES["output_folder"], action='store', help='output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.') groupProcessing.add_argument('-v', '--verbose', metavar='<verbosity>', choices=[0, 1, 2], required=False, action='store', default=1, help='select the verbosity level: 0 - none; 1 - normal (default); 2 - debug.', type=int) # Getting a sample header for the output files groupProcessing.add_argument('-F', '--file_header', metavar='<alternative_header_file>', required=False, default = DEFAULT_VALUES["file_header"], action='store', help='Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' ) groupProcessing.add_argument('-q', '--quiet', required=False, action='store_true', default=False, help='Asking the program not to show any output.') groupProcessing.add_argument('-L', '--logfolder', metavar='<path_to_log_folder', required=False, default = './logs', action='store', help='path to the log folder. If none was provided, ./logs is assumed.') groupProcessing.add_argument('--recursive', action='store_true', default=False, required=False, help='Variable to tell the system to perform a recursive search on the folder tree.') groupAbout = parser.add_argument_group('About arguments', 'Showing additional information about this program.') groupAbout.add_argument('-h', '--help', action='help', help='shows this help and exists.') groupAbout.add_argument('--version', action='version', version='%(prog)s '+" " +__version__, help='shows the version of the program and exists.') return parser
"""404 Not Found. Thee requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. """ return render_template( 'error.html', errorCode='404', errorDescription= 'Client Error: 404 Not Found. The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.', ), 404 # -------------- # Launching code # -------------- if __name__ == "__main__": DEFAULT_VALUES = configuration.returnListOfConfigurationValues( "osrframework-server") try: SECRET_TOKEN = DEFAULT_VALUES["secret_token"] except: SECRET_TOKEN = None try: # Get file path from app.config['UPLOAD_FOLDER'] = DEFAULT_VALUES["upload_folder"] except: app.config['UPLOAD_FOLDER'] = "/tmp/" # Loading the server parser parser = argparse.ArgumentParser( description=
class OSRFConsoleUsufy(OSRFConsoleUtil): """Class that controls an interactive usufy program""" # Setting up the name of the module UNAME = "usufy.py" intro = "" # Defining the prompt prompt = general.emphasis('osrf (' + UNAME.split('.')[0] + ') > ') # Defining the character to create hyphens ruler = '-' DEFAULT_VALUES = configuration.returnListOfConfigurationValues("usufy") # Defining the configuration for this module CONFIG = {} CONFIG["NICK"] = { "DESCRIPTION" : "Alias to be verified.", "CURRENT_VALUE" : None, "DEFAULT_VALUE" : None, "REQUIRED" : True, "OPTIONS" : [] } CONFIG["PLATFORMS"] = { "DESCRIPTION" : "Platforms to be checked.", "CURRENT_VALUE" : DEFAULT_VALUES["platforms"], "DEFAULT_VALUE" : DEFAULT_VALUES["platforms"], "REQUIRED" : False, "OPTIONS" : platform_selection.getAllPlatformNames("usufy"), } CONFIG["THREADS"] = { "DESCRIPTION" : "Number of threads to use.", "CURRENT_VALUE" : DEFAULT_VALUES["threads"], "DEFAULT_VALUE" : DEFAULT_VALUES["threads"], "REQUIRED" : False, "OPTIONS" : [] } CONFIG["OUTPUT"] = { "DESCRIPTION" : "The path to the output folder where the files will be created.", "CURRENT_VALUE" : DEFAULT_VALUES["output_folder"], "DEFAULT_VALUE" : DEFAULT_VALUES["output_folder"], "REQUIRED" : False, "OPTIONS" : [] } CONFIG["EXTENSION"] = { "DESCRIPTION" : "The default extension of the files to be written.", "CURRENT_VALUE" : DEFAULT_VALUES["extension"], "DEFAULT_VALUE" : DEFAULT_VALUES["extension"], "REQUIRED" : False, "OPTIONS" : ['csv', 'xls', 'xlsx', 'json', 'gml'] } def _getParams(self): """Function that creates the array with the params that will work with this function.""" # Creating the parameters as if they were created using the command line params = [ "-n" ] + self.CONFIG["NICK"]["CURRENT_VALUE"].split() + [ "-p" ] + self.CONFIG["PLATFORMS"]["CURRENT_VALUE"].split() + [ "-T", str(self.CONFIG["THREADS"]["CURRENT_VALUE"]), "-o", self.CONFIG["OUTPUT"]["CURRENT_VALUE"], "-e" ] + self.CONFIG["EXTENSION"]["CURRENT_VALUE"].split() return params def do_run(self, line): """Running the current application. This method should be redefined for each util.""" print # Checking if all the required parameters have been set if self._checkIfRequiredAreSet(): print(general.info("Collecting the options set by the user...")) # Getting the parser... parser = usufy.getParser() # Generating the parameters params = self._getParams() args = parser.parse_args(params) print(general.info("Launching " + self.UNAME + " with the following parameters: ") + general.emphashis(str(params))) try: usufy.main(args) except Exception as e: print(gemeral.error("[!] ERROR. Something happenned when launching the utility. Type 'show options' to check the parameters. ")) print(general.error("Traceback: " + str(e))) else: print(general.error("[!] ERROR. There are required parameters which have not been set.")) self.do_show("options") print(general.success("Execution ended successfully."))
class OSRFConsoleDomainfy(OSRFConsoleUtil): """ Class that controls an interactive domainfy program """ # Setting up the name of the module UNAME = "domainfy" intro = """ Loading """ + UNAME + """...""" description = """ A tool to look for registered domains using certain nicknames or words. The searches are performed in hundreads of different TLDs.""" # Defining the prompt prompt = general.emphasis('\nosrf (' + UNAME + ') > ') # Defining the character to create hyphens ruler = '-' # Defining the configuration for this module CONFIG = {} DEFAULT_VALUES = configuration.returnListOfConfigurationValues("domainfy") # Defining the configuration for this module CONFIG = {} CONFIG["NICK"] = { "DESCRIPTION": "Nick to be verified.", "CURRENT_VALUE": None, "DEFAULT_VALUE": None, "REQUIRED": True, "OPTIONS": [] } CONFIG["TLD"] = { "DESCRIPTION": "Types of TLD to be verified", "CURRENT_VALUE": DEFAULT_VALUES["tlds"], "DEFAULT_VALUE": DEFAULT_VALUES["tlds"], "REQUIRED": False, "OPTIONS": domainfy.TLD.keys(), } CONFIG["THREADS"] = { "DESCRIPTION": "Number of threads to use.", "CURRENT_VALUE": DEFAULT_VALUES["threads"], "DEFAULT_VALUE": DEFAULT_VALUES["threads"], "REQUIRED": False, "OPTIONS": [] } CONFIG["OUTPUT"] = { "DESCRIPTION": "The path to the output folder where the files will be created.", "CURRENT_VALUE": DEFAULT_VALUES["output_folder"], "DEFAULT_VALUE": DEFAULT_VALUES["output_folder"], "REQUIRED": False, "OPTIONS": [] } CONFIG["EXTENSION"] = { "DESCRIPTION": "The default extension of the files to be written.", "CURRENT_VALUE": DEFAULT_VALUES["extension"], "DEFAULT_VALUE": DEFAULT_VALUES["extension"], "REQUIRED": False, "OPTIONS": ['csv', 'xls', 'xlsx', 'json', 'gml'] } CONFIG["USER_DEFINED"] = { "DESCRIPTION": "Other TLD to be verified. Note that it should start with a '.'.", "CURRENT_VALUE": None, "DEFAULT_VALUE": None, "REQUIRED": False, "OPTIONS": [], } def _getParams(self): """ Function that creates the array with the params of this function Returns: -------- list: A list of the params that can be used """ # Creating the parameters as if they were created using the command line params = ["-n"] + self.CONFIG["NICK"]["CURRENT_VALUE"] + [ "-t" ] + self.CONFIG["TLD"]["CURRENT_VALUE"] + [ "-T", str(self.CONFIG["THREADS"]["CURRENT_VALUE"]), "-o", self.CONFIG["OUTPUT"]["CURRENT_VALUE"], "-e" ] + self.CONFIG["EXTENSION"]["CURRENT_VALUE"] # Appending new tlds if provided if self.CONFIG["USER_DEFINED"]["CURRENT_VALUE"] != None: params += ["-u", self.CONFIG["USER_DEFINED"]["CURRENT_VALUE"]] return params def do_run(self, line): """ Command that send the order to the framework to launch this util Args: ----- line: The string of the line typed. """ # Checking if all the required parameters have been set if self._checkIfRequiredAreSet(): print( general.info("\nCollecting the options set by the user...\n")) # Getting the parser... parser = domainfy.getParser() # Generating the parameters params = self._getParams() args = parser.parse_args(params) print( general.info("\nLaunching " + self.UNAME + " with the following parameters: ") + general.emphasis(str(params))) try: domainfy.main(args) except Exception as e: print( general.error( "\n[!!] ERROR. Something happened when launching the utility. Type 'show options' to check the parameters. " )) print(general.error("Traceback: " + str(e))) return else: print( general.error( "\n[!!] ERROR. There are required parameters which have not been set." )) self.do_show("options") return print(general.success("\nExecution ended successfully."))
class OSRFConsoleSearchfy(OSRFConsoleUtil): """ Class that controls an interactive searchfy program """ # Setting up the name of the module UNAME = "searchfy" intro = """ Loading """ + UNAME + """...""" description = """ A tool to look for people using different search engines found in several platforms. This tool will wrap the search capabilities provided by the platforms.""" # Defining the prompt prompt = general.emphasis('\nosrf (' + UNAME + ') > ') # Defining the character to create hyphens ruler = '-' # Defining the configuration for this module CONFIG = {} DEFAULT_VALUES = configuration.returnListOfConfigurationValues("searchfy") # Defining the configuration for this module CONFIG = {} CONFIG["QUERY"] = { "DESCRIPTION": "Query to be verified. Escape \" and \'.", "CURRENT_VALUE": None, "DEFAULT_VALUE": None, "REQUIRED": True, "OPTIONS": [] } CONFIG["PLATFORMS"] = { "DESCRIPTION": "Platforms to be checked.", "CURRENT_VALUE": DEFAULT_VALUES["platforms"], "DEFAULT_VALUE": DEFAULT_VALUES["platforms"], "REQUIRED": False, "OPTIONS": platform_selection.getAllPlatformNames("searchfy"), } CONFIG["OUTPUT"] = { "DESCRIPTION": "The path to the output folder where the files will be created.", "CURRENT_VALUE": DEFAULT_VALUES["output_folder"], "DEFAULT_VALUE": DEFAULT_VALUES["output_folder"], "REQUIRED": False, "OPTIONS": [] } CONFIG["EXTENSION"] = { "DESCRIPTION": "The default extension of the files to be written.", "CURRENT_VALUE": DEFAULT_VALUES["extension"], "DEFAULT_VALUE": DEFAULT_VALUES["extension"], "REQUIRED": False, "OPTIONS": ['csv', 'xls', 'xlsx', 'json', 'gml'] } def _getParams(self): """ Function that creates the array with the params of this function Returns: -------- list: A list of the params that can be used """ # Creating the parameters as if they were created using the command line params = ["-q"] + self.CONFIG["QUERY"]["CURRENT_VALUE"] + [ "-p" ] + self.CONFIG["PLATFORMS"]["CURRENT_VALUE"] + [ "-o", self.CONFIG["OUTPUT"]["CURRENT_VALUE"], "-e" ] + self.CONFIG["EXTENSION"]["CURRENT_VALUE"] return params def do_run(self, line): """ Command that send the order to the framework to launch this util Args: ----- line: The string of the line typed. """ # Checking if all the required parameters have been set if self._checkIfRequiredAreSet(): print(general.info("\nCollecting the options set by the user...")) # Getting the parser... parser = searchfy.getParser() # Generating the parameters params = self._getParams() args = parser.parse_args(params) print( general.info("\nLaunching " + self.UNAME + " with the following parameters:") + general.emphasis("\t$ " + self.UNAME + " " + utils.listToString(params) + "\n")) try: searchfy.main(args) except Exception as e: print( general.error( "\n[!!] ERROR. Something happened when launching the utility. Type 'show options' to check the parameters.\n" )) print(general.error("Traceback: " + str(e))) else: print( general.error( "\n[!!] ERROR. There are required parameters which have not been set." )) self.do_show("options") print(general.success("Execution ended successfully."))
class OSRFConsoleEntify(OSRFConsoleUtil): """Class that controls an interactive entify program.""" # Setting up the name of the module UNAME = "entify.py" intro = "" # Defining the prompt prompt = 'osrf (' + UNAME.split('.')[0] + ') > ' # Defining the character to create hyphens ruler = '-' DEFAULT_VALUES = configuration.returnListOfConfigurationValues("entify") # Defining the configuration for this module CONFIG = {} CONFIG["URL"] = { "DESCRIPTION": "The URL to be checked.", "CURRENT_VALUE": None, "DEFAULT_VALUE": None, "REQUIRED": True, "OPTIONS": [] } CONFIG["REGEXP"] = { "DESCRIPTION": "The regular expressions to be checked.", "CURRENT_VALUE": "all", "DEFAULT_VALUE": "all", "REQUIRED": False, "OPTIONS": regexp_selection.getAllRegexpNames(), } CONFIG["OUTPUT"] = { "DESCRIPTION": "The path to the output folder where the files will be created.", "CURRENT_VALUE": DEFAULT_VALUES["output_folder"], "DEFAULT_VALUE": DEFAULT_VALUES["output_folder"], "REQUIRED": False, "OPTIONS": [] } CONFIG["EXTENSION"] = { "DESCRIPTION": "The default extension of the files to be written.", "CURRENT_VALUE": DEFAULT_VALUES["extension"], "DEFAULT_VALUE": DEFAULT_VALUES["extension"], "REQUIRED": False, "OPTIONS": ['csv', 'xls', 'xlsx', 'json', 'gml'] } def _getParams(self): """ Function that creates the array with the params of this function Returns: -------- list: a list of the params that can be used """ # Creating the parameters as if they were created using the command line params = ["-u", self.CONFIG["URL"]["CURRENT_VALUE"], "-r" ] + self.CONFIG["REGEXP"]["CURRENT_VALUE"].split() + [ "-o", self.CONFIG["OUTPUT"]["CURRENT_VALUE"], "-e" ] + self.CONFIG["EXTENSION"]["CURRENT_VALUE"].split() return params def do_run(self, line): """ Command that send the order to the framework to launch this util Args: ----- line: the string of the line typed. """ # Checking if all the required parameters have been set if self._checkIfRequiredAreSet(): print(general.info("Collecting the options set by the user...")) # Getting the parser... parser = entify.getParser() # Generating the parameters params = self._getParams() args = parser.parse_args(params) print( general.info("Launching " + self.UNAME + " with the following parameters: ") + general.emphashis(str(params))) try: usufy.main(args) except Exception as e: print( gemeral.error( "[!] ERROR. Something happened when launching the utility. Type 'show options' to check the parameters. " )) print(general.error("Traceback: " + str(e))) else: print( general.error( "[!] ERROR. There are required parameters which have not been set." )) self.do_show("options") print(general.success("Execution ended successfully."))
def getParser(): DEFAULT_VALUES = configuration.returnListOfConfigurationValues("phonefy") # Capturing errors just in case the option is not found in the configuration try: excludeList = [DEFAULT_VALUES["exclude_platforms"]] except: excludeList = [] parser = argparse.ArgumentParser( description= 'phonefy.py - Piece of software that checks the existence of a given series of phones in a bunch of phone number lists associated to malicious activities.', prog='phonefy.py', epilog= 'Check the README.md file for further details on the usage of this program or follow us on Twitter in <http://twitter.com/i3visio>.', add_help=False) parser._optionals.title = "Input options (one required)" # Defining the mutually exclusive group for the main options groupMainOptions = parser.add_mutually_exclusive_group(required=True) # Adding the main options groupMainOptions.add_argument('--license', required=False, action='store_true', default=False, help='shows the GPLv3+ license and exists.') groupMainOptions.add_argument( '-n', '--numbers', metavar='<phones>', nargs='+', action='store', help='the list of phones to process (at least one is required).') listAll = platform_selection.getAllPlatformNames("phonefy") # Configuring the processing options groupProcessing = parser.add_argument_group( 'Processing arguments', 'Configuring the way in which usufy will process the identified profiles.' ) #groupProcessing.add_argument('-L', '--logfolder', metavar='<path_to_log_folder', required=False, default = './logs', action='store', help='path to the log folder. If none was provided, ./logs is assumed.') groupProcessing.add_argument( '-e', '--extension', metavar='<sum_ext>', nargs='+', choices=[ 'csv', 'gml', 'json', 'mtz', 'ods', 'png', 'txt', 'xls', 'xlsx' ], required=False, default=DEFAULT_VALUES["extension"], action='store', help='output extension for the summary files. Default: xls.') groupProcessing.add_argument( '-o', '--output_folder', metavar='<path_to_output_folder>', required=False, default=DEFAULT_VALUES["output_folder"], action='store', help= 'output folder for the generated documents. While if the paths does not exist, usufy.py will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.' ) groupProcessing.add_argument( '-p', '--platforms', metavar='<platform>', choices=listAll, nargs='+', required=False, default=DEFAULT_VALUES["platforms"], action='store', help= 'select the platforms where you want to perform the search amongst the following: ' + str(listAll) + '. More than one option can be selected.') # Getting a sample header for the output files groupProcessing.add_argument( '-F', '--file_header', metavar='<alternative_header_file>', required=False, default=DEFAULT_VALUES["file_header"], action='store', help= 'Header for the output filenames to be generated. If None was provided the following will be used: profiles.<extension>.' ) groupProcessing.add_argument( '--quiet', required=False, action='store_true', default=False, help='tells the program not to show anything.') groupProcessing.add_argument( '-w', '--web_browser', required=False, action='store_true', help='opening the URIs returned in the default web browser.') groupProcessing.add_argument( '-x', '--exclude', metavar='<platform>', choices=listAll, nargs='+', required=False, default=excludeList, action='store', help= 'select the platforms that you want to exclude from the processing.') # About options groupAbout = parser.add_argument_group( 'About arguments', 'Showing additional information about this program.') groupAbout.add_argument('-h', '--help', action='help', help='shows this help and exists.') #groupAbout.add_argument('-v', '--verbose', metavar='<verbosity>', choices=[0, 1, 2], required=False, action='store', default=1, help='select the verbosity level: 0 - none; 1 - normal (default); 2 - debug.', type=int) groupAbout.add_argument( '--version', action='version', version='%(prog)s ' + " " + __version__, help='shows the version of the program and exists.') return parser
class OSRFConsoleMailfy(OSRFConsoleUtil): """ Class that controls an interactive mailfy program """ # Setting up the name of the module UNAME = "mailfy" intro = """ Loading """ + UNAME + """...""" description = """ A tool to look for known information about email addresses. The analyst will be able to verify the existence of different email accounts as well as trying to find it in leaked databases.""" # Defining the prompt prompt = general.emphasis('\nosrf (' + UNAME + ') > ') # Defining the character to create hyphens ruler = '-' # Defining the configuration for this module CONFIG = {} DEFAULT_VALUES = configuration.returnListOfConfigurationValues("mailfy") # Defining the configuration for this module CONFIG = {} CONFIG["NICK"] = { "DESCRIPTION": "Alias to be verified.", "CURRENT_VALUE": None, "DEFAULT_VALUE": None, "REQUIRED": True, "OPTIONS": [] } CONFIG["PLATFORMS"] = { "DESCRIPTION": "Platforms to be checked.", "CURRENT_VALUE": DEFAULT_VALUES["domains"], "DEFAULT_VALUE": DEFAULT_VALUES["domains"], "REQUIRED": False, "OPTIONS": mailfy.EMAIL_DOMAINS, } CONFIG["THREADS"] = { "DESCRIPTION": "Number of threads to use.", "CURRENT_VALUE": DEFAULT_VALUES["threads"], "DEFAULT_VALUE": DEFAULT_VALUES["threads"], "REQUIRED": False, "OPTIONS": [] } CONFIG["OUTPUT"] = { "DESCRIPTION": "The path to the output folder where the files will be created.", "CURRENT_VALUE": DEFAULT_VALUES["output_folder"], "DEFAULT_VALUE": DEFAULT_VALUES["output_folder"], "REQUIRED": False, "OPTIONS": [] } CONFIG["EXTENSION"] = { "DESCRIPTION": "The default extension of the files to be written.", "CURRENT_VALUE": DEFAULT_VALUES["extension"], "DEFAULT_VALUE": DEFAULT_VALUES["extension"], "REQUIRED": False, "OPTIONS": ['csv', 'xls', 'xlsx', 'json', 'gml'] } def _getParams(self): """ Function that creates the array with the params of this function Returns: -------- list: a list of the params that can be used """ # Creating the parameters as if they were created using the command line params = ["-n"] + self.CONFIG["NICK"]["CURRENT_VALUE"] + [ "-d" ] + self.CONFIG["PLATFORMS"]["CURRENT_VALUE"] + [ "-T", str(self.CONFIG["THREADS"]["CURRENT_VALUE"]), "-o", self.CONFIG["OUTPUT"]["CURRENT_VALUE"], "-e" ] + self.CONFIG["EXTENSION"]["CURRENT_VALUE"] return params def do_run(self, line): """ Command that send the order to the framework to launch this util Args: ----- line: The string of the line typed. """ # Checking if all the required parameters have been set if self._checkIfRequiredAreSet(): print( general.info("\nCollecting the options set by the user...\n")) # Getting the parser... parser = mailfy.getParser() # Generating the parameters params = self._getParams() args = parser.parse_args(params) print( general.info("\nLaunching " + self.UNAME + " with the following parameters:") + general.emphasis("\t$ " + self.UNAME + " " + utils.listToString(params) + "\n")) try: mailfy.main(args) except Exception as e: print( general.error( "\n[!!] ERROR. Something happened when launching the utility. Type 'show options' to check the parameters.\n" )) print(general.error("Traceback: " + str(e))) else: print( general.error( "\n[!!] ERROR. There are required parameters which have not been set." )) self.do_show("options") print(general.success("Execution ended successfully."))