Minor consistency update (with other WAF scripts) for #1543

This commit is contained in:
Miroslav Stampar 2015-11-18 09:04:01 +01:00
parent 378005d438
commit 69bc875eb3

View File

@ -7,6 +7,7 @@ See the file 'doc/COPYING' for copying permission
import re import re
from lib.core.enums import HTTP_HEADER
from lib.core.settings import WAF_ATTACK_VECTORS from lib.core.settings import WAF_ATTACK_VECTORS
__product__ = "Yunjiasu Web Application Firewall (Baidu)" __product__ = "Yunjiasu Web Application Firewall (Baidu)"
@ -17,7 +18,7 @@ def detect(get_page):
for vector in WAF_ATTACK_VECTORS: for vector in WAF_ATTACK_VECTORS:
page, headers, code = get_page(get=vector) page, headers, code = get_page(get=vector)
retval = re.search(r"fhl", headers.get("X-Server", ""), re.I) is not None retval = re.search(r"fhl", headers.get("X-Server", ""), re.I) is not None
retval |= re.search(r"yunjiasu-nginx", headers.get("server"), re.I) is not None retval |= re.search(r"yunjiasu-nginx", headers.get(HTTP_HEADER.SERVER), re.I) is not None
if retval: if retval:
break break