mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Refactoring WAF scripts
This commit is contained in:
parent
e5835dc74f
commit
be50192d8d
13 changed files with 115 additions and 45 deletions
|
|
@ -8,12 +8,18 @@ See the file 'doc/COPYING' for copying permission
|
|||
import re
|
||||
|
||||
from lib.core.enums import HTTPHEADER
|
||||
from lib.core.settings import WAF_ATTACK_VECTORS
|
||||
|
||||
__product__ = "BinarySEC Web Application Firewall (BinarySEC)"
|
||||
|
||||
def detect(get_page):
|
||||
page, headers, code = get_page()
|
||||
retval = re.search(r"BinarySec", headers.get(HTTPHEADER.SERVER, ""), re.I) is not None
|
||||
if not retval:
|
||||
retval = False
|
||||
|
||||
for vector in WAF_ATTACK_VECTORS:
|
||||
page, headers, code = get_page(get=vector)
|
||||
retval = any(headers.get(_) for _ in ("x-binarysec-via", "x-binarysec-nocache"))
|
||||
retval |= re.search(r"BinarySec", headers.get(HTTPHEADER.SERVER, ""), re.I) is not None
|
||||
if retval:
|
||||
break
|
||||
|
||||
return retval
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue