elif blocked.endswith(".tld"):
logger.debug("blocked='%s' is a fake domain - SKIPPED!", blocked)
continue
- elif blocked.count("*") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
- # Obscured domain name with no hash
- row = instances.deobfuscate("*", blocked)
+ logger.debug("Invoking utils.deobfuscate_domain(%s, %s) ...", blocked, domain)
+ blocked = utils.deobfuscate_domain(blocked, domain)
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
-
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
- elif blocked.count("?") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
-
- # Obscured domain name with no hash
- row = instances.deobfuscate("?", blocked)
-
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
-
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
-
- logger.debug("blocked='%s'", blocked)
+ logger.debug("blocked='%s' - DEOBFUSCATED!", blocked)
if not utils.is_domain_wanted(blocked):
logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
continue
elif blocked.endswith(".tld"):
logger.debug("blocked='%s' is a fake domain - SKIPPED!", blocked)
continue
- elif blocked.count("*") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
-
- # Obscured domain name with no hash
- row = instances.deobfuscate("*", blocked)
-
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
-
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
- elif blocked.count("?") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
-
- # Obscured domain name with no hash
- row = instances.deobfuscate("?", blocked)
-
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
+ logger.debug("Invoking utils.deobfuscate_domain(%s, %s) ...", blocked, domain)
+ blocked = utils.deobfuscate_domain(blocked, domain)
logger.debug("blocked='%s' - DEOBFUSCATED!", blocked)
if not utils.is_domain_wanted(blocked):
if blocked == "":
logger.warning("blocked is empty after tidyup.domain(): domain='%s',block_level='%s'", domain, block_level)
continue
- elif blocked.count("*") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
-
- # Obscured domain name with no hash
- row = instances.deobfuscate("*", blocked)
-
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
- elif blocked.count("?") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
-
- # Obscured domain name with no hash
- row = instances.deobfuscate("?", blocked)
-
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
-
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
+ logger.debug("Invoking utils.deobfuscate_domain(%s, %s) ...", blocked, domain)
+ blocked = utils.deobfuscate_domain(blocked, domain)
logger.debug("blocked='%s' - DEOBFUSCATED!", blocked)
if not utils.is_domain_wanted(blocked):
if blocked == "":
logger.warning("blocked is empty after tidyup.domain(): domain='%s',block_level='%s'", domain, block_level)
continue
- elif blocked.count("*") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
-
- # Obscured domain name with no hash
- row = instances.deobfuscate("*", blocked)
-
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
-
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
- elif blocked.count("?") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
- # Obscured domain name with no hash
- row = instances.deobfuscate("?", blocked)
+ logger.debug("Invoking utils.deobfuscate_domain(%s, %s) ...", blocked, domain)
+ blocked = utils.deobfuscate_domain(blocked, domain)
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
-
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
-
- logger.debug("blocked='%s'", blocked)
+ logger.debug("blocked='%s' - DEOBFUSCATED!", blocked)
if not utils.is_domain_wanted(blocked):
logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
continue
logger.info("Checking %d record(s) ...", len(blocklist))
for block_level in blocklist:
logger.debug("block_level='%s'", block_level)
-
rows = blocklist[block_level]
+
logger.debug("rows[%s]()=%d'", type(rows), len(rows))
for record in rows:
logger.debug("record[]='%s'", type(record))
if blocked == "":
logger.warning("blocked is empty after tidyup.domain(): domain='%s',block_level='%s'", domain, block_level)
continue
- elif blocked.count("*") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
-
- # Obscured domain name with no hash
- row = instances.deobfuscate("*", blocked)
-
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
-
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
- elif blocked.count("?") > 0:
- logger.debug("domain='%s' uses obfuscated domains, marking ...", domain)
- instances.set_has_obfuscation(domain, True)
-
- # Obscured domain name with no hash
- row = instances.deobfuscate("?", blocked)
-
- logger.debug("row[]='%s'", type(row))
- if row is None:
- logger.warning("Cannot deobfuscate blocked='%s',domain='%s' - SKIPPED!", blocked, domain)
- continue
-
- logger.debug("blocked='%s' de-obscured to '%s'", blocked, row[0])
- blocked = row[0]
+
+ logger.debug("Invoking utils.deobfuscate_domain(%s, %s) ...", blocked, domain)
+ blocked = utils.deobfuscate_domain(blocked, domain)
logger.debug("blocked='%s' - DEOBFUSCATED!", blocked)
if not utils.is_domain_wanted(blocked):