From 6d19d03845c5a96b2ce4d3618d0eafe37faaa05b Mon Sep 17 00:00:00 2001 From: ekultek Date: Tue, 14 Nov 2017 19:39:37 -0600 Subject: [PATCH] will now check if it is running an apache server by searching the HTML tags for the error that occurs from Apache webservers (issue #142) --- lib/firewall/generic.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/firewall/generic.py b/lib/firewall/generic.py index d6d4ae5..daa591f 100644 --- a/lib/firewall/generic.py +++ b/lib/firewall/generic.py @@ -8,6 +8,13 @@ __item__ = "Generic (Unknown)" def detect(content, **kwargs): content = str(content) + status = kwargs.get("status", None) + if status == 403: + # if the error HTML is an Apache error, Apache has a tendency to be fucking stupid + # and output 403 errors when you are trying to do something fun. mostly because + # Apache is a killer of fun and doesn't like anything decent in this life. + if re.compile(r"<.+>403 Forbidden<.+.>", re.I).search(content) is not None: + return False detection_schema = ( re.compile("blocked", re.I), re.compile("forbidden", re.I), re.compile("illegal", re.I), re.compile("reported", re.I),