Skip to content

Commit

Permalink
fix "invalid URL escape" when doing web cache deception
Browse files Browse the repository at this point in the history
  • Loading branch information
m10x committed Dec 22, 2024
1 parent 3e6b664 commit 44d66d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/deception.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ func webCacheDeceptionTemplate(repResult *reportResult, appendStr string) error
var repRequest reportRequest

rUrl := Config.Website.Url.String()
// Überprüfen, ob der String genau zwei `//` enthält
if strings.Count(rUrl, "/") == 2 && !strings.HasPrefix(appendStr, "/") {
// append `/`, so e.g. https://example%0A does not throw an error when building the request
rUrl += "/"
}
req, err = http.NewRequest("GET", rUrl+appendStr, nil)
if err != nil {
msg = fmt.Sprintf("webCacheDeceptionTemplate: %s: http.NewRequest: %s\n", appendStr, err.Error())
Expand Down

0 comments on commit 44d66d4

Please sign in to comment.