Cracked Companion

The drone companion APK hardcodes one flag in AppInfo and XORs the other with the pilot callsign in DroneConnectionManager.

Solve:

  1. Opened the app.apk in JADX and going to com.dronevillage.link -> AppInfo, you can see the first flag!

1

Flag 1: CTFAC{61a6e33d458899848a266babf9f6c8cf0ef5fbb1ff29d21ae172bbbf3b2e372a}

  1. Now going into the actual Main Activity, we can see some interesting functions:
package com.dronevillage.link;

import android.app.Activity;
import android.os.Bundle;
import com.dronevillage.link.connection.DroneConnectionManager;
import com.dronevillage.link.telemetry.TelemetryUploader;
import com.dronevillage.link.ui.MapViewController;
import com.dronevillage.link.util.Logger;
import com.dronevillage.link.util.PreferencesManager;

/* JADX INFO: loaded from: classes.dex */
public class MainActivity extends Activity {
    private final TelemetryUploader telemetryUploader = new TelemetryUploader();
    private final DroneConnectionManager connectionManager = new DroneConnectionManager();
    private final PreferencesManager preferences = new PreferencesManager();
    private final MapViewController mapController = new MapViewController();

    @Override // android.app.Activity
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Logger.logEvent("AppStartup", AppInfo.getFormattedVersion());
        this.telemetryUploader.uploadFlightTelemetry("sess-8821-a");
        this.connectionManager.performHandshake("");
        this.mapController.centerOnDrone();
        this.preferences.getPreferredUnit();
    }
}

But the one that actually gave us something interesting is connectionManager aka DroneConnectionManager().

Opening it we can see a quite interesting BLOB:

2

And also:

private static String decodePairingSecret() {
        byte[] bArr = PAIRING_SHARED_SECRET_BLOB;
        int length = bArr.length;
        byte[] bArr2 = new byte[length];
        String strDeriveHandshakeKeyFromPilotCallsign = deriveHandshakeKeyFromPilotCallsign();
        int length2 = strDeriveHandshakeKeyFromPilotCallsign.length();
        for (int i = 0; i < length; i++) {
            bArr2[i] = (byte) (bArr[i] ^ strDeriveHandshakeKeyFromPilotCallsign.charAt(i % length2));
        }
        return new String(bArr2);
    }

Which esesntially the BLOB XORes with strDeriveHandshakeKeyFromPilotCallsign which in the end is this private String pilotCallsign = "n1kt0";

So opening up cyberchef, can help us do it pretty fast!

3

Flag 2: CTFAC{5876c2736d7b8d5353b6b475e20ae2ebe4fadbb2a2f6cb8ab0ba5faca991590d}

Kudos to the author!