From d3060f20d77197f168648ca0ffa7e54c70fc59c4 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 3 Dec 2014 13:22:55 +0100 Subject: [PATCH] Minor improvement --- lib/core/common.py | 2 +- lib/request/connect.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 97bd7632e..08c95cd24 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2833,7 +2833,7 @@ def showHttpErrorCodes(): for code, count in kb.httpErrorCodes.items()) logger.warn(warnMsg) if not kb.injections: - if any(str(_).startswith('4') or str(_).startswith('5') for _ in kb.httpErrorCodes.keys()): + if any((str(_).startswith('4') or str(_).startswith('5')) and _ != httplib.INTERNAL_SERVER_ERROR and _ != kb.originalCode for _ in kb.httpErrorCodes.keys()): msg = "too many 4xx and/or 5xx HTTP error codes " msg += "could mean that some kind of protection is involved (e.g. WAF)" logger.warn(msg) diff --git a/lib/request/connect.py b/lib/request/connect.py index 997e307a1..77464bc44 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -476,8 +476,9 @@ class Connect(object): page = page if isinstance(page, unicode) else getUnicode(page) code = e.code - threadData.lastHTTPError = (threadData.lastRequestUID, code) + kb.originalCode = kb.originalCode or code + threadData.lastHTTPError = (threadData.lastRequestUID, code) kb.httpErrorCodes[code] = kb.httpErrorCodes.get(code, 0) + 1 status = getUnicode(e.msg)