sqlmap/waf/fortiweb.py

26 lines
685 B
Python
Raw Normal View History

2013-03-18 14:22:30 +04:00
#!/usr/bin/env python
"""
2019-01-05 23:38:52 +03:00
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
2017-10-11 15:50:46 +03:00
See the file 'LICENSE' for copying permission
2013-03-18 14:22:30 +04:00
"""
import re
from lib.core.enums import HTTP_HEADER
2013-03-18 14:22:30 +04:00
from lib.core.settings import WAF_ATTACK_VECTORS
2017-02-20 12:06:06 +03:00
__product__ = "FortiWeb Web Application Firewall (Fortinet)"
2013-03-18 14:22:30 +04:00
def detect(get_page):
retval = False
for vector in WAF_ATTACK_VECTORS:
2017-10-16 12:42:11 +03:00
page, headers, _ = get_page(get=vector)
retval = re.search(r"\AFORTIWAFSID=", headers.get(HTTP_HEADER.SET_COOKIE, ""), re.I) is not None
2017-10-16 12:42:11 +03:00
retval |= all(_ in (page or "") for _ in (".fgd_icon", ".blocked", ".authenticate"))
2013-03-18 14:22:30 +04:00
if retval:
break
return retval