Couple of drei patches

This commit is contained in:
Miroslav Stampar
2019-05-07 23:00:15 +02:00
parent 4d028c7230
commit 285482b396
14 changed files with 20 additions and 15 deletions

View File

@@ -19,13 +19,13 @@ def detect(get_page):
retval = False
original, _, code = get_page()
if original is None or code >= 400:
if original is None or (code or 0) >= 400:
return False
for vector in WAF_ATTACK_VECTORS:
page, headers, code = get_page(get=vector)
if code >= 400 or (IPS_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 or 0) >= 400 or (IPS_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(getUnicode(_) for _ in (headers.headers if headers else {}) or [] if not _.startswith("URI")), getUnicode(page or ""))