MCPcopy Create free account
hub / github.com/Hackmanit/Web-Cache-Vulnerability-Scanner / setRequestCookies

Function setRequestCookies

pkg/utils.go:188–204  ·  view source on GitHub ↗
(req *fasthttp.Request, cb string, cookie map[string]string)

Source from the content-addressed store, hash-verified

186}
187
188func setRequestCookies(req *fasthttp.Request, cb string, cookie map[string]string) {
189 cache := Config.Website.Cache
190
191 for k, v := range Config.Website.Cookies {
192 if cb != "" && cache.CBisCookie && k == cache.CBName {
193 if k == cookie["key"] {
194 msg := "Can't test cookie " + k + " for Web Cache Poisoning, as it is used as Cachebuster\n"
195 Print(msg, Yellow)
196 continue
197 }
198 k = cb
199 } else if k == cookie["key"] {
200 v = cookie["value"]
201 }
202 req.Header.SetCookie(k, v)
203 }
204}
205
206func addCachebusterParameter(strUrl string, cbvalue string, cb string, prepend bool) (string, string) {
207 if cbvalue == "" {

Callers 1

setRequestFunction · 0.85

Calls 1

PrintFunction · 0.85

Tested by

no test coverage detected