Example #1
0
    def get_profile_list(self, directory=HOME_DIR):
        '''
        :param directory: The directory from which profiles are loaded

        :return: Two different lists:
            - One that contains the instances of the valid profiles that were loaded
            - One with the file names of the profiles that are invalid

        >>> HOME_DIR = '.'
        >>> p = w3af_core_profiles(None)
        >>> valid, invalid = p.get_profile_list(HOME_DIR)
        >>> valid_lower = [prof.get_name().lower() for prof in valid]
        >>> 'owasp_top10' in valid_lower
        True

        '''
        profile_home = os.path.join(directory, 'profiles')
        str_profile_list = get_file_list(profile_home, extension='.pw3af')

        instance_list = []
        invalid_profiles = []

        for profile_name in str_profile_list:
            profile_filename = os.path.join(
                profile_home, profile_name + '.pw3af')
            try:
                profile_instance = profile(profile_filename)
            except w3afException:
                invalid_profiles.append(profile_filename)
            else:
                instance_list.append(profile_instance)
        return instance_list, invalid_profiles
Example #2
0
 def get_plugin_list(self, plugin_type):
     '''
     :return: A string list of the names of all available plugins by type.
     '''
     str_plugin_list = get_file_list(os.path.join('plugins', plugin_type))
     return str_plugin_list
Example #3
0
 def getPluginList( self, pluginType ):
     '''
     @return: A string list of the names of all available plugins by type.
     '''
     strPluginList = get_file_list( 'plugins' + os.path.sep + pluginType + os.path.sep )
     return strPluginList