From bf998f502113edcebf2e63d55191cad74552e3b9 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 4 Mar 2022 17:03:37 -0500 Subject: [PATCH] Agent: Fix HTTPHandler class name in ExploitClassHTTPServer --- .../exploit/log4shell_utils/exploit_class_http_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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()`