From 928192b9b0315db3b7cdfd918abc285ae569ff07 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 3 Mar 2022 13:48:00 -0500 Subject: [PATCH] Agent: Add helpful debug logging to log4shell exploiter --- monkey/infection_monkey/exploit/log4shell.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monkey/infection_monkey/exploit/log4shell.py b/monkey/infection_monkey/exploit/log4shell.py index bfc0b4b46..d6c6ec198 100644 --- a/monkey/infection_monkey/exploit/log4shell.py +++ b/monkey/infection_monkey/exploit/log4shell.py @@ -138,6 +138,10 @@ class Log4ShellExploiter(WebRCE): # because we don't know which services are running and on which ports for exploit in get_log4shell_service_exploiters(): for port in self._open_ports: + logger.debug( + f'Attempting Log4Shell exploit on for service "{exploit.service_name}"' + f"on port {port}" + ) try: url = exploit.trigger_exploit(self._build_ldap_payload(), self.host, port) except Exception as ex: @@ -175,6 +179,7 @@ class Log4ShellExploiter(WebRCE): time.sleep(1) + logger.debug("Timed out while waiting for victim to download the java bytecode") return False def _wait_for_victim_to_download_agent(self):