mirror of https://github.com/MISP/MISP
fix: [stix import] Avoiding error with no hashes in pe objects
parent
fdb418de0b
commit
cfbb0ca8b2
|
@ -643,9 +643,10 @@ class StixParser():
|
|||
file_header = headers.file_header
|
||||
misp_object.add_attribute(**{"type": "counter", "object_relation": "number-sections",
|
||||
"value": file_header.number_of_sections.value})
|
||||
for h in file_header.hashes:
|
||||
hash_type, hash_value, hash_relation = self.handle_hashes_attribute(h)
|
||||
header_object.add_attribute(**{"type": hash_type, "value": hash_value, "object_relation": hash_relation})
|
||||
if file_header.hashes:
|
||||
for h in file_header.hashes:
|
||||
hash_type, hash_value, hash_relation = self.handle_hashes_attribute(h)
|
||||
header_object.add_attribute(**{"type": hash_type, "value": hash_value, "object_relation": hash_relation})
|
||||
if file_header.size_of_optional_header:
|
||||
header_object.add_attribute(**{"type": "size-in-bytes", "object_relation": "size-in-bytes",
|
||||
"value": file_header.size_of_optional_header.value})
|
||||
|
|
Loading…
Reference in New Issue