Minor colorization of WAF Detectify

This commit is contained in:
Miroslav Stampar
2018-08-30 15:18:42 +02:00
parent 9e892e93f3
commit 74d2b60cf3
4 changed files with 25 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ def detect(get_page):
if code >= 400 or (IDS_WAF_CHECK_PAYLOAD in vector and (code is None or re.search(GENERIC_PROTECTION_REGEX, page or "") and not re.search(GENERIC_PROTECTION_REGEX, original or ""))):
if code is not None:
kb.wafSpecificResponse = "HTTP/1.1 %s\n%s\n%s" % (code, "".join(_ for _ in headers.headers or [] if not _.startswith("URI")), page)
kb.wafSpecificResponse = "HTTP/1.1 %s\n%s\n%s" % (code, "".join(_ for _ in (headers.headers if headers else {}) or [] if not _.startswith("URI")), page)
retval = True
break