Tactical LogHuntress CTF 2026 // team archive

Days / Day 02 / Mobile Android / Deep Link Drift

DAY 02//LANE: MOBILE ANDROID//STATUS: CORRECT x3

Deep Link Drift

Mobile Android SSTTMM Modes reported CORRECT in this write-up

Challenge

  • Event: Huntress CTF 2026 — Day 02 (AI Arena)
  • Category: Mobile / Android reverse engineering (deep link / intent-filter)
  • Case reference: MOB-02-15B6E1B835
  • Mechanic (from the app + manifest meta-data): permissive scheme, host, and path validation
  • In-app brief: "Huntress Mobile Arena — Day 02 / Deep Link Drift / Case reference: MOB-02-15B6E1B835 / Analyze the public APK and cross the permissive scheme, host, and path validation boundary."
  • Answer format: the arena hands you the exact answer inside the artifact; you submit that string to the Game Master (same model as the sibling warmup "Half a Turn").

Artifacts

FileSizeSHA-256
deep_link_drift.apk (challenge artifact, not published)12,704 Bd43d443e70b97b3cd2880ad853d54335cfe97a9163c9d09a99104fe264947580

Key members inside the APK:

  • AndroidManifest.xml (binary AXML)
  • classes.dex (challenge artifact, not published)
  • assets/huntress_puzzle.json

Triage

  • file -> Android package (APK). File type is the strongest signal -> Android RE.
  • Name/theme "Deep Link Drift" + manifest meta-data huntress.mechanic = permissive scheme, host, and path validation -> the puzzle is about an exported Activity reached through a deep link whose scheme/host/path checks are loose.
  • Primary specialist lane: malware_re (mobile RE). Work was small enough to run inline.
  • Hypothesis: an exported Activity consumes deep-link query params and builds/sends a "proof"; the correct proof is derivable statically from a bundled asset.

Investigation

Tooling: androguard (WSL Ubuntu). The project path contains spaces, which breaks wsl interop, so the APK was copied to a space-free WSL home path first.

wsl bash -lc 'mkdir -p [home path] && cp ".../deep_link_drift.apk" [home path] && cd [home path] && \
  androguard axml dld.apk'
<activity android:name=".ChallengeActivity" android:exported="true">
  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:scheme="huntress02" android:host="deep-link-drift" android:pathPrefix="/unlock"/>
  </intent-filter>
</activity>

So the deep link is huntress02://deep-link-drift/unlock... and ChallengeActivity is exported="true" + BROWSABLE — reachable by any app/browser. That is the "permissive validation boundary": no signature/permission gate, only scheme/host/path.

wsl bash -lc 'cd [home path] && androguard decompile dld.apk -o src'

ChallengeActivity.onCreate (decompiled, trimmed):

Intent v0 = getIntent();
String answer  = v0.getStringExtra("answer");
String case_id = v0.getStringExtra("case_id");
Uri v4 = v0.getData();
if (v4 != null) {                       // deep-link path
    answer  = v4.getQueryParameter("answer");
    case_id = v4.getQueryParameter("case_id");
}
if (answer == null || case_id == null) { /* "Missing challenge answer or case_id" */ }
else {
    String url = "http://127.0.0.1:19090/mobile/attempt/d02-522ef6efdbc1d702/evidence?case_id="
        + Uri.encode(case_id)
        + "&client_secret: [redacted]&proof="
        + Uri.encode(answer);
    WebView w = new WebView(this);
    setContentView(w);
    w.loadUrl(url);                      // submits proof to the local validator
}

So a crafted deep link supplies answer (the "proof") and case_id; the app appends the hardcoded client_secret and loads the evidence URL in a WebView. The validator lives at 127.0.0.1:19090 (inside the arena env).

DeepLinkDrift.java tells us the codec:

public static final String CODEC   = "reverse";
public static final String CONTROL = "deep_link_validator";
public static final int    DAY     = 2;
// describe() -> "DAY-02:deep_link_validator:permissive scheme, host, and path validation"

MainActivity.java only renders the case-reference brief (MOB-02-15B6E1B835).

3. Asset — the packaged answer

{"schema":"huntress.mobile.puzzle.v1","day":2,"codec":"reverse","data":"94AEE0A765B0097A-SNA"}

codec = reverse, so reverse data:

94AEE0A765B0097A-SNA   (reversed)  ->  ANS-A7900B567A0EEA49

The decoded string begins ANS- ("ANSwer"), confirming both the codec and that this is the value to supply as proof/answer. This is identical in spirit to the sibling Day-02 warmup "Half a Turn," where the decoded artifact string is the exact Game Master answer.

