示例#1
0
def run(PluginInfo):
    Content = []
    args = {
        'Description': DESCRIPTION,
        'Mandatory': {
            'RHOST':
            config_handler.get_val('RHOST_DESCRIP'),
            'RPORT':
            config_handler.get_val('RPORT_DESCRIP'),
            'CATEGORY':
            'Category to use (i.e. ' + ', '.join(sorted(CATEGORIES)) + ')',
            'SUBCATEGORY':
            'Subcategory to use (i.e. ' + ', '.join(sorted(SUBCATEGORIES)) +
            ')'
        },
        'Optional': {
            'REPEAT_DELIM': config_handler.get_val('REPEAT_DELIM_DESCRIP')
        }
    }
    for Args in plugin_params.get_args(args, PluginInfo):
        plugin_params.set_config(Args)
        resource = config_handler.get_resources('LaunchExploit_' +
                                                Args['CATEGORY'] + "_" +
                                                Args['SUBCATEGORY'])
        Content += plugin_helper.CommandDump('Test Command', 'Output',
                                             resource, PluginInfo, "")
    return Content
示例#2
0
def run(PluginInfo):
    Content = []
    args = {
        'Description': DESCRIPTION,
        'Mandatory': {
            'RHOST': config_handler.get_val('RHOST_DESCRIP'),
            'RPORT': config_handler.get_val('RPORT_DESCRIP'),
            'CATEGORY': 'Category to use (i.e. ' + ', '.join(sorted(CATEGORIES)) + ')'
        },
        'Optional': {
            'BRUTEFORCER': 'Bruteforcer to use (i.e. ' + ', '.join(sorted(BRUTEFORCER)) + ')',
            'ONLINE_USER_LIST': config_handler.get_val('ONLINE_USER_LIST_DESCRIP'),
            'ONLINE_PASSWORD_LIST': config_handler.get_val('ONLINE_PASSWORD_LIST_DESCRIP'),
            'THREADS': config_handler.get_val('THREADS_DESCRIP'),
            '_RESPONSE_WAIT': config_handler.get_val('_RESPONSE_WAIT_DESCRIP'),
            'CONNECT_WAIT': config_handler.get_val('CONNECT_WAIT_DESCRIP'),
            'REPEAT_DELIM': config_handler.get_val('REPEAT_DELIM_DESCRIP')
        }
    }

    for args in plugin_params.get_args(args, PluginInfo):
        plugin_params.set_config(args)
        resource = config_handler.get_resources('PassBruteForce_' + args['BRUTEFORCER'] + "_" + args['CATEGORY'])
        Content += plugin_helper.CommandDump('Test Command', 'Output', resource, PluginInfo, "")  # No previous output
    return Content
示例#3
0
def run(PluginInfo):
    Content = []
    smb = SMB()
    args = {
        'Description': DESCRIPTION,
        'Mandatory': {
            'SMB_HOST': config_handler.get_val('SMB_HOST_DESCRIP'),
            'SMB_SHARE': config_handler.get_val('SMB_SHARE_DESCRIP'),
            'SMB_MOUNT_POINT': config_handler.get_val('SMB_MOUNT_POINT_DESCRIP'),
        },
        'Optional': {
            'SMB_USER': config_handler.get_val('SMB_USER_DESCRIP'),
            'SMB_PASS': config_handler.get_val('SMB_PASS_DESCRIP'),
            'SMB_DOWNLOAD': config_handler.get_val('SMB_DOWNLOAD_DESCRIP'),
            'SMB_UPLOAD': config_handler.get_val('SMB_UPLOAD_DESCRIP'),
            'REPEAT_DELIM': config_handler.get_val('REPEAT_DELIM_DESCRIP')
        }
    }

    for Args in plugin_params.get_args(args, PluginInfo):
        plugin_params.set_config(Args)  # Sets the auxiliary plugin arguments as config
        smb.Mount(Args, PluginInfo)
        smb.Transfer()
    if not smb.IsClosed():  # Ensure clean exit if reusing connection
        smb.UnMount(PluginInfo)
    return Content
示例#4
0
def get_header_list(key):
    """Get list from a string of values for a key

    :param key: Key
    :type key: `str`
    :return: List of values
    :rtype: `list`
    """
    from owtf.config import config_handler

    return config_handler.get_val(key).split(',')
示例#5
0
def get_as_list(key_list):
    """Get values for keys in a list

    :param key_list: List of keys
    :type key_list: `list`
    :return: List of corresponding values
    :rtype: `list`
    """
    from owtf.config import config_handler

    value_list = []
    for key in key_list:
        value_list.append(config_handler.get_val(key))
    return value_list
示例#6
0
def compile_regex():
    """General function for getting and compiling regexes

    :return: None
    :rtype: None
    """
    for key in list(config_handler.get_framework_config_dict().keys()):
        key = key[3:-3]  # Remove "@@@"
        if key.startswith('HEADERS'):
            header_list = get_header_list(key)
            regexes['HEADERS'][key] = compile_header_regex(header_list)
        elif key.startswith('RESPONSE'):
            _, _, python_regexp = config_handler.get_val(key).split('_____')
            regexes['BODY'][key] = compile_response_regex(python_regexp)
示例#7
0
    def default_arg_from_config(self, args, arg_name, settings_list):
        """Get default args from config

        :param args: args list
        :type args: `dict`
        :param arg_name: Name of arg to fetch
        :type arg_name: `str`
        :param settings_list: List of settings
        :type settings_list: `list`
        :return: True if run is successful
        :rtype: `bool`
        """
        default_order_str = " (Default order is: %s)" % str(settings_list)
        for setting in settings_list:
            if config_handler.is_set(setting):  # argument is set in config
                args[arg_name] = config_handler.get_val(setting)
                logging.info(
                    "default not passed '%s' to '%s'%s" %
                    (arg_name, str(args[arg_name]), default_order_str))
                return True
        logging.info("Could not default not passed: '%s'%s" %
                     (arg_name, default_order_str))
        return False