sqlmap/waf/sucuri.py

27 lines
789 B
Python
Raw Normal View History

#!/usr/bin/env python
"""
2017-01-02 16:19:18 +03:00
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.enums import HTTP_HEADER
from lib.core.settings import WAF_ATTACK_VECTORS
2016-07-07 00:43:21 +03:00
__product__ = "CloudProxy WebSite Firewall (Sucuri)"
def detect(get_page):
2016-05-27 03:24:59 +03:00
retval = False
for vector in WAF_ATTACK_VECTORS:
2016-07-07 00:43:21 +03:00
page, headers, code = get_page(get=vector)
2016-05-27 03:24:59 +03:00
retval = code == 403 and re.search(r"Sucuri/Cloudproxy", headers.get(HTTP_HEADER.SERVER, ""), re.I) is not None
2016-07-07 00:43:21 +03:00
retval |= "Sucuri WebSite Firewall - CloudProxy - Access Denied" in (page or "")
retval |= re.search(r"Questions\?.+cloudproxy@sucuri\.net", (page or "")) is not None
2016-05-27 03:24:59 +03:00
if retval:
break
2016-05-27 03:24:59 +03:00
return retval