2017-11-14 19:54:52 +00:00
|
|
|
import re
|
|
|
|
|
|
2017-11-27 19:09:53 +00:00
|
|
|
from lib.core.common import HTTP_HEADER
|
|
|
|
|
|
2017-11-14 19:54:52 +00:00
|
|
|
|
|
|
|
|
__item__ = "Squid Proxy (IDS)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def detect(content, **kwargs):
|
|
|
|
|
content = str(content)
|
|
|
|
|
headers = kwargs.get("headers", None)
|
|
|
|
|
detection_schema = (
|
|
|
|
|
re.compile(r"squid", re.I),
|
2017-11-27 19:09:53 +00:00
|
|
|
re.compile(r"Access control configuration prevents", re.I),
|
|
|
|
|
re.compile(r"X.Squid.Error", re.I),
|
2017-11-14 19:54:52 +00:00
|
|
|
)
|
|
|
|
|
for detection in detection_schema:
|
|
|
|
|
if detection.search(content) is not None:
|
|
|
|
|
return True
|
2017-11-27 19:09:53 +00:00
|
|
|
if detection.search(headers.get(HTTP_HEADER.SERVER, "")) is not None:
|
|
|
|
|
return True
|
|
|
|
|
if detection.search(str(headers)) is not None:
|
|
|
|
|
return True
|