Minor patch for WAF mechanism

This commit is contained in:
Miroslav Stampar 2017-10-16 11:42:11 +02:00
parent 94579aa80d
commit 1f60dfc835
2 changed files with 5 additions and 1 deletions

View File

@ -1382,6 +1382,9 @@ def identifyWaf():
retVal = []
for function, product in kb.wafFunctions:
if retVal and "unknown" in product.lower():
continue
try:
logger.debug("checking for WAF/IPS/IDS product '%s'" % product)
found = function(_)

View File

@ -16,8 +16,9 @@ def detect(get_page):
retval = False
for vector in WAF_ATTACK_VECTORS:
_, headers, _ = get_page(get=vector)
page, headers, _ = get_page(get=vector)
retval = re.search(r"\AFORTIWAFSID=", headers.get(HTTP_HEADER.SET_COOKIE, ""), re.I) is not None
retval |= all(_ in (page or "") for _ in (".fgd_icon", ".blocked", ".authenticate"))
if retval:
break