From 3aca8734ca7201b4cece2db91685f571bfdaa304 Mon Sep 17 00:00:00 2001 From: CyberRoute Date: Thu, 4 Jul 2024 17:11:25 +0200 Subject: [PATCH] no need of trailing slash that was a bug, head supposed to be http added location on redirect --- cmd/bruter/routes.go | 2 +- pkg/fuzzer/fuzzer.go | 2 +- pkg/fuzzer/normalize.go | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cmd/bruter/routes.go b/cmd/bruter/routes.go index 7b4284f..d603713 100644 --- a/cmd/bruter/routes.go +++ b/cmd/bruter/routes.go @@ -59,7 +59,7 @@ func routes(app *config.AppConfig) http.Handler { checkError(err) }, func() { - headers, err = sh.Head("https://" + app.Domain) + headers, err = sh.Head("http://" + app.Domain) checkError(err) }, func() { diff --git a/pkg/fuzzer/fuzzer.go b/pkg/fuzzer/fuzzer.go index 5386915..53b8769 100644 --- a/pkg/fuzzer/fuzzer.go +++ b/pkg/fuzzer/fuzzer.go @@ -84,7 +84,7 @@ func Dirsearch(Mu *sync.Mutex, app *config.AppConfig, domain, path string, progr app.ZeroLog.Info().Msg(g.Sprintf("%s => %s", url, resp.Status)) // 3xx case resp.StatusCode >= 300 && resp.StatusCode < 400: - app.ZeroLog.Info().Msg(b.Sprintf("%s => %s", url, resp.Status)) + app.ZeroLog.Info().Msg(b.Sprintf("%s => %s", url, resp.Header.Get("Location"))) // 4xx case resp.StatusCode >= 400 && resp.StatusCode < 500 && resp.StatusCode != 404: app.ZeroLog.Info().Msg(y.Sprintf("%s => %s", url, resp.Status)) diff --git a/pkg/fuzzer/normalize.go b/pkg/fuzzer/normalize.go index 2dcb6be..c97effa 100644 --- a/pkg/fuzzer/normalize.go +++ b/pkg/fuzzer/normalize.go @@ -3,7 +3,6 @@ package fuzzer import ( "errors" "net/url" - "strings" ) func NormalizeURL(base string) (string, error) { @@ -22,11 +21,6 @@ func NormalizeURL(base string) (string, error) { parsedURL.Scheme = "http" } - // Ensure there's a trailing slash in the path - if parsedURL.Path == "" || !strings.HasSuffix(parsedURL.Path, "/") { - parsedURL.Path += "/" - } - // Update the original string base = parsedURL.String()