Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure gowitness has a working chrome install #1076

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions bbot/modules/gowitness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_path, "--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 or 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()
Expand Down
Loading