diff --git a/monkey/infection_monkey/exploit/log4shell_utils/exploit_class_http_server.py b/monkey/infection_monkey/exploit/log4shell_utils/exploit_class_http_server.py index 5fc6521bd..3e0cdd38d 100644 --- a/monkey/infection_monkey/exploit/log4shell_utils/exploit_class_http_server.py +++ b/monkey/infection_monkey/exploit/log4shell_utils/exploit_class_http_server.py @@ -28,7 +28,7 @@ def do_GET(self): def get_new_http_handler_class(java_class: bytes, class_downloaded: threading.Event): return type( - "http_handler_class", + "HTTPHandler", (http.server.BaseHTTPRequestHandler,), { "java_class": java_class, @@ -60,9 +60,9 @@ class ExploitClassHTTPServer: self._class_downloaded = threading.Event() self._poll_interval = poll_interval - http_handler_class = get_new_http_handler_class(java_class, self._class_downloaded) + HTTPHandler = get_new_http_handler_class(java_class, self._class_downloaded) - self._server = http.server.HTTPServer((ip, port), http_handler_class) + self._server = http.server.HTTPServer((ip, port), HTTPHandler) # 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()`