Added hash of payload when built sucessfull
This commit is contained in:
@@ -7,6 +7,7 @@ from mythic_container.MythicRPC import *
|
|||||||
import json
|
import json
|
||||||
from distutils.dir_util import copy_tree,remove_tree
|
from distutils.dir_util import copy_tree,remove_tree
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import hashlib
|
||||||
|
|
||||||
import string, random, os, subprocess
|
import string, random, os, subprocess
|
||||||
|
|
||||||
@@ -358,11 +359,15 @@ class CazallaAgent(PayloadType):
|
|||||||
resp.build_message = f"Compilation failed: {compile_errors}"
|
resp.build_message = f"Compilation failed: {compile_errors}"
|
||||||
return resp
|
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 ""
|
debug_info = f" (DEBUG: {debug_level}/{debug_output})" if debug_level != "none" else ""
|
||||||
await SendMythicRPCPayloadUpdatebuildStep(MythicRPCPayloadUpdateBuildStepMessage(
|
await SendMythicRPCPayloadUpdatebuildStep(MythicRPCPayloadUpdateBuildStepMessage(
|
||||||
PayloadUUID=self.uuid,
|
PayloadUUID=self.uuid,
|
||||||
StepName="Compiling",
|
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
|
StepSuccess=True
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user