Improved Telegram bot token rule regex and added more test cases (#1404)

Co-authored-by: toxyl <tox@novasonica.com>
This commit is contained in:
Toxandtoxyl authored and GitHub committed 2024-06-01 18:56:14 -05:00
1 parent 575e923cf8
commit bb4424d454
2 files changed
+34 -7

No files matched your search

+1 -1
View File
@@ -2766,7 +2766,7 @@ keywords = [
[[rules]]
id = "telegram-bot-api-token"
description = "Detected a Telegram Bot API Token, risking unauthorized bot operations and message interception on Telegram."
regex = '''(?i)(?:^|[^0-9])([0-9]{5,16}:A[a-zA-Z0-9_\-]{34})(?:$|[^a-zA-Z0-9_\-])'''
regex = '''(?i)(?:^|\b|bot)([0-9]{5,16}:A[a-z0-9_\-]{34})(?:$|\b[^_\-])'''
keywords = [
"telegram","api","bot","token","url",
]