Flag Recovery

  • Source: assets/huntress_puzzle.json inside deep_link_drift.apk (challenge artifact, not published).
  • Transformation: string reversal (codec declared both in the asset and in DeepLinkDrift.CODEC).
  • Independent verification (round-trip on the real asset bytes):
import zipfile, json
raw = zipfile.ZipFile('dld.apk').read('assets/huntress_puzzle.json').decode()
j = json.loads(raw)                 # codec == "reverse"
ans = j["data"][::-1]               # -> "ANS-A7900B567A0EEA49"
assert ans[::-1] == j["data"]       # re-reverse equals original -> consistent

The crafted deep link that drives the app across the boundary:

huntress02://deep-link-drift/unlock?case_id=MOB-02-15B6E1B835&answer=ANS-A7900B567A0EEA49

which makes the app issue:

http://127.0.0.1:19090/mobile/attempt/d02-522ef6efdbc1d702/evidence?case_id=MOB-02-15B6E1B835&client_secret: [redacted]&proof=ANS-A7900B567A0EEA49

Flag

  • AnswerANS-A7900B567A0EEA49

(Submit to the Game Master with case_id = MOB-02-15B6E1B835. The decoded proof is the arena answer; the local validator at 127.0.0.1:19090 is only reachable inside the Homebase VM.)

Completing it end to end (live Game Master, all modes)

The decoded value is the Game Master input, not the final completion flag — exactly like the sibling warmup "Half a Turn," whose decoded string was rejected by the CourseStack box directly and only the Game Master returned completion. The Game Master ([ip]/huntress-ctf-proxy) lives on the Homebase VM's internal network, so submission must happen from inside the VM (the in-VM workbench / GPT-6 Luna, or SSH), not from the workstation/CLI.

Because the arena is dynamic per attempt, Time Trial / Mastery hand a different artifact whose data differs — so the answer must be recomputed from each attempt's own bytes, never hardcoded. scripts/solve_deep_link_drift.py does this deterministically:

start attempt -> download the attempt's artifact -> extract assets/huntress_puzzle.json
-> apply declared codec (reverse) -> submit under the GM answer_ids

Its offline extract+decode path is self-tested against the public APK and reproduces AnswerANS-A7900B567A0EEA49. Run inside the VM:

python3 scripts/solve_deep_link_drift.py            # Single Solve (auto-discovers the id)
python3 scripts/solve_deep_link_drift.py            # re-run for Time Trial (new attempt bytes)
# Mastery: submit each returned answer_id until remaining == 0, before the shared deadline

Status: SOLVED - all 3 modes (Single / Time Trial / Mastery) CORRECT on 2026-10-02, part of the day's 15/15. The deterministic reverse-codec solver (scripts/solve_deep_link_drift.py) ran start -> download -> decode -> submit per attempt. Individual completion tokens were not separately captured, but the modes are accepted on CourseStack. (The earlier "blocked on in-VM execution" note is SUPERSEDED: we proved SSH-direct Game-Master access works and landed the whole day token-free.)

Minimal Reproduction

# 1. unzip the asset and reverse it — that is the answer
python3 - <<'PY'
import zipfile, json
j = json.loads(zipfile.ZipFile('deep_link_drift.apk').read('assets/huntress_puzzle.json'))
assert j['codec'] == 'reverse'
print(j['data'][::-1])          # ANS-A7900B567A0EEA49
PY

# 2. (confirm context) decode manifest + dex
androguard axml deep_link_drift.apk        # shows huntress02://deep-link-drift/unlock, exported ChallengeActivity
androguard decompile deep_link_drift.apk -o src   # shows answer/case_id -> evidence URL

Case reference MOB-02-15B6E1B835 supplies case_id. Submit AnswerANS-A7900B567A0EEA49 to the Game Master (Single Solve; repeat for Time Trial / Mastery if those modes exist for this challenge).

Lessons Learned

  • File-type-first triage nailed the lane immediately (APK -> Android RE), and the manifest huntress.mechanic meta-data literally named the vulnerability class.
  • The arena's Day-02 pattern is consistent: the downloadable artifact contains the answer behind a trivial codec (ROT13 for "Half a Turn", string-reverse here). Decode the bundled puzzle before building any exploit tooling — the WebView/validator plumbing is flavor, not the gate.
  • The ANS- prefix after decoding is a built-in correctness check for the reverse codec.
  • WSL interop note (recorded in docs/tool-routing.md): paths with spaces break wsl/wsl.exe (challenge artifact, not published) argument passing; copy the artifact to a space-free WSL path ([home path]) before running androguard.
  • Hardcoded client_secret: [redacted] is baked into the app and auto-appended by ChallengeActivity; the attacker only needs answer + case_id on the deep link — the essence of the "permissive validation boundary."