2 years ago

#26862

test-img

Pawel

What precaution to take when opening malware file using python script

I'm writing a Python script to check the file hash of a malware sample against the VirusTotal database.

At the moment, I'm using a build in open and read functions provided in a standard python library:

with open(file_path, 'rb') as file:
        file_sha1 = hashlib.sha1(file.read())

I am testing it in a VM to ensure my host system is not compromised. But I am wondering would Python script that reads the file in binary form execute the file or is it just reading the binary content and there is no chance of executing the file, thus not compromising my machine.

When dealing with malware it is better to be safe than sorry I was wondering are there any precautions to take in my project.

malware

hash

python

0 Answers

Your Answer

Accepted video resources