def get_parser():
    DEFAULT_VALUES = configuration.get_configuration_values_for("phonefy")
    # Capturing errors just in case the option is not found in the configuration
    try:
        exclude_list = [DEFAULT_VALUES["exclude_platforms"]]
    except:
        exclude_list = []

    parser = argparse.ArgumentParser(description='phonefy - 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', 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)"

    # Defining the mutually exclusive group for the main options
    group_main_options = parser.add_mutually_exclusive_group(required=True)
    # Adding the main options
    group_main_options.add_argument('--license', required=False, action='store_true', default=False, help='shows the GPLv3+ license and exists.')
    group_main_options.add_argument('-n', '--numbers', metavar='<phones>', nargs='+', action='store', help='the list of phones to process (at least one is required).')

    list_all = platform_selection.get_all_platform_names("phonefy")

    # Configuring the processing options
    group_processing = parser.add_argument_group('Processing arguments', 'Configuring the way in which usufy will process the identified profiles.')
    group_processing.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.')
    group_processing.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.')
    group_processing.add_argument('-p', '--platforms', metavar='<platform>', choices=list_all, nargs='+', required=False, default=DEFAULT_VALUES["platforms"] ,action='store', help='select the platforms where you want to perform the search amongst the following: ' + str(list_all) + '. More than one option can be selected.')
    group_processing.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>.' )
    group_processing.add_argument('--quiet', required=False, action='store_true', default=False, help='tells the program not to show anything.')
    group_processing.add_argument('-w', '--web_browser', required=False, action='store_true', help='opening the URIs returned in the default web browser.')
    group_processing.add_argument('-x', '--exclude', metavar='<platform>', choices=list_all, nargs='+', required=False, default=exclude_list, action='store', help='select the platforms that you want to exclude from the processing.')


    # About options
    group_about = parser.add_argument_group('About arguments', 'Showing additional information about this program.')
    group_about.add_argument('-h', '--help', action='help', help='shows this help and exists.')
    group_about.add_argument('--version', action='version', version='[%(prog)s] OSRFramework ' + osrframework.__version__, help='shows the version of the program and exists.')

    return parser
Пример #2
0
def get_parser():
    """Defines the argument parser

    Returns:
        argparse.ArgumentParser.
    """
    DEFAULT_VALUES = configuration.get_configuration_values_for("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.get_all_platform_names("usufy")

    parser = argparse.ArgumentParser(
        description=
        'usufy - Piece of software that checks the existence of a profile for a given user in dozens of different platforms.',
        prog='usufy',
        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
    group_mainOptions = parser.add_mutually_exclusive_group(required=True)
    group_mainOptions.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.'
    )
    group_mainOptions.add_argument('-b',
                                   '--benchmark',
                                   action='store_true',
                                   default=False,
                                   help='perform the benchmarking tasks.')
    group_mainOptions.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>'
    )
    group_mainOptions.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).'
    )
    group_mainOptions.add_argument(
        '-n',
        '--nicks',
        metavar='<nick>',
        nargs='+',
        action='store',
        help='the list of nicks to process (at least one is required).')
    group_mainOptions.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
    group_processing = parser.add_argument_group(
        'Processing arguments',
        'Configuring the way in which usufy will process the identified profiles.'
    )
    group_processing.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.'
    )
    group_processing.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.'
    )
    group_processing.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>.'
    )
    group_processing.add_argument(
        '--nonvalid',
        metavar='<not_valid_characters>',
        required=False,
        default='\\|<>=',
        action='store',
        help=
        "string containing the characters considered as not valid for nicknames."
    )
    group_processing.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.')
    group_processing.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.'
    )
    group_processing.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 will try to create; if this argument is not provided, usufy will NOT write any down any data. Check permissions if something goes wrong.'
    )
    group_processing.add_argument(
        '-w',
        '--web_browser',
        required=False,
        action='store_true',
        help='opening the uris returned in the default web browser.')
    group_processing.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>.'
    )
    group_processing.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
    group_about = parser.add_argument_group(
        'About arguments',
        'Showing additional information about this program.')
    group_about.add_argument('-h',
                             '--help',
                             action='help',
                             help='shows this help and exists.')
    group_about.add_argument(
        '-v',
        '--verbose',
        metavar='<verbosity>',
        choices=[0, 1, 2],
        required=False,
        action='store',
        default=1,
        help=
        'select the verbosity level: 0 - minimal; 1 - normal (default); 2 - debug.',
        type=int)
    group_about.add_argument(
        '--version',
        action='version',
        version='[%(prog)s] OSRFramework ' + osrframework.__version__,
        help='shows the version of the program and exits.')

    return parser
