Skip to content

Commit

Permalink
only send 2nd/3rd "setStatusCode" request if cachebuster was found
Browse files Browse the repository at this point in the history
  • Loading branch information
m10x committed Apr 27, 2022
1 parent 190c5f0 commit ed34eb3
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions web-cache-vulnerability-scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,18 +317,20 @@ func runTests(rec int, u string, progress string, foundUrls *[]string, stat stri
}
*/

// retrieve response with cachebuster
pkg.Config.Website, err = pkg.GetWebsite(u, false, true)
if err != nil {
repWebsite.HasError = true
repWebsite.ErrorMessages = append(repWebsite.ErrorMessages, err.Error())
report.Websites = append(report.Websites, repWebsite)
// retrieve response with cachebuster if cachebuster was found
if pkg.Config.Website.Cache.CBwasFound {
pkg.Config.Website, err = pkg.GetWebsite(u, true, true)
if err != nil {
repWebsite.HasError = true
repWebsite.ErrorMessages = append(repWebsite.ErrorMessages, err.Error())
report.Websites = append(report.Websites, repWebsite)

msg := fmt.Sprintf("Couldn't test url: %s\n", err.Error())
pkg.Print(msg, pkg.Red)
msg := fmt.Sprintf("Couldn't test url: %s\n", err.Error())
pkg.Print(msg, pkg.Red)

pkg.Statistics[stat+"errorcachebuster"]++
return
pkg.Statistics[stat+"errorcachebuster"]++
return
}
}

/*******************************************/
Expand Down

0 comments on commit ed34eb3

Please sign in to comment.