sensepost / gowitness

🔍 gowitness - a golang, web screenshot utility using Chrome Headless
GNU General Public License v3.0
3.16k stars 345 forks source link

Screenshot failed Chrome process reported an error taking screenshot #49

Closed Kaiziron closed 4 years ago

Kaiziron commented 4 years ago

ERRO[2020-05-12 16:43:39] Screenshot failed destination=https-www.google.com.png err="exit status 1" url="https://www.google.com/" ERRO[2020-05-12 16:43:39] Chrome process reported an error taking screenshot error="exit status 1" url="https://www.google.com/"

it is giving me an error every time I do a screenshot, I have chrome and chromium latest version installed, anyone knows whats wrong?

ghost commented 4 years ago

Hi guys,

I have the same error.

Cheers, X

leonjza commented 4 years ago

Do you have some version information? I just build fresh bins for macOS and it seems to work fine.

$ make darwin
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X=github.com/sensepost/gowitness/cmd.gitHash=dfa1bc1 -X=github.com/sensepost/gowitness/cmd.goVer=go1.14.5_darwin/amd64" -o 'build/gowitness-darwin-amd64'

$ build/gowitness-darwin-amd64 --disable-db single -u https://www.google.com/
INFO[2020-07-28 20:20:00] Title parsed                                  title=Google url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response code                                 status="200 OK" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Final URL after redirects                     final-url="https://www.google.com/" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               X-Frame-Options=SAMEORIGIN url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Date="Tue, 28 Jul 2020 18:20:00 GMT" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Strict-Transport-Security="max-age=31536000" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Alt-Svc="h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Expires=-1 url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Cache-Control="private, max-age=0" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               P3p="CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Server=gws url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Retry-Count=0 url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Content-Type="text/html; charset=UTF-8" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               X-Xss-Protection=0 url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Response header                               Set-Cookie="1P_JAR=2020-07-28-18; expires=Thu, 27-Aug-2020 18:20:00 GMT; path=/; domain=.google.com; Secure; SameSite=none, NID=204=uJkOOmvbJczDoJaG9EHPxdemIdYe9nlw4qVyMj6MIAYpAX1pxaJCIrgNpyi8L_ZkWKyBCjA2bCsE7lhSI7v08qtARlZWk1EKVjAVF3X6-Z0GoWL50cfqfQ2EvFlhhZHJZyalmIYev70j3mBURuSzRJJX-oA3wpj6u_xHJ6FhQyk; expires=Wed, 27-Jan-2021 18:20:00 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=none" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Certificate chain common name                 common_name=www.google.com url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Signature algorithm                           signature-alg=SHA256-RSA url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Public key algorithm                          pubkey-alg=ECDSA url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Issuer                                        issuer="GTS CA 1O1" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] DNS Name                                      dns-names=www.google.com url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Certificate chain common name                 common_name="GTS CA 1O1" url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Signature algorithm                           signature-alg=SHA256-RSA url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Public key algorithm                          pubkey-alg=RSA url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Issuer                                        issuer=GlobalSign url="https://www.google.com/"
INFO[2020-07-28 20:20:00] Cipher suite in use                           cipher-suite=4865 url="https://www.google.com/"
INFO[2020-07-28 20:20:00] [--headless --disable-gpu --hide-scrollbars --disable-crash-reporter --user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36 --window-size=1440,900 --screenshot=https-www.google.com.png --virtual-time-budget=2000]
INFO[2020-07-28 20:20:01] Taking screenshot                             destination=https-www.google.com.png url="https://www.google.com/"
INFO[2020-07-28 20:20:04] Screenshot taken                              destination=https-www.google.com.png duration=2.979458623s url="https://www.google.com/"
INFO[2020-07-28 20:20:04] Complete                                      run-time=4.205104245s
ghost commented 4 years ago

Hi @leonjza ,

I just run the docker image from ubuntu 18.04 server, and it times out.

$ docker run --rm -it -v $(pwd)/screenshots:/screenshots leonjza/gowitness:latest single --url=https://www.google.com

