From e7f37935890b9cd73532917199c3b6289924b00b Mon Sep 17 00:00:00 2001 From: Xiang Chen Date: Fri, 11 Oct 2024 08:23:15 +0000 Subject: [PATCH] Only upload_to_host once in browsermonitor --- analyzer/windows/modules/auxiliary/browsermonitor.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/analyzer/windows/modules/auxiliary/browsermonitor.py b/analyzer/windows/modules/auxiliary/browsermonitor.py index e46e8fbe52c..6989f190b20 100644 --- a/analyzer/windows/modules/auxiliary/browsermonitor.py +++ b/analyzer/windows/modules/auxiliary/browsermonitor.py @@ -27,8 +27,6 @@ def __init__(self, options=None, config=None): self.startupinfo = subprocess.STARTUPINFO() self.startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW self.browser_logfile = "" - self.last_modification = 0.0 - self._is_first_save = True def _find_browser_extension(self): temp_dir = tempfile.gettempdir() @@ -54,22 +52,12 @@ def _find_browser_extension(self): time.sleep(1) def _collect_browser_logs(self): - if not self._is_first_save and self.last_modification != os.path.getmtime(self.browser_logfile): - return - self.last_modification = os.path.getmtime(self.browser_logfile) upload_to_host(self.browser_logfile, "browser/requests.log") - self._is_first_save = False def run(self): self.do_run = True if self.enabled: self._find_browser_extension() - self.last_modification = os.path.getmtime(self.browser_logfile) - while self.do_run: - self._collect_browser_logs() - time.sleep(1) - return True - return False def stop(self): if self.enabled: