コード例 #1
0
    def __init__(self):
        GrepPlugin.__init__(self)

        # Internal variables
        self._reported = DiskList(table_prefix='path_disclosure')

        # Compile all regular expressions and store information to avoid
        # multiple queries to the same function
        self._common_directories = get_common_directories()
        self._compiled_regexes = {}
        self._compile_regex()
コード例 #2
0
    def __init__(self):
        GrepPlugin.__init__(self)

        # Internal variables
        self._already_added = DiskList()

        # Compile all regular expressions and store information to avoid
        # multiple queries to the same function
        self._common_directories = get_common_directories()
        self._compiled_regexes = {}
        self._compile_regex()
コード例 #3
0
ファイル: path_disclosure.py プロジェクト: 0x554simon/w3af
    def __init__(self):
        GrepPlugin.__init__(self)

        # Internal variables
        self._reported = DiskList(table_prefix='path_disclosure')

        # Compile all regular expressions and store information to avoid
        # multiple queries to the same function
        self._common_directories = get_common_directories()
        self._compiled_regexes = {}
        self._compile_regex()
コード例 #4
0
    def __init__(self):
        GrepPlugin.__init__(self)

        # Internal variables
        self._already_added = DiskList()

        # Compile all regular expressions and store information to avoid
        # multiple queries to the same function
        self._common_directories = get_common_directories()
        self._compiled_regexes = {}
        self._compile_regex()
コード例 #5
0
    def setup(self):
        """
        :return: None, the result is saved in self._path_disc_regex_list
        """
        if self._signature_re is not None:
            return

        all_signatures = []

        for path_disclosure_string in get_common_directories():
            regex_string = '(%s.*?)[^A-Za-z0-9\._\-\\/\+~]'
            regex_string = regex_string % path_disclosure_string
            all_signatures.append(regex_string)

        self._signature_re = MultiRE(all_signatures, hint_len=1)
コード例 #6
0
ファイル: path_disclosure.py プロジェクト: batmanWjw/w3af
    def setup(self):
        """
        :return: None, the result is saved in self._path_disc_regex_list
        """
        if self._signature_re is not None:
            return

        all_signatures = []

        for path_disclosure_string in get_common_directories():
            regex_string = '(%s.*?)[^A-Za-z0-9\._\-\\/\+~]'
            regex_string = regex_string % path_disclosure_string
            all_signatures.append(regex_string)
            
        self._signature_re = multi_re(all_signatures, hint_len=1)
コード例 #7
0
ファイル: spider.py プロジェクト: webvul/webfuzzer
        def extract_files_from_file(filename, file_content):
            """
            :param filename: The filename to request to the remote end and parse
            :param file_content: The content of the file to analyze
            :return: A list of files referenced in "filename"
            """
            # Compile
            regular_expressions = []
            for common_dirs in get_common_directories():
                regex_string = '(' + common_dirs + \
                               '.*?)[:| |\0|\'|"|<|\n|\r|\t]'
                regex = re.compile(regex_string, re.IGNORECASE)
                regular_expressions.append(regex)

            # And use
            result = []
            for regex in regular_expressions:
                result.extend(regex.findall(file_content))

            # uniq
            result = list(set(result))

            return result
コード例 #8
0
ファイル: spider.py プロジェクト: 0x554simon/w3af
        def extract_files_from_file(filename, file_content):
            """
            :param filename: The filename to request to the remote end and parse
            :param file_content: The content of the file to analyze
            :return: A list of files referenced in "filename"
            """
            # Compile
            regular_expressions = []
            for common_dirs in get_common_directories():
                regex_string = '(' + common_dirs + \
                    '.*?)[:| |\0|\'|"|<|\n|\r|\t]'
                regex = re.compile(regex_string, re.IGNORECASE)
                regular_expressions.append(regex)

            # And use
            result = []
            for regex in regular_expressions:
                result.extend(regex.findall(file_content))

            # uniq
            result = list(set(result))

            return result
コード例 #9
0
 def test_linux(self):
     self.assertIn('/etc/', get_common_directories('linux'))
コード例 #10
0
 def test_windows(self):
     self.assertIn('C:\\\\', get_common_directories('windows'))
コード例 #11
0
 def test_linux(self):
     self.assertIn('/etc/', get_common_directories('linux'))
コード例 #12
0
 def test_windows(self):
     self.assertIn('C:\\\\', get_common_directories('windows'))