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

Function ScanFatGET

pkg/techniques.go:410–511  ·  view source on GitHub ↗

* Check for fat GET */

()

Source from the content-addressed store, hash-verified

408
409/* Check for fat GET */
410func ScanFatGET() reportResult {
411 var repResult reportResult
412 repResult.Technique = "Fat GET"
413
414 if len(impactfulQueries) == 0 {
415 msg := "No impactful query parameters were found beforehand. Run the query parameter scan (maybe with a different wordlist)."
416 Print(msg+"\n", Yellow)
417 repResult.HasError = true
418 repResult.ErrorMessages = append(repResult.ErrorMessages, msg)
419 return repResult
420 } else {
421 msg := fmt.Sprintf("The following parameters were found to be impactful and will be tested for parameter cloaking: %s\n", impactfulQueries)
422 Print(msg, Cyan)
423 }
424
425 threads := Config.Threads
426 if Config.Website.Cache.CBisHTTPMethod {
427 threads = 1 // No multithreading if HTTP Method is used... Otherwise there will be a lot of false negatives/positives
428 PrintVerbose("Can only scan single threaded because a HTTP Method is used as Cachebuster...\n", Yellow, 1)
429 }
430 sem := make(chan int, threads)
431 var wg sync.WaitGroup
432 wg.Add(len(impactfulQueries))
433 var m sync.Mutex
434
435 headers := []string{"", "", "X-HTTP-Method-Override", "X-HTTP-Method", "X-Method-Override"}
436 values := []string{"", "", "POST", "POST", "POST"}
437
438 for method := 0; method < 5; method++ {
439 var identifier string
440 forcePost := false
441 if method == 0 {
442 identifier = "simple Fat GET"
443 } else if method == 1 {
444 identifier = "POST Fat GET"
445 forcePost = true
446 } else {
447 identifier = fmt.Sprintf("%s Fat GET", headers[method])
448 }
449 msg := "Testing now " + identifier + "\n"
450 Print(msg, NoColor)
451
452 for i, s := range impactfulQueries {
453 // Parameter Limit
454 if i >= 500 {
455 if i == 500 {
456 Print("Parameter Limit at 500\n", Red)
457 }
458 wg.Done()
459 continue
460 }
461 poison := "p" + randInt()
462
463 go func(i int, s string, poison string) {
464 defer wg.Done()
465 sem <- 1
466 defer func() { <-sem }() // Freigabe der Semaphore, egal was passiert. Dadurch werden Deadlocks verhindert
467

Callers 1

runTestsFunction · 0.92

Calls 5

PrintFunction · 0.85
PrintVerboseFunction · 0.85
randIntFunction · 0.85
issueRequestsFunction · 0.85
getRespSplitFunction · 0.85

Tested by

no test coverage detected