def ssh_protocol(data): normalized_data = ssh.normalizer.Normalizer(data).normalize() subclasses = SSHProcess.all_subclasses() meta = Metadata() for sub in subclasses: meta = sub().process(normalized_data, meta) if not meta.is_empty(): normalized_data['metadata'] = normalized_data.to_dict() normalized_data = Juniper.has_backdoor(normalized_data) return normalized_data
def http_protocol(data, old_data): if old_data: data = http.normalizer.Normalizer(data).normalize() parsed_data = HTTPPreprocessor.preprocess(data) subclasses = HTTPProcess.all_subclasses() meta = Metadata() for sub in subclasses: meta.merge(sub().process(parsed_data, Metadata())) if not meta.is_empty(): parsed_data['metadata'] = meta.to_dict() return parsed_data