diff --git a/bin/import.py b/bin/import.py index 2f34479..c15b87b 100644 --- a/bin/import.py +++ b/bin/import.py @@ -1,6 +1,7 @@ import argparse import sys import redis +import hashlib argParser = argparse.ArgumentParser(description='Malware classifier') argParser.add_argument('-f', action='append', help='Filename') @@ -24,6 +25,12 @@ if args.f is not None: for element in elements: try: r.sadd('e:'+fields[i], element) + # + ehash = hashlib.md5() + ehash.update(element.encode('utf-8')) + ehhex = ehash.hexdigest() + if element is not "": + r.sadd('v:'+ehhex, md5) except IndexError: print("Empty fields") i = i+1