'Analyze results of the _send_mutant method.
Try to find the local file inclusions.'

def _analyze_result(self, mutant, response):

    if self._has_bug(mutant):
        return
    for file_pattern_match in self._find_common_file_fragments(response):
        if (file_pattern_match not in mutant.get_original_response_body()):
            desc = 'Local    File    Inclusion    was    found    at:    %s'
            desc %= mutant.found_at()
            v = Vuln.from_mutant('Local    file    inclusion    vulnerability', desc, severity.MEDIUM, response.id, self.get_name(), mutant)
            v['file_pattern'] = file_pattern_match
            v.add_to_highlight(file_pattern_match)
            self.kb_append_uniq(self, 'lfi', v)
            return
    if (mutant.get_url().get_file_name() in mutant.get_token_value()):
        (match, lang) = contains_source_code(response)
        if match:
            desc = 'An    arbitrary    local    file    read    vulnerability    was    found    at:    %s'
            desc %= mutant.found_at()
            v = Vuln.from_mutant('Local    file    inclusion    vulnerability', desc, severity.MEDIUM, response.id, self.get_name(), mutant)
            match_source_code = match.group(0)
            v['file_pattern'] = match_source_code
            self.kb_append_uniq(self, 'lfi', v)
            return
    body = response.get_body()
    for (_, error_str, _) in self.file_read_error_multi_re.query(body):
        if (error_str not in mutant.get_original_response_body()):
            desc = 'A    file    read    error    was    found    at:    %s'
            desc %= mutant.found_at()
            i = Info.from_mutant('File    read    error', desc, response.id, self.get_name(), mutant)
            i.add_to_highlight(error_str)
            self.kb_append_uniq(self, 'error', i)
