diff --git a/model/payload.py b/model/payload.py index ede6d73..9f11e9a 100644 --- a/model/payload.py +++ b/model/payload.py @@ -13,7 +13,7 @@ class Payload(): def init(self) -> bool: - logging.info("-[ Payload: {}".format(self.payload_path)) + logger.info("-[ Payload: {}".format(self.payload_path)) if not os.path.exists(self.payload_path): logger.error("Payload file does not exist: {}".format(self.payload_path)) return False @@ -21,6 +21,6 @@ class Payload(): with open(self.payload_path, 'rb') as f: self.payload_data = f.read() - logging.info(" Size: {} bytes".format(len(self.payload_data))) + logger.info(" Size: {} bytes".format(len(self.payload_data))) return True diff --git a/pe/superpe.py b/pe/superpe.py index 58ce9b2..99787c7 100644 --- a/pe/superpe.py +++ b/pe/superpe.py @@ -344,7 +344,7 @@ class SuperPe(): if string_off == None: raise Exception("Strings not found in .rdata section, abort") if string_off < 128: - logging.debug("weird: Strings in .rdata section at offset {} < 100".format(string_off)) + logger.debug("weird: Strings in .rdata section at offset {} < 100".format(string_off)) string_off = 128 rm.add_range(section.virt_addr, section.virt_addr + string_off) diff --git a/phases/assembler.py b/phases/assembler.py index a4d8cd3..a50beb3 100644 --- a/phases/assembler.py +++ b/phases/assembler.py @@ -23,7 +23,7 @@ def asm_to_shellcode(asm_in: FilePath, build_exe: FilePath) -> bytes: if not os.path.isfile(build_exe): raise Exception("Compiling failed") code = extract_code_from_exe_file(build_exe) - logging.info(" Carrier Size: {}".format( + logger.info(" Carrier Size: {}".format( len(code) )) return code diff --git a/phases/injector.py b/phases/injector.py index e6a1a51..09b5a4c 100644 --- a/phases/injector.py +++ b/phases/injector.py @@ -284,7 +284,7 @@ class Injector(): if payload_rva == None: raise Exception("DataReuseFixup: payload_rva is None") datareuse_fixup.addr = payload_rva + self.injectable.superpe.get_image_base() - logging.debug(" Add to .text at 0x{:X} ({}): {} with size {}".format( + logger.debug(" Add to .text at 0x{:X} ({}): {} with size {}".format( datareuse_fixup.addr, payload_rva, datareuse_fixup.string_ref, len(datareuse_fixup.data))) else: # .rdata @@ -301,7 +301,7 @@ class Injector(): self.superpe.pe.set_bytes_at_rva(data_rva, var_data) datareuse_fixup.addr = data_rva + self.injectable.superpe.get_image_base() ## - logging.debug(" Add to .rdata at 0x{:X} ({}): {}: {}".format( + logger.debug(" Add to .rdata at 0x{:X} ({}): {}: {}".format( datareuse_fixup.addr, data_rva, datareuse_fixup.string_ref, ui_string_decode(var_data))) # replace the placeholder in .text with a LEA instruction to the data we written above diff --git a/phases/templater.py b/phases/templater.py index bb4c455..98dc0a2 100644 --- a/phases/templater.py +++ b/phases/templater.py @@ -104,11 +104,11 @@ def create_c_from_template(settings: Settings, payload_len: int): max_alloc_count = 256 if sir_alloc_count > max_alloc_count: # if too large, compiler will add a __checkstk dependency - logging.warning("Too large sir allocation count {}, setting to max {}".format( + logger.warning("Too large sir allocation count {}, setting to max {}".format( sir_alloc_count, max_alloc_count )) sir_alloc_count = max_alloc_count - logging.debug("-( AntiEmulation settings: iterations: {} allocs: {}".format( + logger.debug("-( AntiEmulation settings: iterations: {} allocs: {}".format( sir_iteration_count, sir_alloc_count) ) plugin_antiemualation = file.read() diff --git a/sender.py b/sender.py index 506d4a7..32957a4 100644 --- a/sender.py +++ b/sender.py @@ -11,7 +11,7 @@ logger = logging.getLogger("Sender") def scannerDetectsBytes(data: bytes, filename: str, useBrotli=True, verify=False, no_exec=False): if config.get("avred_server") == "": - logging.error("No AVRed server configured, aborting") + logger.error("No AVRed server configured, aborting") return params = { 'filename': filename, 'brotli': useBrotli, 'verify': verify, 'no_exec' : no_exec} @@ -30,7 +30,7 @@ def scannerDetectsBytes(data: bytes, filename: str, useBrotli=True, verify=False # basically internal server error, e.g. AMSI not working if res.status_code != 200: - logging.error("Error Code {}: {}".format(res.status_code, res.text)) + logger.error("Error Code {}: {}".format(res.status_code, res.text)) raise Exception("Server error, aborting") return jsonRes diff --git a/supermega.py b/supermega.py index 0535899..df70d3f 100644 --- a/supermega.py +++ b/supermega.py @@ -204,10 +204,10 @@ def start_real(settings: Settings) -> bool: # CHECK if all are available in infectable, or abort (early check) functions = project.injectable.get_unresolved_iat() if len(functions) != 0 and settings.fix_missing_iat == False: - logging.error("IAT entries not found in infectable: {}".format(", ".join(functions))) - logging.error("The carrier depends on these functions, but they are not available in the infectable exe.") - logging.error("Use another infectable exe, or update the carrier to not depend on these functions.") - logging.error(" or dont use --no-fix-iat") + logger.error("IAT entries not found in infectable: {}".format(", ".join(functions))) + logger.error("The carrier depends on these functions, but they are not available in the infectable exe.") + logger.error("Use another infectable exe, or update the carrier to not depend on these functions.") + logger.error(" or dont use --no-fix-iat") return False # ASSEMBLE: Assemble .asm to .shc (ASM -> SHC)