add DroneBL to dnsbl module
This commit is contained in:
parent
fbe1acf220
commit
4560a0ff26
2 changed files with 16 additions and 4 deletions
|
@ -42,7 +42,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
for list in lists:
|
for list in lists:
|
||||||
record = self._check_list(list.hostname, address)
|
record = self._check_list(list.hostname, address)
|
||||||
if not record == None:
|
if not record == None:
|
||||||
failed.append((list.hostname, list.process(record)))
|
reason = list.process(record) or "unknown"
|
||||||
|
failed.append((list.hostname, reason))
|
||||||
return failed
|
return failed
|
||||||
|
|
||||||
def _check_list(self, list, address):
|
def _check_list(self, list, address):
|
||||||
|
|
|
@ -18,21 +18,32 @@ class ZenSpamhaus(DNSBL):
|
||||||
return "exploits"
|
return "exploits"
|
||||||
class EFNetRBL(DNSBL):
|
class EFNetRBL(DNSBL):
|
||||||
hostname = "rbl.efnetrbl.org"
|
hostname = "rbl.efnetrbl.org"
|
||||||
SPAMTRAP = ["2", "3"]
|
|
||||||
def process(self, result):
|
def process(self, result):
|
||||||
result = result.rsplit(".", 1)[1]
|
result = result.rsplit(".", 1)[1]
|
||||||
if result == "1":
|
if result == "1":
|
||||||
return "proxy"
|
return "proxy"
|
||||||
elif result in self.SPAMTRAP:
|
elif result in ["2", "3"]:
|
||||||
return "spamtap"
|
return "spamtap"
|
||||||
elif result == "4":
|
elif result == "4":
|
||||||
return "tor"
|
return "tor"
|
||||||
elif result == "5":
|
elif result == "5":
|
||||||
return "flooding"
|
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 = [
|
DEFAULT_LISTS = [
|
||||||
ZenSpamhaus(),
|
ZenSpamhaus(),
|
||||||
EFNetRBL()
|
EFNetRBL(),
|
||||||
|
DroneBL()
|
||||||
]
|
]
|
||||||
|
|
||||||
def default_lists():
|
def default_lists():
|
||||||
|
|
Loading…
Reference in a new issue