def from_dict(process_dict, process_cls = None): if not process_dict: return None if process_cls == None: process_ = Process() else: process_ = process_cls ObjectProperties.from_dict(process_dict, process_) process_.is_hidden = process_dict.get('is_hidden') process_.pid = UnsignedInteger.from_dict(process_dict.get('pid')) process_.name = String.from_dict(process_dict.get('name')) process_.creation_time = DateTime.from_dict(process_dict.get('creation_time')) process_.parent_pid = UnsignedInteger.from_dict(process_dict.get('parent_pid')) process_.child_pid_list = [UnsignedInteger.from_dict(x) for x in process_dict.get('child_pid_list', [])] process_.image_info = ImageInfo.from_dict(process_dict.get('image_info')) process_.argument_list = [String.from_dict(x) for x in process_dict.get('argument_list', [])] process_.environment_variable_list = EnvironmentVariableList.from_list(process_dict.get('environment_variable_list')) process_.kernel_time = Duration.from_dict(process_dict.get('kernel_time')) process_.port_list = [Port.from_dict(x) for x in process_dict.get('port_list', [])] process_.network_connection_list = [NetworkConnection.from_dict(x) for x in process_dict.get('network_connection_list', [])] process_.start_time = DateTime.from_dict(process_dict.get('start_time')) process_.username = String.from_dict(process_dict.get('username')) process_.user_time = Duration.from_dict(process_dict.get('user_time')) process_.extracted_features = None return process_
def from_dict(validity_dict): if not validity_dict: return None validity_ = Validity() validity_.not_after = DateTime.from_dict(validity_dict.get('not_after')) validity_.not_before = DateTime.from_dict(validity_dict.get('not_before')) return validity_
def from_dict(win_file_dict, file_class = None): if not win_file_dict: return None if not file_class: win_file_ = File.from_dict(win_file_dict, WinFile()) else: win_file_ = File.from_dict(win_file_dict, file_class) win_file_.filename_accessed_time = DateTime.from_dict(win_file_dict.get('filename_accessed_time')) win_file_.filename_created_time = DateTime.from_dict(win_file_dict.get('filename_created_time')) win_file_.filename_modified_time = DateTime.from_dict(win_file_dict.get('filename_modified_time')) win_file_.drive = String.from_dict(win_file_dict.get('drive')) win_file_.security_id = String.from_dict(win_file_dict.get('security_id')) win_file_.security_type = String.from_dict(win_file_dict.get('security_type')) win_file_.stream_list = StreamList.from_list(win_file_dict.get('stream_list')) return win_file_
def from_dict(file_dict, file_class=None): if not file_dict: return None if not file_class: file_ = File() else: file_ = file_class ObjectProperties.from_dict(file_dict, file_) file_.is_packed = file_dict.get('is_packed') file_.file_name = String.from_dict(file_dict.get('file_name')) file_.file_path = FilePath.from_dict(file_dict.get('file_path')) file_.device_path = String.from_dict(file_dict.get('device_path')) file_.full_path = String.from_dict(file_dict.get('full_path')) file_.file_extension = String.from_dict(file_dict.get('file_extension')) file_.size_in_bytes = UnsignedLong.from_dict(file_dict.get('size_in_bytes')) file_.magic_number = HexBinary.from_dict(file_dict.get('magic_number')) file_.file_format = String.from_dict(file_dict.get('file_format')) file_.hashes = HashList.from_list(file_dict.get('hashes')) file_.extracted_features = ExtractedFeatures.from_dict(file_dict.get('extracted_features')) file_.modified_time = String.from_dict(file_dict.get('modified_time')) file_.accessed_time = String.from_dict(file_dict.get('accessed_time')) file_.created_time = DateTime.from_dict(file_dict.get('created_time')) return file_
def from_dict(whois_dict): if not whois_dict: return None whois = WhoisEntry() ObjectProperties.from_dict(whois_dict, whois) whois.domain_name = URI.from_dict(whois_dict.get('domain_name')) whois.domain_id = String.from_dict(whois_dict.get('domain_id')) whois.server_name = URI.from_dict(whois_dict.get('server_name')) whois.ip_address = Address.from_dict(whois_dict.get('ip_address'), Address.CAT_IPV4) whois.dnssec = whois_dict.get('dnssec') whois.nameservers = WhoisNameservers.from_list(whois_dict.get('nameservers')) whois.status = WhoisStatuses.from_list(whois_dict.get('status')) whois.updated_date = DateTime.from_dict(whois_dict.get('updated_date')) whois.creation_date = DateTime.from_dict(whois_dict.get('creation_date')) whois.expiration_date = DateTime.from_dict(whois_dict.get('expiration_date')) whois.regional_internet_registry = String.from_dict(whois_dict.get('regional_internet_registry')) whois.sponsoring_registrar = String.from_dict(whois_dict.get('sponsoring_registrar')) whois.registrar_info = WhoisRegistrar.from_dict(whois_dict.get('registrar_info')) whois.registrants = WhoisRegistrants.from_list(whois_dict.get('registrants')) whois.contact_info = WhoisContact.from_dict(whois_dict.get('contact_info')) return whois
def from_dict(header_dict): header = EmailHeader() header.to = EmailRecipients.from_dict(header_dict.get('to')) header.cc = EmailRecipients.from_dict(header_dict.get('cc')) header.bcc = EmailRecipients.from_dict(header_dict.get('bcc')) header.from_ = Address.from_dict(header_dict.get('from'), Address.CAT_EMAIL) header.subject = String.from_dict(header_dict.get('subject')) header.in_reply_to = String.from_dict(header_dict.get('in_reply_to')) header.date = DateTime.from_dict(header_dict.get('date')) header.message_id = String.from_dict(header_dict.get('message_id')) header.sender = Address.from_dict(header_dict.get('sender'), Address.CAT_EMAIL) header.reply_to = Address.from_dict(header_dict.get('reply_to'), Address.CAT_EMAIL) header.errors_to = String.from_dict(header_dict.get('errors_to')) return header
def from_dict(network_connection_dict): if not network_connection_dict: return None network_connection_ = NetworkConnection() network_connection_.tls_used = network_connection_dict.get('tls_used') network_connection_.creation_time = DateTime.from_dict(network_connection_dict.get('creation_time')) network_connection_.layer3_protocol = String.from_dict(network_connection_dict.get('layer3_protocol')) network_connection_.layer4_protocol = String.from_dict(network_connection_dict.get('layer4_protocol')) network_connection_.layer7_protocol = String.from_dict(network_connection_dict.get('layer7_protocol')) network_connection_.source_socket_address = SocketAddress.from_dict(network_connection_dict.get('source_socket_address')) network_connection_.source_tcp_state = network_connection_dict.get('source_tcp_state') network_connection_.destination_socket_address = SocketAddress.from_dict(network_connection_dict.get('destination_socket_address')) network_connection_.destination_tcp_state = network_connection_dict.get('destination_tcp_state') network_connection_.layer7_connections = Layer7Connections.from_dict(network_connection_dict.get('layer7_connections')) return network_connection_
def from_dict(registry_key_dict): if not registry_key_dict: return None win_registry_key_ = WinRegistryKey() win_registry_key_.key = String.from_dict(registry_key_dict.get('key')) win_registry_key_.hive = String.from_dict(registry_key_dict.get('hive')) win_registry_key_.number_values = UnsignedInteger.from_dict(registry_key_dict.get('number_values')) win_registry_key_.modified_time = DateTime.from_dict(registry_key_dict.get('modified_time')) win_registry_key_.creator_username = String.from_dict(registry_key_dict.get('creator_username')) win_registry_key_.handle_list = WinHandleList.from_list(registry_key_dict.get('handle_list')) win_registry_key_.number_subkeys = UnsignedInteger.from_dict(registry_key_dict.get('number_subkeys')) #win_registry_key_.byte_runs = ByteRuns.from_dict(registry_key_dict.get('byte_runs')) if registry_key_dict.get('values') is not None: for registry_value_dict in registry_key_dict.get('values'): win_registry_key_.values.append(RegistryValue.from_dict(registry_value_dict)) if registry_key_dict.get('subkeys') is not None: for registry_subkey_dict in registry_key_dict.get('subkeys'): win_registry_key_.subkeys.append(WinRegistryKey.from_dict(registry_subkey_dict)) return win_registry_key_