sensepost / gowitness

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

Docker Image seems to be broken? (assets 404) #153

Closed 39ff closed 1 year ago

39ff commented 2 years ago
# docker run --rm -v $(pwd):/data -p7171:7171 leonjza/gowitness gowitness report serve --address :7171
10 Sep 2022 07:46:50 WRN this command is deprecated. use 'gowitness server' instead
10 Sep 2022 07:46:50 WRN exposing this server to other networks is dangerous! see the server command help for more information
10 Sep 2022 07:46:50 INF db path path=gowitness.sqlite3
10 Sep 2022 07:46:50 INF screenshot path path=screenshots
10 Sep 2022 07:46:50 INF server listening address=:7171

image1 image2

Invalid : http://10.0.0.69:7171/details/assets/css/tabler.min.css
Valid: http://10.0.0.69:7171/assets/css/tabler.min.css
leonjza commented 2 years ago

Ah, this might be as a result of the last few PR's by @random-robbie to try and fix some pathing issues with a reverse proxy. I'll revert in a bit.

leonjza commented 2 years ago

More specifically, these: https://github.com/sensepost/gowitness/compare/73fe2252ca26c1571a16a513051572b0a951764d...ca2f86df54ef6ab3f691c744f346585c477061d7

random-robbie commented 2 years ago

Sorry about that!

Certain parts work with the ./ on the main page but when its in /something/ it's messed up sorry!

I'll fork and test fully when I can to ensure it works both ways.

leonjza commented 2 years ago

I've reverted the PR's for now @39ff , give the Github Actions some time to rebuild the container. @random-robbie no worries! :) Would you mind elaborating a bit on what you are experiencing maybe that prompted those changes?

random-robbie commented 2 years ago

So while running nginx as the reverse proxy I was getting 404 for anything under assets as I have gowitness under a subfolder.

Myserver.com/gowitness/

But when loading the webserver I was getting 404 cause all the assets and links were going to myserver.com/assets instead of myserver.com/gowitness/assets

leonjza commented 1 year ago

Using a nginx configuration block such as the following with the new --base-path flag set to /gowitness should now have URL's correctly generated since https://github.com/sensepost/gowitness/commit/e904933ab1d877beca7f88b14b513144c5c23ca0.

server {
    listen       80;
    server_name  localhost;

...

    location /gowitness/ {
        proxy_pass          http://gowitness:7171/;
    }
}
leonjza commented 1 year ago

Wrote a slightly more verbose example here: https://github.com/sensepost/gowitness/wiki/Report-Server#on-reverse-proxies