예제 #1
0
파일: profiles.py 프로젝트: 0x554simon/w3af
    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 = CoreProfiles(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=profile.EXTENSION)

        instance_list = []
        invalid_profiles = []

        for profile_name in str_profile_list:
            profile_filename = os.path.join(profile_home,
                                            profile_name + profile.EXTENSION)
            try:
                profile_instance = profile(profile_filename)
            except BaseFrameworkException:
                invalid_profiles.append(profile_filename)
            else:
                instance_list.append(profile_instance)

        return instance_list, invalid_profiles
예제 #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(ROOT_PATH, 'plugins', plugin_type))
     return str_plugin_list
예제 #3
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(ROOT_PATH, 'plugins',
                                                  plugin_type))
     return str_plugin_list
예제 #4
0
파일: profiles.py 프로젝트: shiham101/w3af
    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=profile.EXTENSION)

        instance_list = []
        invalid_profiles = []

        for profile_name in str_profile_list:
            profile_filename = os.path.join(profile_home,
                                            profile_name + profile.EXTENSION)
            try:
                profile_instance = profile(profile_filename)
            except BaseFrameworkException:
                invalid_profiles.append(profile_filename)
            else:
                instance_list.append(profile_instance)

        return instance_list, invalid_profiles