sqlmap/waf/sucuri.py

28 lines
861 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/)
2017-10-11 15:50:46 +03:00
See the file 'LICENSE' 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
retval |= "Access Denied - Sucuri Website Firewall" in (page or "")
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