From 0ec10c74c0f4272469c8b2239d5d4b049ff78bb6 Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Wed, 7 Feb 2024 17:11:41 -0500 Subject: [PATCH 1/3] make sure gowitness has a working chrome install --- bbot/modules/gowitness.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bbot/modules/gowitness.py b/bbot/modules/gowitness.py index a335bf0215..614a9051d7 100644 --- a/bbot/modules/gowitness.py +++ b/bbot/modules/gowitness.py @@ -94,6 +94,20 @@ async def setup(self): custom_chrome_path = self.helpers.tools_dir / "chrome-linux" / "chrome" if custom_chrome_path.is_file(): self.chrome_path = custom_chrome_path + + # make sure we have a working chrome install + chrome_test_pass = False + for binary in ("chrome", "chromium", custom_chrome_path): + binary_path = self.helpers.which(binary) + if binary_path and Path(binary_path).is_file(): + chrome_test_proc = await self.helpers.run([binary, "--version"]) + if getattr(chrome_test_proc, "returncode", 1) == 0: + self.verbose(f"Found chrome executable at {binary_path}") + chrome_test_pass = True + break + if not chrome_test_pass: + return False, "Failed to set up Google chrome. Please install manually use try again with --force-deps." + self.db_path = self.base_path / "gowitness.sqlite3" self.screenshot_path = self.base_path / "screenshots" self.command = self.construct_command() From d9efdc60370a581895a1beefc4de55a4a4e02692 Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Wed, 7 Feb 2024 17:16:26 -0500 Subject: [PATCH 2/3] fix typo --- bbot/modules/gowitness.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbot/modules/gowitness.py b/bbot/modules/gowitness.py index 614a9051d7..4acaf30f4f 100644 --- a/bbot/modules/gowitness.py +++ b/bbot/modules/gowitness.py @@ -106,7 +106,7 @@ async def setup(self): chrome_test_pass = True break if not chrome_test_pass: - return False, "Failed to set up Google chrome. Please install manually use try again with --force-deps." + return False, "Failed to set up Google chrome. Please install manually or try again with --force-deps." self.db_path = self.base_path / "gowitness.sqlite3" self.screenshot_path = self.base_path / "screenshots" From d37c0a3e2b8fc364b265d92d17ca7b90169527f8 Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Wed, 7 Feb 2024 17:19:35 -0500 Subject: [PATCH 3/3] use full binary path --- bbot/modules/gowitness.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbot/modules/gowitness.py b/bbot/modules/gowitness.py index 4acaf30f4f..0734858f17 100644 --- a/bbot/modules/gowitness.py +++ b/bbot/modules/gowitness.py @@ -100,7 +100,7 @@ async def setup(self): for binary in ("chrome", "chromium", custom_chrome_path): binary_path = self.helpers.which(binary) if binary_path and Path(binary_path).is_file(): - chrome_test_proc = await self.helpers.run([binary, "--version"]) + chrome_test_proc = await self.helpers.run([binary_path, "--version"]) if getattr(chrome_test_proc, "returncode", 1) == 0: self.verbose(f"Found chrome executable at {binary_path}") chrome_test_pass = True