INFO[2020-07-29 07:43:28] Title parsed                                  title=Google url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response code                                 status="200 OK" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Final URL after redirects                     final-url="https://www.google.com" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Cache-Control="private, max-age=0" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Strict-Transport-Security="max-age=31536000" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               X-Frame-Options=SAMEORIGIN url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Alt-Svc="h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Expires=-1 url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Content-Type="text/html; charset=UTF-8" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Set-Cookie="1P_JAR=2020-07-29-07; expires=Fri, 28-Aug-2020 07:43:28 GMT; path=/; domain=.google.com; Secure; SameSite=none, NID=204=M6fdhpJLnKgozcn29NkqPaNDvV_BbPjTqzQxikYk0e-4oM-Z8zS2AFSz5EpbjAQIBxLzE0lXrT_9brm1uRHOvq7CnBVMNuttLYY4jLoXIDibPuDFDOYMey4Oaoh6_eMktSdbtPkFo04wauqOKCU2A4XJ4x_A4AQdlfwxsYKCHrI; expires=Thu, 28-Jan-2021 07:43:28 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=none" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Date="Wed, 29 Jul 2020 07:43:28 GMT" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Server=gws url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               X-Xss-Protection=0 url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               Retry-Count=0 url="https://www.google.com"
INFO[2020-07-29 07:43:28] Response header                               P3p="CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Certificate chain common name                 common_name=www.google.com url="https://www.google.com"
INFO[2020-07-29 07:43:28] Signature algorithm                           signature-alg=SHA256-RSA url="https://www.google.com"
INFO[2020-07-29 07:43:28] Public key algorithm                          pubkey-alg=ECDSA url="https://www.google.com"
INFO[2020-07-29 07:43:28] Issuer                                        issuer="GTS CA 1O1" url="https://www.google.com"
INFO[2020-07-29 07:43:28] DNS Name                                      dns-names=www.google.com url="https://www.google.com"
INFO[2020-07-29 07:43:28] Certificate chain common name                 common_name="GTS CA 1O1" url="https://www.google.com"
INFO[2020-07-29 07:43:28] Signature algorithm                           signature-alg=SHA256-RSA url="https://www.google.com"
INFO[2020-07-29 07:43:28] Public key algorithm                          pubkey-alg=RSA url="https://www.google.com"
INFO[2020-07-29 07:43:28] Issuer                                        issuer=GlobalSign url="https://www.google.com"
INFO[2020-07-29 07:43:28] Cipher suite in use                           cipher-suite=4865 url="https://www.google.com"
INFO[2020-07-29 07:43:28] [--headless --disable-gpu --hide-scrollbars --disable-crash-reporter --user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36 --window-size=1440,900 --screenshot=https-www.google.com.png --virtual-time-budget=2000 -no-sandbox]
INFO[2020-07-29 07:43:29] Taking screenshot                             destination=https-www.google.com.png url="https://www.google.com/"
ERRO[2020-07-29 07:44:59] Timeout reached while waiting for screenshot to finish  destination=https-www.google.com.png err="signal: killed" url="https://www.google.com/"
ERRO[2020-07-29 07:44:59] Chrome process reported an error taking screenshot  error="signal: killed" url="https://www.google.com"
INFO[2020-07-29 07:44:59] Complete                                      run-time=1m30.841757923s
leonjza commented 4 years ago

Ah right. Yeah I get the sense that the image we using for Chrome here may need some extra tweaking or something. There may be some flags/limits in the container that makes Chrome nope out faster (or even crash!).

Some help debugging it would be awesome.

ghost commented 4 years ago

How do you enable the debug mode ?

leonjza commented 4 years ago

