From 333695673713fb59b756c7fd6ab185f1534da5aa Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Mon, 7 Oct 2019 11:04:24 +0300 Subject: [PATCH] Added SHA-256 to monkey exec logs --- monkey/monkey_island/cc/resources/monkey_download.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/resources/monkey_download.py b/monkey/monkey_island/cc/resources/monkey_download.py index 3456997aa..917b205b8 100644 --- a/monkey/monkey_island/cc/resources/monkey_download.py +++ b/monkey/monkey_island/cc/resources/monkey_download.py @@ -107,9 +107,11 @@ class MonkeyDownload(flask_restful.Resource): filepath = MonkeyDownload.get_executable_full_path(filename) if os.path.isfile(filepath): with open(filepath, 'rb') as monkey_exec_file: - logger.debug("{} (SHA-512): {}".format( - filepath, - hashlib.sha512(monkey_exec_file.read()).hexdigest()) - ) + file_contents = monkey_exec_file.read() + logger.debug("{} hashes:\nSHA-512 {}\nSHA-256 {}".format( + filename, + hashlib.sha512(file_contents).hexdigest(), + hashlib.sha256(file_contents).hexdigest() + )) else: logger.debug("No monkey executable for {}.".format(filepath))