Пример #3
0
def get_parser():
    """Defines the argument parser

    Returns:
        argparse.ArgumentParser.
    """
    DEFAULT_VALUES = configuration.get_configuration_values_for("checkfy")

    parser = argparse.ArgumentParser(
        description=
        'checkfy - Finding potential email addresses based on a list of known aliases (either provided as arguments or read from a file) and a known pattern. Default values can be io',
        add_help=False,
        prog='checkfy',
        conflict_handler='resolve',
        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>.'
    )
    parser._optionals.title = "Input options (one required)"

    # Adding the main options
    group_main_options = parser.add_mutually_exclusive_group(required=True)
    group_main_options.add_argument(
        '--license',
        required=False,
        action='store_true',
        default=False,
        help='shows the GPLv3+ license and exists.')
    group_main_options.add_argument(
        '-n',
        '--nicks',
        metavar='<nicks>',
        nargs='+',
        action='store',
        help='the list of nicks to be checked in the domains selected.')
    group_main_options.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
    group_processing = parser.add_mutually_exclusive_group(required=True)
    group_processing.add_argument(
        '-m',
        '--email-pattern',
        metavar='<pattern>',
        action='store',
        help=
        'The email pattern that the generated email address SHOULD match. The pattern type can be configured using `--type`.'
    )

    # Configuring the application options
    group_options = parser.add_argument_group('Other options',
                                              'Configuring other options.')
    group_options.add_argument(
        '-o',
        '--output_folder',
        metavar='<path_to_output_folder>',
        required=False,
        default=DEFAULT_VALUES.get("output_folder", "./"),
        action='store',
        help=
        f'output folder for the generated files. Default: {DEFAULT_VALUES.get("output_folder", "./")}.'
    )
    group_options.add_argument(
        '-t',
        '--type',
        metavar='<type>',
        default=DEFAULT_VALUES.get("pattern_type", "twitter"),
        action='store',
        choices=["twitter", "regexp"],
        help=
        f'The type of pattern provided. It can be either the style used by Twitter to show the pattern suggestions or a regular expression. Default: {DEFAULT_VALUES.get("pattern_type", "twitter")}.',
        required=False)
    group_options.add_argument('--quiet',
                               required=False,
                               action='store_true',
                               default=False,
                               help='tells the program not to show anything.')

    # About options
    group_about = parser.add_argument_group(
        'About arguments',
        'Showing additional information about this program.')
    group_about.add_argument('-h',
                             '--help',
                             action='help',
                             help='shows this help and exists.')
    group_about.add_argument(
        '--version',
        action='version',
        version='[%(prog)s] OSRFramework ' + osrframework.__version__,
        help='shows the version of the program and exists.')

    return parser
