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

Unable to take screenshots of a list of URLs #270

Open
atemporalzen opened this issue Jan 26, 2025 · 3 comments
Open

Unable to take screenshots of a list of URLs #270

atemporalzen opened this issue Jan 26, 2025 · 3 comments

Comments

@atemporalzen
Copy link

So this is the command i use to take screenshots from a file. But I am faced with this bug

gowitness scan file -f urls.txt --chrome-path /usr/bin/google-chrome --write-db -p 443 --no-http -D --log-scan-errors

Here is the output

2025/01/26 14:28:18 DEBU <cmd/root.go:28> debug logging enabled
2025/01/26 14:28:18 DEBU <cmd/scan.go:72> scanning driver started driver=chromedp
2025/01/26 14:28:18 DEBU <runner/runner.go:47> final screenshot path screenshot-path=/root/screenshots
2025/01/26 14:28:20 DEBU <cmd/scan_file.go:57> starting file scanning file=urls.txt
2025/01/26 14:28:20 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example.com:443
2025/01/26 14:28:20 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example2.com443
2025/01/26 14:28:20 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example3.com:443
2025/01/26 14:28:20 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example4.com:443
2025/01/26 14:28:37 ERRO <runner/runner.go:153> failed to witness target target=https://example.com:443 err="error enabling network tracking: could not dial \"ws://127.0.0.1:45723/devtools/browser/f94035f7-da69-405c-8715-eee38598d2f1\": context deadline exceeded"
2025/01/26 14:28:37 ERRO <runner/runner.go:153> failed to witness target target=https://example2.com:443 err="error enabling network tracking: could not dial \"ws://127.0.0.1:43141/devtools/browser/1ae8dd08-756e-49b9-ac2d-5b7bfa8ce19a\": context deadline exceeded"
2025/01/26 14:28:37 ERRO <runner/runner.go:153> failed to witness target target=https://example3.com:443 err="error enabling network tracking: could not dial \"ws://127.0.0.1:34739/devtools/browser/8ae6aee4-cb44-4cc8-b761-a2d79b74ca3d\": context deadline exceeded"
2025/01/26 14:28:37 ERRO <runner/runner.go:153> failed to witness target target=https://example4.com:443 err="error enabling network tracking: could not dial \"ws://127.0.0.1:45673/devtools/browser/edc1a464-571c-4409-9206-150fc2ae433b\": context deadline exceeded"

The single screenshot works fine

gowitness scan single --url https://example.com -D
2025/01/26 14:35:14 DEBU <cmd/root.go:28> debug logging enabled
2025/01/26 14:35:14 DEBU <cmd/scan.go:72> scanning driver started driver=chromedp
2025/01/26 14:35:14 WARN <cmd/scan.go:117> no writers have been configured. to persist probe results, add writers using --write-* flags
2025/01/26 14:35:14 DEBU <runner/runner.go:47> final screenshot path screenshot-path=/root/screenshots
2025/01/26 14:35:15 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example.com
2025/01/26 14:35:29 INFO <runner/runner.go:171> result 🤖 target=https://example.com status-code=200 title="Example Domain" have-screenshot=true
2025/01/26 14:35:29 DEBU <drivers/chromedp.go:475> closing browser allocation context
@EspressoCake
Copy link

EspressoCake commented Jan 28, 2025

This currently works on my setup, can you confirm the version you're experiencing this with?

gowitness version

gowitness: 3.0.5
git hash: dev
build env: dev
build time: dev

@atemporalzen
Copy link
Author

It is running the same version. This problem only arises in a fresh droplet of digital ocean(Ubuntu 24.04)
Google chrome version is 132.

Here is a new error

gowitness scan file -f urls.txt --chrome-path /usr/bin/google-chrome --write-db -p 443 --no-http -D --log-scan-errors

2025/01/29 14:43:58 DEBU <cmd/root.go:28> debug logging enabled
2025/01/29 14:43:58 DEBU <cmd/scan.go:72> scanning driver started driver=chromedp
2025/01/29 14:43:58 DEBU <runner/runner.go:47> final screenshot path screenshot-path=/root/screenshots
2025/01/29 14:43:59 DEBU <cmd/scan_file.go:57> starting file scanning file=urls.txt
2025/01/29 14:43:59 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example.com:443
2025/01/29 14:43:59 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example2.com:443
2025/01/29 14:43:59 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example3.com:443
2025/01/29 14:43:59 DEBU <drivers/chromedp.go:124> witnessing 👀 target=https://example4.com:443
2025/01/29 14:44:21 ERRO <runner/runner.go:153> failed to witness target target=https://example.com:443 err="could not navigate to target: page load error net::ERR_NAME_NOT_RESOLVED"
2025/01/29 14:44:21 ERRO <runner/runner.go:153> failed to witness target target=https://example2.com443 err="could not navigate to target: page load error net::ERR_SOCKET_NOT_CONNECTED"
2025/01/29 14:44:21 ERRO <runner/runner.go:153> failed to witness target target=https://example3.com:443 err="could not navigate to target: page load error net::ERR_SOCKET_NOT_CONNECTED"

@leonjza
Copy link
Member

leonjza commented Feb 3, 2025

From the output you sent it looks like the driver can't talk to the spawned Chrome instance using the devtools proto. I noticed in the failing command you are specifying a Chrome path, but not in the one that works. Can you try without specifying the path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants