2014-08-28 04:53:21 +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
|
2014-08-28 04:53:21 +04:00
|
|
|
"""
|
|
|
|
|
|
|
|
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)"
|
2014-08-28 04:53:21 +04:00
|
|
|
|
|
|
|
def detect(get_page):
|
2016-05-27 03:24:59 +03:00
|
|
|
retval = False
|
2014-08-28 04:53:21 +04:00
|
|
|
|
|
|
|
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
|
2017-11-06 15:09:24 +03:00
|
|
|
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
|
2018-08-05 15:19:27 +03:00
|
|
|
retval |= headers.get("X-Sucuri-ID") is not None
|
|
|
|
retval |= headers.get("X-Sucuri-Cache") is not None
|
2016-05-27 03:24:59 +03:00
|
|
|
if retval:
|
2014-08-28 04:53:21 +04:00
|
|
|
break
|
|
|
|
|
2016-05-27 03:24:59 +03:00
|
|
|
return retval
|