Пример #4
0
def get_parser():
    DEFAULT_VALUES = configuration.get_configuration_values_for("mailfy")
    # Capturing errors just in case the option is not found in the configuration
    try:
        exclude_list = [DEFAULT_VALUES["exclude_domains"]]
    except:
        exclude_list = []

    # Recovering all the possible options
    plat_options = platform_selection.get_all_platform_names("mailfy")

    parser = argparse.ArgumentParser(
        description='mailfy - Checking the existence of a given mail.',
        prog='mailfy',
        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
    group_main_options = parser.add_mutually_exclusive_group(required=True)
    group_main_options.add_argument(
        '--license',
        required=False,
        action='store_true',
        default=False,
        help='shows the GPLv3+ license and exists.')
    group_main_options.add_argument('-m',
                                    '--emails',
                                    metavar='<emails>',
                                    nargs='+',
                                    action='store',
                                    help='the list of emails to be checked.')
    group_main_options.add_argument('-M',
                                    '--emails-file',
                                    metavar='<emails_file>',
                                    action='store',
                                    help='the file with the list of emails.')
    group_main_options.add_argument(
        '-n',
        '--nicks',
        metavar='<nicks>',
        nargs='+',
        action='store',
        help='the list of nicks to be checked in the domains selected.')
    group_main_options.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.'
    )
    group_main_options.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
    group_processing = parser.add_argument_group(
        'Processing arguments',
        'Configuring the way in which mailfy will process the identified profiles.'
    )
    group_processing.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.')
    group_processing.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"])
    group_processing.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.'
    )
    group_processing.add_argument(
        '-p',
        '--platforms',
        metavar='<platform>',
        choices=plat_options,
        nargs='+',
        required=False,
        default=["all"],
        action='store',
        help=
        'select the platforms where you want to perform the search amongst the following: {}. More than one option can be selected.'
        .format(str(plat_options)))
    group_processing.add_argument(
        '-x',
        '--exclude',
        metavar='<domain>',
        choices=EMAIL_DOMAINS,
        nargs='+',
        required=False,
        default=exclude_list,
        action='store',
        help="select the domains to be excluded from the search.")
    group_processing.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>.'
    )
    group_processing.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.'
    )
    group_processing.add_argument(
        '--quiet',
        required=False,
        action='store_true',
        default=False,
        help='tells the program not to show anything.')

    # About options
    group_about = parser.add_argument_group(
        'About arguments',
        'Showing additional information about this program.')
    group_about.add_argument('-h',
                             '--help',
                             action='help',
                             help='shows this help and exists.')
    group_about.add_argument(
        '--version',
        action='version',
        version='[%(prog)s] OSRFramework ' + osrframework.__version__,
        help='shows the version of the program and exists.')

    return parser
def get_parser():
    """Defines the argument parser

    Returns:
        argparse.ArgumentParser.
    """
    DEFAULT_VALUES = configuration.get_configuration_values_for("domainfy")
    # Capturing errors just in case the option is not found in the configuration
    try:
        exclude_list = [DEFAULT_VALUES["exclude_platforms"]]
    except Exception:
        exclude_list = []

    parser = argparse.ArgumentParser(
        description=
        'domainfy - Checking the existence of domains that resolev to an IP address.',
        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
    group_main_options = parser.add_mutually_exclusive_group(required=True)
    group_main_options.add_argument(
        '-n',
        '--nicks',
        metavar='<nicks>',
        nargs='+',
        action='store',
        help='the list of nicks to be checked in the domains selected.')
    group_main_options.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.'
    )
    group_main_options.add_argument(
        '--license',
        required=False,
        action='store_true',
        default=False,
        help='shows the GPLv3+ license and exists.')

    # Configuring the processing options
    group_processing = parser.add_argument_group(
        'Processing arguments',
        'Configuring the way in which mailfy will process the identified profiles.'
    )
    group_processing.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.')
    group_processing.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.'
    )
    group_processing.add_argument(
        '-t',
        '--tlds',
        metavar='<tld_type>',
        nargs='+',
        choices=["all", "none"] + list(TLD.keys()),
        action='store',
        help='list of TLD types where the nick will be looked for.',
        required=False,
        default=DEFAULT_VALUES["tlds"])
    group_processing.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"])
    group_processing.add_argument(
        '-x',
        '--exclude',
        metavar='<domain>',
        nargs='+',
        required=False,
        default=exclude_list,
        action='store',
        help=
        "select the domains to be avoided. The format should include the initial '.'."
    )
    group_processing.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>.'
    )
    group_processing.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.'
    )
    group_processing.add_argument(
        '--quiet',
        required=False,
        action='store_true',
        default=False,
        help='tells the program not to show anything.')
    group_processing.add_argument(
        '--whois',
        required=False,
        action='store_true',
        default=False,
        help='tells the program to launch whois queries.')

    # About options
    group_about = parser.add_argument_group(
        'About arguments',
        'Showing additional information about this program.')
    group_about.add_argument('-h',
                             '--help',
                             action='help',
                             help='shows this help and exists.')
    group_about.add_argument(
        '--version',
        action='version',
        version='[%(prog)s] OSRFramework ' + osrframework.__version__,
        help='shows the version of the program and exists.')

    return parser