Skip to content

Commit

Permalink
Update value_discord_bot_check.py
Browse files Browse the repository at this point in the history
  • Loading branch information
babenek authored Dec 12, 2024
1 parent e5a4ee8 commit 211d984
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions credsweeper/filters/value_discord_bot_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 211d984

Please sign in to comment.