|
15 | 15 | import org.springframework.web.client.RestTemplate; |
16 | 16 |
|
17 | 17 | /** |
18 | | - * This challenge is about finding a secret in a Telegram channel/bot. |
| 18 | + * This challenge demonstrates how hardcoded Telegram bot credentials can be discovered and |
| 19 | + * exploited. |
19 | 20 | * |
20 | | - * <p>The challenge demonstrates how hardcoded Telegram bot credentials can be discovered and |
21 | | - * exploited. The bot token is double-encoded in base64 to make it slightly more challenging but |
22 | | - * still discoverable through code inspection. |
| 21 | + * <p>The bot token is double-encoded in base64 to make it slightly more challenging but still |
| 22 | + * discoverable through code inspection. |
23 | 23 | * |
24 | | - * <p><b>Multi-Instance Setup (Heroku/Cloud Deployments):</b> |
| 24 | + * <p>This challenge supports running on multiple app instances using either polling (getUpdates) or |
| 25 | + * webhooks. For detailed setup instructions including BotFather configuration, webhook setup, and |
| 26 | + * creating a new bot, see: {@code docs/CHALLENGE61_MULTI_INSTANCE_SETUP.md} |
25 | 27 | * |
26 | | - * <p>This challenge supports running on multiple app instances (e.g., Arcane and WrongSecrets |
27 | | - * Heroku apps) using either polling (getUpdates) or webhooks: |
28 | | - * |
29 | | - * <p><b>Option 1: Polling with getUpdates (Default - Works Out of Box)</b><br> |
30 | | - * - No configuration needed<br> |
31 | | - * - Uses update offsets to minimize conflicts between instances<br> |
32 | | - * - Multiple instances can run simultaneously<br> |
33 | | - * - Less efficient but simpler setup |
34 | | - * |
35 | | - * <p><b>Option 2: Webhooks (Recommended for Production)</b><br> |
36 | | - * 1. Enable webhook mode by setting environment variables:<br> |
37 | | - * {@code heroku config:set CHALLENGE61_WEBHOOK_ENABLED=true -a your-app}<br> |
38 | | - * {@code heroku config:set CHALLENGE61_WEBHOOK_TOKEN=$(openssl rand -hex 32) -a your-app} |
39 | | - * |
40 | | - * <p>2. Set the webhook URL with Telegram (choose ONE primary app):<br> |
41 | | - * {@code curl -X POST |
42 | | - * "https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=https://your-app.herokuapp.com/telegram/webhook/challenge61&secret_token=<WEBHOOK_TOKEN>"} |
43 | | - * |
44 | | - * <p>3. Verify webhook is active:<br> |
45 | | - * {@code curl "https://api.telegram.org/bot<BOT_TOKEN>/getWebhookInfo"} |
46 | | - * |
47 | | - * <p>4. To disable webhook and return to polling:<br> |
48 | | - * {@code curl -X POST "https://api.telegram.org/bot<BOT_TOKEN>/deleteWebhook"} |
49 | | - * |
50 | | - * <p><b>BotFather Configuration (Optional but Recommended):</b> |
51 | | - * |
52 | | - * <p>1. Configure commands:<br> |
53 | | - * - Send {@code /setcommands} to @BotFather<br> |
54 | | - * - Select your bot<br> |
55 | | - * - Add: {@code start - Get the secret message} |
56 | | - * |
57 | | - * <p>2. Set description:<br> |
58 | | - * - Send {@code /setdescription} to @BotFather<br> |
59 | | - * - Select your bot<br> |
60 | | - * - Add: "OWASP WrongSecrets Challenge 61 - Demonstrates hardcoded bot credentials. Send /start to |
61 | | - * receive the secret!" |
62 | | - * |
63 | | - * <p>3. Set about text:<br> |
64 | | - * - Send {@code /setabouttext} to @BotFather<br> |
65 | | - * - Add: "Educational security challenge from OWASP WrongSecrets project" |
66 | | - * |
67 | | - * <p><b>Testing the Bot:</b><br> |
68 | | - * 1. Find the bot: Search for @WrongsecretsBot in Telegram (or your bot username)<br> |
69 | | - * 2. Send: {@code /start}<br> |
70 | | - * 3. Receive: "Welcome! Your secret is: telegram_secret_found_in_channel" |
71 | | - * |
72 | | - * <p><b>Creating a New Bot:</b><br> |
73 | | - * If you need to create your own bot for testing:<br> |
74 | | - * 1. Message @BotFather in Telegram<br> |
75 | | - * 2. Send {@code /newbot}<br> |
76 | | - * 3. Follow prompts to choose name and username<br> |
77 | | - * 4. BotFather will provide a token like: {@code 1234567890:ABCdefGHIjklMNOpqrsTUVwxyz}<br> |
78 | | - * 5. Double-encode the token for use in this challenge:<br> |
79 | | - * {@code echo -n "YOUR_TOKEN" | base64 | base64}<br> |
80 | | - * 6. Replace the {@code encodedToken} value in the {@code getBotToken()} method |
81 | | - * |
82 | | - * <p>See also: docs/CHALLENGE61_MULTI_INSTANCE_SETUP.md for detailed setup instructions |
| 28 | + * <p><b>Quick Start:</b> Search for @WrongsecretsBot in Telegram and send {@code /start} to receive |
| 29 | + * the secret. |
83 | 30 | */ |
84 | 31 | @Component |
85 | 32 | public class Challenge61 implements Challenge { |
|
0 commit comments