You can get a shell in the container with: docker run --rm -it --entrypoint sh leonjza/gowitness, and exec gowitness (with debug logs enabled, there aren't that many though) with: /gowitness --log-level debug single -u https://www.google.com/

ghost commented 4 years ago

Hi,

I have the following by running your suggested commands:

$ docker run --rm -it --entrypoint sh leonjza/gowitness
/screenshots $ /gowitness --log-level debug single -u https://www.google.com/
DEBU[2020-07-29 08:38:53] Chrome path not set or invalid. Performing search  error="stat : no such file or directory" user-path=
DEBU[2020-07-29 08:38:53] Google Chrome path                            chrome-path=/usr/bin/chromium-browser
DEBU[2020-07-29 08:38:53] Chrome version                                chrome-path=/usr/bin/chromium-browser chromeversion=83.0.4103.97
DEBU[2020-07-29 08:38:53] Screenshot path                               screenshot-path=.
DEBU[2020-07-29 08:38:53] Opening buntdb                                database-location=gowitness.db
DEBU[2020-07-29 08:38:53] Processing URL                                url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Title parsed                                  title=Google url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response code                                 status="200 OK" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Final URL after redirects                     final-url="https://www.google.com/" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Cache-Control="private, max-age=0" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Server=gws url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Set-Cookie="1P_JAR=2020-07-29-08; expires=Fri, 28-Aug-2020 08:38:53 GMT; path=/; domain=.google.com; Secure; SameSite=none, NID=204=h8ZKoMccRYQp1TrB9kmdiNGLw1QkMKs2t6lqSz5eROZYFMIyu-A3tuOHvcGrTyTlwz60IqrK1-dHwmhYxx43cmK-uyLtKOOj19Ns1LOpkcCY6NU1dGhzB0JzX0L8VqZbQuAXYVG1LnS2SK6m38e0xbcFKpDRPI7mfvL87Sn_p2g; expires=Thu, 28-Jan-2021 08:38:53 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=none" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               P3p="CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               X-Frame-Options=SAMEORIGIN url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Content-Type="text/html; charset=UTF-8" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Strict-Transport-Security="max-age=31536000" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               X-Xss-Protection=0 url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Alt-Svc="h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Date="Wed, 29 Jul 2020 08:38:53 GMT" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Expires=-1 url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Response header                               Retry-Count=0 url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Certificate chain common name                 common_name=www.google.com url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Signature algorithm                           signature-alg=SHA256-RSA url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Public key algorithm                          pubkey-alg=ECDSA url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Issuer                                        issuer="GTS CA 1O1" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] DNS Name                                      dns-names=www.google.com url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Certificate chain common name                 common_name="GTS CA 1O1" url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Signature algorithm                           signature-alg=SHA256-RSA url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Public key algorithm                          pubkey-alg=RSA url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Issuer                                        issuer=GlobalSign url="https://www.google.com/"
INFO[2020-07-29 08:38:53] Cipher suite in use                           cipher-suite=4865 url="https://www.google.com/"
DEBU[2020-07-29 08:38:53] Generated filename for screenshot             destination=https-www.google.com.png file-name=https-www.google.com.png url="https://www.google.com/"
DEBU[2020-07-29 08:38:53] Full path to screenshot save using Chrome     full-destination=https-www.google.com.png url="https://www.google.com/"
INFO[2020-07-29 08:38:53] [--headless --disable-gpu --hide-scrollbars --disable-crash-reporter --user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36 --window-size=1440,900 --screenshot=https-www.google.com.png --virtual-time-budget=2000]
DEBU[2020-07-29 08:38:54] Initializing shitty forwarding proxy          target-url="https://www.google.com/"
DEBU[2020-07-29 08:38:54] forwarding proxy listening port               listen-port=44049 target-url="https://www.google.com/"
DEBU[2020-07-29 08:38:54] Google Chrome arguments                       arguments="[--headless --disable-gpu --hide-scrollbars --disable-crash-reporter --user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36 --window-size=1440,900 --screenshot=https-www.google.com.png --virtual-time-budget=2000 --allow-insecure-localhost http://localhost:44049/]"
INFO[2020-07-29 08:38:54] Taking screenshot                             destination=https-www.google.com.png url="https://www.google.com/"
DEBU[2020-07-29 08:38:54] Starting shitty forwarding proxy goroutine    listen-address="127.0.0.1:44049" target-url="https://www.google.com/"
ERRO[2020-07-29 08:38:54] Screenshot failed                             destination=https-www.google.com.png err="exit status 1" url="https://www.google.com/"
DEBU[2020-07-29 08:38:54] Stopping shitty forwarding proxy              port=44049 target-url="https://www.google.com/"
ERRO[2020-07-29 08:38:54] Chrome process reported an error taking screenshot  error="exit status 1" url="https://www.google.com/"
INFO[2020-07-29 08:38:54] Complete                                      run-time=842.04733ms
/screenshots $
leonjza commented 4 years ago

So from the outside you have:

ERRO[2020-07-29 07:44:59] Timeout reached while waiting for screenshot to finish  destination=https-www.google.com.png err="signal: killed" url="https://www.google.com/"

And running via a shell in the container you have:

ERRO[2020-07-29 08:38:54] Chrome process reported an error taking screenshot  error="exit status 1" url="https://www.google.com/"

I don't know why this happens, but it warrants investigation. Maybe a good start is to run the Chrome command line raw, eliminating the gowitness complexity in the container first.

ghost commented 4 years ago

Do you think that you can fix it ?

Btw. I mane a PR for gowitness as a webservice. It can be really useful

cadeef commented 4 years ago

I hit a similar issue. Took a few minutes to debug, unsure whether the situation here is similar. It seems, though I haven't done any code debugging, that the the error isn't propagating up the stack to gowitness:

/screenshots $ chromium-browser --headless --disable-gpu --hide-scrollbars --disable-crash-reporter --user-agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36' --window-size=1440,900 --screenshot=http-cade.pro.png --virtual-time-budget=2000 --no-sandbox http://cade.pro [0803/044958.646780:WARNING:dns_config_service_posix.cc(341)] Failed to read DnsConfig. [0803/044958.857815:WARNING:dns_config_service_posix.cc(341)] Failed to read DnsConfig. [0803/044959.125024:ERROR:headless_shell.cc(595)] Writing to file http-cade.pro.png was unsuccessful, could not open file: FILE_ERROR_ACCESS_DENIED

In my particular case, it was caused by improper ownership of the bind mount-- the host was running the container as a user who didn't have write access to the pre-created screenshots directory. Running the container with a -u switch solved my problem:

docker run --rm -it -v $(pwd)/screenshots:/screenshots -u $(id -u) leonjza/gowitness:latest single --url=https://www.google.com

Simple check to verify whether the same issue is encountered in OP's container: docker run --rm -it -v $(pwd)/screenshots:/screenshots --entrypoint touch leonjza/gowitness:latest '/screenshots/me'

It will return touch: /screenshots/me: Permission denied if unable to write.

I'd be happy to submit a pull request, if welcome, that:

leonjza commented 4 years ago

Ah great, thanks for taking a look @cadeef. The symptoms make sense, and the suggested changes would definitely be welcome.

Sy3Omda commented 4 years ago

i have the same issue

gowitness --log-level debug single -u https://www.google.com/ --chrome-path /snap/bin/chromium
DEBU[2020-08-18 10:57:22] Chrome path exists, skipping search and version check
DEBU[2020-08-18 10:57:22] Screenshot path                               screenshot-path=.
DEBU[2020-08-18 10:57:22] Opening buntdb                                database-location=gowitness.db
DEBU[2020-08-18 10:57:22] Processing URL                                url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Title parsed                                  title=Google url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response code                                 status="200 OK" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Final URL after redirects                     final-url="https://www.google.com/" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Expires=-1 url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Set-Cookie="1P_JAR=2020-08-18-10; expires=Thu, 17-Sep-2020 10:57:22 GMT; path=/; domain=.google.com; Secure; SameSite=none, NID=204=IOtoI-zqUsXLUJXadTgGl5Ap_JNuJ7R0yFTNqs4oCi4Wq8hptR3J-xAaymohip-rLfslW5s29Wa4_bdOmtHjPEhO27TguzGQt0ECxRyLpUS2oZcov-kVJMgKJIyzGZk_wHJPeLcmzXPThjwyAlHY3KyVbVxjcMV3HR1ZmzNo5RI; expires=Wed, 17-Feb-2021 10:57:22 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=none, CONSENT=WP.28a201; expires=Fri, 01-Jan-2038 00:00:00 GMT; path=/; domain=.google.com" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Retry-Count=0 url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Cache-Control="private, max-age=0" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Content-Type="text/html; charset=UTF-8" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               P3p="CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               X-Xss-Protection=0 url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Alt-Svc="h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Strict-Transport-Security="max-age=31536000" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Server=gws url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               Date="Tue, 18 Aug 2020 10:57:22 GMT" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Response header                               X-Frame-Options=SAMEORIGIN url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Certificate chain common name                 common_name=www.google.com url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Signature algorithm                           signature-alg=SHA256-RSA url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Public key algorithm                          pubkey-alg=ECDSA url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Issuer                                        issuer="GTS CA 1O1" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] DNS Name                                      dns-names=www.google.com url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Certificate chain common name                 common_name="GTS CA 1O1" url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Signature algorithm                           signature-alg=SHA256-RSA url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Public key algorithm                          pubkey-alg=RSA url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Issuer                                        issuer=GlobalSign url="https://www.google.com/"
INFO[2020-08-18 10:57:22] Cipher suite in use                           cipher-suite=4865 url="https://www.google.com/"
DEBU[2020-08-18 10:57:22] Generated filename for screenshot             destination=https-www.google.com.png file-name=https-www.google.com.png url="https://www.google.com/"
DEBU[2020-08-18 10:57:22] Full path to screenshot save using Chrome     full-destination=https-www.google.com.png url="https://www.google.com/"
INFO[2020-08-18 10:57:22] [--headless --disable-gpu --hide-scrollbars --disable-crash-reporter --user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36 --window-size=1440,900 --screenshot=https-www.google.com.png --virtual-time-budget=2000]
DEBU[2020-08-18 10:57:22] Running as root, adding --no-sandbox          euid=0
DEBU[2020-08-18 10:57:22] Initializing shitty forwarding proxy          target-url="https://www.google.com/"
DEBU[2020-08-18 10:57:22] forwarding proxy listening port               listen-port=45653 target-url="https://www.google.com/"
DEBU[2020-08-18 10:57:22] Google Chrome arguments                       arguments="[--headless --disable-gpu --hide-scrollbars --disable-crash-reporter --user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36 --window-size=1440,900 --screenshot=https-www.google.com.png --virtual-time-budget=2000 --no-sandbox --allow-insecure-localhost http://localhost:45653/]" binary=/snap/bin/chromium
INFO[2020-08-18 10:57:22] Taking screenshot                             destination=https-www.google.com.png url="https://www.google.com/"
DEBU[2020-08-18 10:57:22] Starting shitty forwarding proxy goroutine    listen-address="127.0.0.1:45653" target-url="https://www.google.com/"
ERRO[2020-08-18 10:57:23] Screenshot failed                             destination=https-www.google.com.png err="exit status 1" url="https://www.google.com/"
DEBU[2020-08-18 10:57:23] Stopping shitty forwarding proxy              port=45653 target-url="https://www.google.com/"
ERRO[2020-08-18 10:57:23] Chrome process reported an error taking screenshot  error="exit status 1" url="https://www.google.com/"
INFO[2020-08-18 10:57:23] Complete                                      run-time=981.153531ms
leonjza commented 4 years ago

@Sy3Omda try running /snap/bin/chromium --headless --disable-gpu --hide-scrollbars --disable-crash-reporter --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36" --window-size=1440,900 --screenshot=https-www.google.com.png --virtual-time-budget=2000 and check the output?

Sy3Omda commented 4 years ago
[0818/132318.840288:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Sy3Omda commented 4 years ago

@leonjza i`m running vps on digital ocean with ubuntu 20.04

leonjza commented 4 years ago

--no-sandbox

add the flag and try again.

Sy3Omda commented 4 years ago

it works but the image is just white

leonjza commented 4 years ago

I won't be able to provide any Chrome help, but could you try a non-snap install of chromium?

Sy3Omda commented 4 years ago

@leonjza btw i`m running Chromium 84.0.4147.105 snap

Sy3Omda commented 4 years ago

if you have another alternative like phantomjs , would be great

tkal commented 4 years ago

You can try apt install -y chromium-browser and then something like gowitness file -s subs.txt --chrome-path $(which chromium-browser).

It worked for me 🙃

cadeef commented 4 years ago

I haven’t gotten around to patching the issue I reported, unfortunately. If honest, I ended up writing a program that utilizes chromedp for my purposes.

The reports in this issue are solved by chromedp already. Rather than setting a time budget and hoping it’s sufficient, chromedp is able to detect when a page has completed rendering thanks to CDP.

When I looked at the code previously, it looked relatively trivial to replace the existing headless driver with chromedp, but obviously looks trivial and is trivial are two different things on an existing code base.

ItsIgnacioPortal commented 4 years ago

What @tkal said works for me :D, except that as of 2020-09-09, on the kali repositories the chromium package is now just named chromium, instead of chromium-browser

A simple and dirty fix is to add alias gowitness='gowitness --chrome-path $(which chromium)' to your .bashrc file

leonjza commented 4 years ago

I've got some local work pending a commit which replaces the screenshot implementation with chromedp. It needs some testing but should help improve things overall.

leonjza commented 4 years ago

Could you give v2 a try now and see how it goes?