Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f60dfc

Browse files
committed
Minor patch for WAF mechanism
1 parent 94579aa commit 1f60dfc

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/controller/checks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,9 @@ def _(*args, **kwargs):
13821382
retVal = []
13831383

13841384
for function, product in kb.wafFunctions:
1385+
if retVal and "unknown" in product.lower():
1386+
continue
1387+
13851388
try:
13861389
logger.debug("checking for WAF/IPS/IDS product '%s'" % product)
13871390
found = function(_)

waf/fortiweb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ def detect(get_page):
1616
retval = False
1717

1818
for vector in WAF_ATTACK_VECTORS:
19-
_, headers, _ = get_page(get=vector)
19+
page, headers, _ = get_page(get=vector)
2020
retval = re.search(r"\AFORTIWAFSID=", headers.get(HTTP_HEADER.SET_COOKIE, ""), re.I) is not None
21+
retval |= all(_ in (page or "") for _ in (".fgd_icon", ".blocked", ".authenticate"))
2122
if retval:
2223
break
2324

0 commit comments

Comments
 (0)