aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-12-12 14:54:58 +0000
committerGravatar jesopo2019-12-12 14:54:58 +0000
commit4560a0ff26c0b743426acf5d73cfc8df6e4d6e75 (patch)
treed2f468ad8cf2d754939c4e9fc311368c604dc42f
parentrefactor dnsbl module, show reason for positive detection when possible (diff)
signature
add DroneBL to dnsbl module
-rw-r--r--modules/dnsbl/__init__.py3
-rw-r--r--modules/dnsbl/lists.py17
2 files changed, 16 insertions, 4 deletions
diff --git a/modules/dnsbl/__init__.py b/modules/dnsbl/__init__.py
index 2c3fa36d..69bb189f 100644
--- a/modules/dnsbl/__init__.py
+++ b/modules/dnsbl/__init__.py
@@ -42,7 +42,8 @@ class Module(ModuleManager.BaseModule):
for list in lists:
record = self._check_list(list.hostname, address)
if not record == None:
- failed.append((list.hostname, list.process(record)))
+ reason = list.process(record) or "unknown"
+ failed.append((list.hostname, reason))
return failed
def _check_list(self, list, address):
diff --git a/modules/dnsbl/lists.py b/modules/dnsbl/lists.py
index 0ae6a1b6..ce2b6404 100644
--- a/modules/dnsbl/lists.py
+++ b/modules/dnsbl/lists.py
@@ -18,21 +18,32 @@ class ZenSpamhaus(DNSBL):
return "exploits"
class EFNetRBL(DNSBL):
hostname = "rbl.efnetrbl.org"
- SPAMTRAP = ["2", "3"]
def process(self, result):
result = result.rsplit(".", 1)[1]
if result == "1":
return "proxy"
- elif result in self.SPAMTRAP:
+ elif result in ["2", "3"]:
return "spamtap"
elif result == "4":
return "tor"
elif result == "5":
return "flooding"
+class DroneBL(DNSBL):
+ hostname = "dnsbl.dronebl.org"
+ def process(self, result):
+ result = result.rsplit(".", 1)[1]
+ if result in ["8", "9", "10", "11", "14"]:
+ return "proxy"
+ elif result in ["3", "6", "7"]:
+ return "flooding"
+ elif result in ["12", "13", "15", "16"]:
+ return "exploits"
+
DEFAULT_LISTS = [
ZenSpamhaus(),
- EFNetRBL()
+ EFNetRBL(),
+ DroneBL()
]
def default_lists():