Skip to content

Commit

Permalink
no need of trailing slash that was a bug, head supposed to be http
Browse files Browse the repository at this point in the history
added location on redirect
  • Loading branch information
CyberRoute committed Jul 4, 2024
1 parent 1f522ca commit 3aca873
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/bruter/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 0 additions & 6 deletions pkg/fuzzer/normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package fuzzer
import (
"errors"
"net/url"
"strings"
)

func NormalizeURL(base string) (string, error) {
Expand All @@ -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()

Expand Down

0 comments on commit 3aca873

Please sign in to comment.