From 211d9845fae61186e3675515b142ae910394f352 Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Thu, 12 Dec 2024 12:12:48 +0200 Subject: [PATCH] Update value_discord_bot_check.py --- credsweeper/filters/value_discord_bot_check.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/credsweeper/filters/value_discord_bot_check.py b/credsweeper/filters/value_discord_bot_check.py index b53f5c3a5..6038b1245 100644 --- a/credsweeper/filters/value_discord_bot_check.py +++ b/credsweeper/filters/value_discord_bot_check.py @@ -32,8 +32,8 @@ def run(self, line_data: LineData, target: AnalysisTarget) -> bool: id_part = line_data.value[:dot_separator_index] discord_id = int(Util.decode_base64(id_part, padding_safe=True, urlsafe_detect=True)) entropy_part = line_data.value[dot_separator_index:] - entropy = Util.get_shannon_entropy(entropy_part, Chars.BASE64STD_CHARS.value) - min_entropy = ValueEntropyBase64Check.get_min_data_entropy(len(line_data.value)) - if not 1000 > discord_id and not min_entropy < entropy: + entropy = Util.get_shannon_entropy(entropy_part, Chars.BASE64URL_CHARS.value) + min_entropy = ValueEntropyBase64Check.get_min_data_entropy(len(entropy_part)) + if 1000 <= discord_id and min_entropy <= entropy: return False return True