Created
April 13, 2017 23:54
-
-
Save casprwang/1cf5e2dcd63515d60952e5d34ff4de4d to your computer and use it in GitHub Desktop.
hash.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Please put the Hash fils and Malware folder in the same directory, and run with python3 filename | |
# by Singh Prabhjot && Song Wang | |
import hashlib | |
import os | |
import fileinput | |
hash_list = [] | |
for line in fileinput.input(['Hash']): | |
if line != '\n': | |
hash_list.append(line[:-1]) | |
# print ( hash_list ) | |
BLOCKSIZE = 65536 | |
hasher = hashlib.md5() | |
with open('./Malware/Android.Malware.at_plapk.a/com.fdhgkjhrtjkjbx.model.apk', 'rb') as afile: | |
buf = afile.read(BLOCKSIZE) | |
while len(buf) > 0: | |
hasher.update(buf) | |
buf = afile.read(BLOCKSIZE) | |
mid = hasher.hexdigest() | |
if mid in hash_list: | |
print ("yes, it's in the hashF") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment