dstotijn / hetty

An HTTP toolkit for security research.
https://hetty.xyz
MIT License
6.07k stars 346 forks source link

Chrome executable not found even when $CHROME_EXECUTABLE defined and google-chrome is in path #117

Open binbard opened 1 year ago

binbard commented 1 year ago

Describe the bug

2023/01/18 13:45:07 INFO [main] Hetty (v0.7.0) is running on :8080 ... 2023/01/18 13:45:07 INFO [main] Get started at http://localhost:8080 2023/01/18 13:45:07 INFO [main] Chrome executable not found.

To Reproduce

Steps to reproduce the behavior:

  1. Using WSL Ubuntu 22
  2. Installed hetty with snap
  3. Installed chrome by downloading official .deb package from google, then
  4. sudo apt install ./google-chrome-stable_current_amd64.deb
  5. CHROME_EXECUTABLE=/usr/bin/google-chrome was defined after installing
  6. /usr/bin/google-chrome was added to path after installing

Error: INFO [main] Chrome executable not found

Expected behavior Chrome executable should be launched with hetty

Screenshots WindowsTerminal_ondR2YY2d1

Desktop (please complete the following information):

Additional context Even before I tried adding CHROME_EXECUTABLE and adding /usr/bin/google-chrome to path manually, no success

dstotijn commented 1 year ago

At the moment, Hetty relies on the default executable finding logic in the chromedp package (ref).

When using WSL, I suspect that when this code is executed, it's only looking for known executable paths for windows, and /usr/bin/google-chrome is not checked/used.

As a workaround, a possible fix might be to create a symlink chrome somewhere in a directory that's in your $PATH, and point it to /usr/bin/google-chrome.

In a future version of Hetty I might support explicitly setting the chrome executable path, but for now please look into the workaround mentioned above.

richoffpints commented 7 months ago

im getting the same thing on kali linuc, what should i do?

dstotijn commented 7 months ago

im getting the same thing on kali linuc, what should i do?

I suggest creating a symlink from /usr/local/bin/chrome to the executable path of your Chrome installation (the path differs per distro/system, so you best find out yourself).