From c03c7c611e39c60ccd69b6fc6f0fb0e5e05a7af8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 12 Sep 2023 09:40:21 +0200 Subject: [PATCH] Continued: - has_obfuscation should be only an indicator if a single domain is obfuscated then this should be set to True, otherwise False --- fba/commands.py | 4 ---- fba/utils.py | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fba/commands.py b/fba/commands.py index 9089cd3..1d89306 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1633,10 +1633,6 @@ def recheck_obfuscation(args: argparse.Namespace) -> int: instances.set_obfuscated_blocks(row["domain"], obfuscated) logger.info("domain='%s' has %d obfuscated domain(s)", row["domain"], obfuscated) - if obfuscated == 0 and len(blocking) > 0: - logger.info("Block list from domain='%s' has been fully deobfuscated.", row["domain"]) - instances.set_has_obfuscation(row["domain"], False) - if instances.has_pending(row["domain"]): logger.debug("Flushing updates for blocker='%s' ...", row["domain"]) instances.update(row["domain"]) diff --git a/fba/utils.py b/fba/utils.py index 18e4712..dd12f30 100644 --- a/fba/utils.py +++ b/fba/utils.py @@ -120,6 +120,9 @@ def deobfuscate(domain: str, blocker: str, domain_hash: str = None) -> str: elif not isinstance(domain_hash, str) and domain_hash is not None: raise ValueError(f"Parameter domain_hash[]='{type(domain_hash)}' is not of type 'str'") + logger.debug("Setting has_obfuscation=False for blocker='%s' ...", blocker) + instances.set_has_obfuscation(blocker, False) + if domain.find("*") >= 0: logger.debug("blocker='%s' uses obfuscated domains", blocker) -- 2.39.5