diff --git a/Payload_Type/cazalla/cazalla/agent_functions/builder.py b/Payload_Type/cazalla/cazalla/agent_functions/builder.py index eb134ed..c5e86c5 100644 --- a/Payload_Type/cazalla/cazalla/agent_functions/builder.py +++ b/Payload_Type/cazalla/cazalla/agent_functions/builder.py @@ -7,6 +7,7 @@ from mythic_container.MythicRPC import * import json from distutils.dir_util import copy_tree,remove_tree import asyncio +import hashlib import string, random, os, subprocess @@ -358,11 +359,15 @@ class CazallaAgent(PayloadType): resp.build_message = f"Compilation failed: {compile_errors}" return resp + # Obtain the MD5 and SHA256 of the compiled payload + md5_hash = hashlib.md5(open(filename, "rb").read()).hexdigest() + sha256_hash = hashlib.sha256(open(filename, "rb").read()).hexdigest() + debug_info = f" (DEBUG: {debug_level}/{debug_output})" if debug_level != "none" else "" await SendMythicRPCPayloadUpdatebuildStep(MythicRPCPayloadUpdateBuildStepMessage( PayloadUUID=self.uuid, StepName="Compiling", - StepStdout=f"Successfully compiled cazalla{debug_info}\nCommand: {command}\nTarget: {make_target}\nFlags: {make_flags}\nOutput: {output_filename}", + StepStdout=f"Successfully compiled cazalla{debug_info}\nCommand: {command}\nTarget: {make_target}\nFlags: {make_flags}\nOutput: {output_filename}\nMD5: {md5_hash}\nSHA256: {sha256_hash}", StepSuccess=True ))