Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update value_discord_bot_check.py #634

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading