From b695b0e6763a5435b96566ea3b7a29357ec9c2d1 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Thu, 23 May 2024 22:46:36 -0500 Subject: [PATCH] Add a custom blacklist provider for droneBL, since the default one doesn't work for it. --- config.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index ea21838..17d8ef0 100644 --- a/config.py +++ b/config.py @@ -6,7 +6,25 @@ from typing import Optional, Any, Union import bare, pylast from pydnsbl import DNSBLIpChecker, DNSBLDomainChecker, providers as BL -providers = BL.BASE_PROVIDERS + [BL.Provider('dnsbl.dronebl.org.org')] +class droneBL(BL.Provider): + def process_response(self, response): + reasons = set() + for result in response: + reason = result.host + if reason in ['127.0.0.3']: + reasons.add('IRC Spambot') + elif reason in ['127.0.0.19']: + reasons.add('Abused VPN') + elif reason in ['127.0.0.9', '127.0.0.8']: + reasons.add('Open Proxy') + elif reason in ['127.0.0.13']: + reasons.add('Automated Attacks') + else: + print('Unknown dnsbl reason: ' + reason, flush=True) + reasons.add('unknown') + return reasons + +providers = BL.BASE_PROVIDERS + [droneBL('dnsbl.dronebl.org')] ipbl = DNSBLIpChecker(providers=providers) hsbl = DNSBLDomainChecker(providers=providers)