Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathcomparator_example.py
More file actions
Latest commit
19 lines (19 loc) · 1.01 KB
/
Copy pathcomparator_example.py
File metadata and controls
19 lines (19 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
importpprint
importmaec.bindings.maec_bundleasmaec_bundle_binding
frommaec.bundleimportBundle
# Matching properties dictionary
match_on_dictionary= {'FileObjectType': ['file_name'],
'WindowsRegistryKeyObjectType': ['hive', 'values.name/data'],
'WindowsMutexObjectType': ['name']}
# Parse in the input Bundle documents and create their python-maec Bundle class representations
bundle1=Bundle.from_obj(maec_bundle_binding.parse("zeus_threatexpert_maec.xml"))
bundle2=Bundle.from_obj(maec_bundle_binding.parse("zeus_anubis_maec.xml"))
# Perform the comparison and get the results
comparison_results=Bundle.compare([bundle1, bundle2], match_on=match_on_dictionary, case_sensitive=False)
# Pretty print the common and unique Objects
print"******Common Objects:*******\n"
pprint.pprint(comparison_results.get_common())
print"****************************"
print"******Unique Objects:*******\n"
pprint.pprint(comparison_results.get_unique())
print"****************************"