From 67ade141a092416061ecac8964be7de63de19695 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 10 Jan 2022 08:40:51 -0500 Subject: [PATCH] Agent: Start log4shell java class server on daemon thread --- monkey/infection_monkey/exploit/log4shell.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/exploit/log4shell.py b/monkey/infection_monkey/exploit/log4shell.py index 3f5ffe886..51fb46de1 100644 --- a/monkey/infection_monkey/exploit/log4shell.py +++ b/monkey/infection_monkey/exploit/log4shell.py @@ -193,4 +193,8 @@ class Log4ShellExploiter(WebRCE): def get_java_class_server_thread(self, ip: str, java_class: bytes): Log4ShellExploiter.HTTPHandler.java_class = java_class - return Thread(target=self._run_class_http_server, args=[ip]) + # Setting `daemon=True` to save ourselves some trouble when this is merged to the + # agent-refactor branch. + # TODO: Make a call to `create_daemon_thread()` instead of calling the `Thread()` + # constructor directly after merging to the agent-refactor branch. + return Thread(target=self._run_class_http_server, args=[ip], daemon=True)