Skip to content

Commit 7476d7a

Browse files
committed
improve reason starting with reason type
1 parent 5ed57a5 commit 7476d7a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/requests.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ func checkPoisoningIndicators(repResult *reportResult, repCheck reportCheck, suc
6363
if repCheck.Reason == "" {
6464
// check for reflrection in body
6565
if poison != "" && poison != "http" && poison != "https" && poison != "nothttps" && poison != "1" && strings.Contains(body, poison) { // dont check for reflection of http/https/nothttps (used by forwarded headers), 1 (used by DOS) or empty poison
66-
repCheck.Reason = fmt.Sprintf("Response Body contained poison value %s %d times", poison, strings.Count(body, poison))
66+
repCheck.Reason = fmt.Sprintf("Reflection Body: Response Body contained poison value %s %d times", poison, strings.Count(body, poison))
6767
repCheck.Occurrences = findOccurrencesWithContext(body, poison, 25)
6868
// check for reflection in headers
6969
} else if len(headersWithPoison) > 0 {
70-
repCheck.Reason = fmt.Sprintf("Response Header(s) %s contained poison value %s", strings.Join(headersWithPoison, ", "), poison)
70+
repCheck.Reason = fmt.Sprintf("Reflection Header: Response Header(s) %s contained poison value %s", strings.Join(headersWithPoison, ", "), poison)
7171
// check for different status code
7272
} else if statusCode1 >= 0 && statusCode1 != Config.Website.StatusCode && statusCode1 == statusCode2 {
7373
// check if status code should be ignored
@@ -101,7 +101,7 @@ func checkPoisoningIndicators(repResult *reportResult, repCheck reportCheck, suc
101101
}
102102
return checkPoisoningIndicators(repResult, repCheck, success, body, poison, statusCode1, statusCode2, sameBodyLength, header, true)
103103
} else {
104-
repCheck.Reason = fmt.Sprintf("Status Code %d differed from %d", statusCode1, Config.Website.StatusCode)
104+
repCheck.Reason = fmt.Sprintf("Changed Status Code: Status Code %d differed from %d", statusCode1, Config.Website.StatusCode)
105105
}
106106
// check for different body length
107107
} else if Config.CLDiff != 0 && success != "" && sameBodyLength && len(body) > 0 && compareLengths(len(body), len(Config.Website.Body), Config.CLDiff) {
@@ -126,7 +126,7 @@ func checkPoisoningIndicators(repResult *reportResult, repCheck reportCheck, suc
126126
}
127127
return checkPoisoningIndicators(repResult, repCheck, success, body, poison, statusCode1, statusCode2, sameBodyLength, header, true)
128128
} else {
129-
repCheck.Reason = fmt.Sprintf("Length %d differed more than %d bytes from normal length %d", len(body), Config.CLDiff, len(Config.Website.Body))
129+
repCheck.Reason = fmt.Sprintf("Changed Content Length: Length %d differed more than %d bytes from normal length %d", len(body), Config.CLDiff, len(Config.Website.Body))
130130
}
131131
} else {
132132
return headersWithPoison

0 commit comments

Comments
 (0)