diff --git a/analyzers/ProofPoint/proofpoint_lookup.py b/analyzers/ProofPoint/proofpoint_lookup.py index 25264ba6a..04f476eae 100755 --- a/analyzers/ProofPoint/proofpoint_lookup.py +++ b/analyzers/ProofPoint/proofpoint_lookup.py @@ -63,7 +63,9 @@ def run(self): if self.data_type == 'file': filename = self.get_param('attachment.name', 'noname.ext') filepath = self.get_param('file', None, 'File is missing') - sha256 = hashlib.sha256(open(filepath, 'r').read()).hexdigest() + with open(filepath, "rb") as f: + digest = hashlib.file_digest(f, "sha256") + sha256 = digest.hexdigest() elif self.data_type == 'hash' and len(self.get_data()) == 64: sha256 = self.get_data() else: