sensepost / gowitness

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

Stop on redirect #73

Closed jaikishantulswani closed 3 years ago

jaikishantulswani commented 3 years ago

@leonjza gowitness got stuck / stop while taking screenshot of a url have 10+ redirects and it stuck there, have to stop forcefully many times.

Error:

ERR preflight request failed error="GET \"http://example.com/": stopped after 10 redirects"
leonjza commented 3 years ago

Is this still a valid screenshot target then?

jaikishantulswani commented 3 years ago

@leonjza Target throw This page is not working too many redirects and gowitness stuck on that target with the above error.

leonjza commented 3 years ago

I still don't think I understand. As an example, I have the following web server.

package main

import (
    "log"
    "net/http"
)

func main() {

    http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {

        http.Redirect(w, r, "http://localhost:9090/", 301)
    })

    if err := http.ListenAndServe(":9090", nil); err != nil {
        log.Fatal("failed: ", err)
    }
}

gowitness will fail to take this screenshot given that it just redirects, and for now I think that is ok and expected.

$ gowitness single http://localhost:9090
30 Sep 2020 16:02:17 ERR preflight request failed error="Get \"http://localhost:9090/\": stopped after 10 redirects"