mirror of
https://github.com/Ekultek/Zeus-Scanner.git
synced 2026-03-11 08:55:51 +00:00
26 lines
718 B
Python
26 lines
718 B
Python
import re
|
|
|
|
from lib.core.common import HTTP_HEADER
|
|
|
|
|
|
__item__ = "Varnish FireWall (OWASP)"
|
|
|
|
|
|
def detect(content, **kwargs):
|
|
content = str(content)
|
|
headers = kwargs.get("headers", None)
|
|
detection_schema = (
|
|
re.compile(r"\bXID: \d+", re.I),
|
|
re.compile(r"varnish\Z", re.I),
|
|
re.compile(r"varnish"), re.I
|
|
)
|
|
try:
|
|
for detection in detection_schema:
|
|
if detection.search(content) is not None:
|
|
return True
|
|
if detection.search(headers.get(HTTP_HEADER.VIA, "")) is not None:
|
|
return True
|
|
if detection.search(headers.get(HTTP_HEADER.SERVER, "")) is not None:
|
|
return True
|
|
except:
|
|
pass
|