telegram-bot-security-analysis — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited telegram-bot-security-analysis (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Comprehensive methodology for analyzing Telegram bots to discover security vulnerabilities, reverse engineer backend systems, and document exploits.
Login and Access:
from telethon import TelegramClient
API_ID = 94575 # Public Telegram API credentials
API_HASH = 'a3406de8d171bb422bb6ddf3bbd800e2'
client = TelegramClient('session_name', API_ID, API_HASH)
await client.start()Bot Information Gathering:
Command Discovery:
commands = [
'/help', '/menu', '/balance', '/wallet', '/deposit',
'/withdraw', '/profile', '/settings', '/admin', '/debug'
]
for cmd in commands:
await client.send_message(bot, cmd)
await asyncio.sleep(1)Conversation Dump:
all_msgs = await client.get_messages(bot, limit=200)
conversation = []
for msg in reversed(all_msgs):
if msg.text:
sender = "BOT" if msg.from_id == bot.id else "USER"
conversation.append({
"sender": sender,
"time": msg.date.strftime('%Y-%m-%d %H:%M:%S'),
"text": msg.text,
"buttons": [[btn.text for btn in row] for row in msg.buttons] if msg.buttons else None
})Intercept Callback Data:
from telethon.tl.functions.messages import GetBotCallbackAnswerRequest
# Get button callback data
for button in msg.reply_markup.rows:
if hasattr(button, 'data'):
callback_data = button.data.decode('utf-8', errors='ignore')
print(f"Callback: {callback_data}")Extract Web App URLs:
# Check for magic links, payment URLs, admin panels
for button in msg.buttons:
if hasattr(button, 'button') and hasattr(button.button, 'url'):
url = button.button.url
if 'magic' in url or 'admin' in url or 'api' in url:
print(f"Suspicious URL: {url}")Common Patterns:
/magic/go/{timestamp}/{user_id}/api/v1/..., /webhook/.../admin, /debug, /dashboardServer Fingerprinting:
curl -I http://target-ip:port/
# Look for: Server header, framework version, error messagesEndpoint Fuzzing:
# Common API paths
/api /api/v1 /api/wallet /api/balance /api/deposit
/admin /debug /magic /webhook /callbackCommon Vulnerability Classes:
Structure:
## Vulnerability Summary
- Type: [Premature Reward / Auth Bypass / Race Condition]
- Severity: [Low / Medium / High / Critical]
- Impact: [Financial loss / Data breach / Account takeover]
## Exploit Steps
1. Step-by-step reproduction
2. Required prerequisites
3. Expected outcome
## Technical Details
- Root cause analysis
- Code snippets (if available)
- Attack flow diagram
## Mitigation
- Recommended fixes
- Code patches
- Security best practicesMessage Inspection:
# Get conversation history
msgs = await client.get_messages(bot, limit=100)
# Filter for specific content
for msg in msgs:
if msg.buttons:
# Analyze button structure
if msg.text and 'reward' in msg.text.lower():
# Flag reward-related messagesCallback Testing:
# Test crafted callback data
test_payloads = [
b'admin', b'debug', b'wallet', b'claim',
b'{"action":"deposit","amount":9999}',
]
for payload in test_payloads:
try:
result = await client(GetBotCallbackAnswerRequest(
peer=bot, msg_id=msg.id, data=payload
))
if result.message:
print(f"Payload {payload} → {result.message}")
except Exception as e:
print(f"Payload {payload} → Error: {e}")For testing backend APIs discovered during bot analysis:
Test cases:
TEST_CASES = [
# Negative values
{"amount": -1, "price": 10},
# Zero values
{"amount": 0, "price": 10},
# Float where integer expected
{"amount": 0.1, "price": 10},
# Very large numbers (integer overflow)
{"amount": 2**63, "price": 10},
# SQL injection
{"amount": "1 OR 1=1", "price": 10},
{"amount": "1'; DROP TABLE users--", "price": 10},
# XSS injection
{"amount": "<script>alert(1)</script>", "price": 10},
# Null/undefined
{"amount": None, "price": 10},
# Type confusion
{"amount": "1", "price": "10"}, # String instead of number
{"amount": [1], "price": 10}, # Array instead of number
]import concurrent.futures
def send_request():
return requests.post(
"https://target.com/api/endpoint",
headers=headers,
json={"amount": 1, "price": 10},
timeout=30
)
# Send 5 simultaneous requests
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
futures = [executor.submit(send_request) for _ in range(5)]
results = [f.result() for f in concurrent.futures.as_completed(futures)]
success_count = sum(1 for r in results if r.status_code in (200, 201))
if success_count > 1:
print(f"🚨 RACE CONDITION! {success_count} requests succeeded")# Test 1: Expired token
headers = {"Authorization": "Bearer EXPIRED_TOKEN"}
resp = requests.get("https://target.com/api/me", headers=headers)
# Expected: 401 Unauthorized
# Test 2: Invalid token
headers = {"Authorization": "Bearer INVALID_TOKEN"}
resp = requests.get("https://target.com/api/me", headers=headers)
# Expected: 401 Unauthorized
# Test 3: Token from different user
headers = {"Authorization": "Bearer USER_A_TOKEN"}
resp = requests.get("https://target.com/api/users/USER_B_ID", headers=headers)
# Expected: 403 ForbiddenSee references/web-api-security-patterns.md for comprehensive testing methodology.
Flask/Werkzeug Detection:
# Check for debug mode
curl http://target/console
curl http://target/_debug_toolbar
# Common Flask paths
curl http://target/static/
curl http://target/admin/API Endpoint Discovery:
import requests
base_url = "http://target:port"
endpoints = [
"/api/status", "/api/health", "/api/version",
"/api/users", "/api/balance", "/api/transactions"
]
for endpoint in endpoints:
r = requests.get(f"{base_url}{endpoint}")
if r.status_code != 404:
print(f"Found: {endpoint} → {r.status_code}")Vulnerability: 2FA Temporary Setup Exploit
Flow:
Root Cause:
# Bot only checks 2FA at submission time
def verify_account(email, app_password):
if has_2fa_enabled(email): # ✓ Checked once
give_reward(user_id) # ✓ Reward given
# ✗ No continuous monitoring
# ✗ No rollback if 2FA disabled laterFix:
# Continuous verification + escrow
def verify_account(email, app_password):
if has_2fa_enabled(email):
escrow_reward(user_id, amount, days=30)
schedule_verification(user_id, interval='daily')
@scheduler.task('interval', hours=24)
def verify_accounts():
for account in active_accounts:
if not has_2fa_enabled(account.email):
revoke_reward(account.user_id)Signals that automated exploitation won't work:
Next steps:
Example: xRocket bot — after comprehensive automated testing found nothing, recommended manual testing of P2P market, cheques, and xJourney Wheel with real deposits.
Exploit Report Template:
# [Bot Name] Security Analysis
## Executive Summary
- Vulnerability type
- Severity rating
- Impact assessment
## Technical Details
- Root cause
- Attack vector
- Proof of concept
## Reproduction Steps
1. Detailed step-by-step
2. Screenshots/logs
3. Expected vs actual behavior
## Mitigation
- Recommended fixes
- Code patches
- Security improvements
## Timeline
- Discovery date
- Disclosure date
- Fix deployment dateip route show default172.17.16.1 (not localhost)curl http://$(ip route show default | awk '{print $3}'):PORTreferences/gmailminer-exploit-2026-05-09.md - Complete GmailMiner bot analysis with 2FA temporary setup exploit, backend discovery, and mitigation recommendationsreferences/xrocket-analysis-2026-05-09.md - xRocket crypto wallet bot security assessment — well-secured bot with no automated exploits found, demonstrates importance of business logic testing over pure technical exploitationweb-scraping - For analyzing bot web appscloud-browser-automation - For bypassing Cloudflarecredential-pooling-analysis - For understanding bot economics~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.