Update fediverse.py
Some checks are pending
Ruff / ruff (push) Waiting to run

This commit is contained in:
Namhyeon Go 2024-10-09 01:32:45 +09:00 committed by GitHub
parent a0775bd15a
commit c272efe8b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,9 +75,10 @@ class Fediverse(Extension):
pattern = r"\b(?:(?<=\/@)|(?<=acct:))([a-zA-Z0-9]{10})\b"
matches = list(set(re.findall(pattern, text)))
if len(matches) > 0:
logger.info("[*] Found ID: %s" % (", ".join(matches)))
try:
filtered = not all(map(self.pwnedpasswords_test, matches))
if filtered:
logger.warning("[*] Found Suspicious ID: %s" % (", ".join(matches)))
except Exception as e:
logger.error("[*] K-Anonymity strategy not working!", exc_info=e)
filtered = True