From cd7e83f0f7ab2d61953a954f93a8c6ec266a7d0d Mon Sep 17 00:00:00 2001 From: Mint <> Date: Mon, 3 Oct 2022 19:50:28 +0300 Subject: [PATCH] Obscured domain guessing for reasons field --- fetch_blocks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fetch_blocks.py b/fetch_blocks.py index 592504c..15d1a6d 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -253,6 +253,16 @@ for blocker, software in c.fetchall(): ).items(): for blocked, reason in info.items(): blocked = tidyup(blocked) + if blocked == "": + continue + if blocked.count("*") > 1: + # same domain guess as above, but for reasons field + c.execute( + "select domain from instances where domain like ? order by rowid limit 1", (blocked.replace("*", "_"),) + ) + searchres = c.fetchone() + if searchres != None: + blocked = searchres[0] c.execute( "update blocks set reason = ? where blocker = ? and blocked = ? and block_level = ?", (reason["reason"], blocker, blocked, block_level), -- 2.39.5