From c51be159b65665180644a20eb663ce67f3df09b3 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 11 Jan 2022 13:08:32 -0500 Subject: [PATCH] Agent: Use classmethods to improve readability of HTTPHandler --- monkey/infection_monkey/exploit/log4shell.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/monkey/infection_monkey/exploit/log4shell.py b/monkey/infection_monkey/exploit/log4shell.py index 4ad252204..954555de3 100644 --- a/monkey/infection_monkey/exploit/log4shell.py +++ b/monkey/infection_monkey/exploit/log4shell.py @@ -168,13 +168,17 @@ class Log4ShellExploiter(WebRCE): class_downloaded = False stop = False - @staticmethod - def reset(): - Log4ShellExploiter.HTTPHandler.class_downloaded = False - Log4ShellExploiter.HTTPHandler.stop = False + @classmethod + def reset(cls): + cls.class_downloaded = False + cls.stop = False + + @classmethod + def set_class_downloaded(cls): + cls.class_downloaded = True def do_GET(self): - Log4ShellExploiter.HTTPHandler.class_downloaded = True + Log4ShellExploiter.HTTPHandler.set_class_downloaded() logger.info("Java class servergot a GET request!") self.send_response(200) self.send_header("Content-type", "application/octet-stream")