Agent: Wrap log4shell exploiters in a try/except

This commit is contained in:
Mike Salvatore 2022-01-13 08:57:55 -05:00
parent 6b934d6de5
commit a9d735593c
1 changed files with 7 additions and 1 deletions

View File

@ -159,7 +159,13 @@ class Log4ShellExploiter(WebRCE):
]
for exploit in get_log4shell_service_exploiters():
for port in open_ports:
exploit.trigger_exploit(self._build_ldap_payload(), self.host, port)
try:
exploit.trigger_exploit(self._build_ldap_payload(), self.host, port)
except Exception as ex:
logger.warning(
"An error occurred while attempting to exploit log4shell on a "
f"potential {exploit.service_name} service: {ex}"
)
# Wait for request
sleep(Log4ShellExploiter.REQUEST_TO_VICTIM_TIME)