Cloud-2-Sat is a two stage track from the Apex Park storyline. Stage 00 drops you onto a visitor center guest WiFi portal and asks you to recover an archive bootstrap value. Stage 01 carries that value forward as an archive profile credential and asks for the authoritative version of a mission memo whose history has been deliberately salted with lies. The two stages are one solve, so I am writing them together.

Throughout the Apex Park challenges the authors use a decoy convention: real flags are FLAG-{...}, and anything that reads CTF_FLAG-{...} is a planted honeypot. Both stages lean on that distinction.

Stage 00: Visitor Center WiFi

Challenge

The brief frames a visitor network session as my only sanctioned view into the first outage. I vend an ephemeral session against the vending API, work the challenge host, recover the archive bootstrap value, and stop the session when done.

Vending is a single POST with a player id and the public event token:

1
2
curl -s -X POST "$API/request" -H 'content-type: application/json' \
  -H 'x-player-id: mikel' -H 'x-vending-token: <redacted>' -d '{}'

That returns a session id, a challenge URL on port 8080, a console URL on port 3000, and console credentials. The challenge URL serves a guest WiFi captive portal.

Foothold: command injection in the diagnostic endpoint

The portal exposes POST /api/diagnostic with a JSON body {"target": ...}, a connectivity check. Behind it the server builds a shell command roughly like:

1
/bin/sh -lc "echo checking $target; ..."

The target field is interpolated unquoted, and it is interpolated twice in the same command string. That is a straightforward command injection, with two quirks that shape the payload. First, target is capped at around 160 characters. Second, because the value lands in the command string twice, the cleanest way to keep the second copy from executing as garbage is to terminate the payload with a comment character #. So my probe shape is:

1
{"target": "x; <command> #"}

With that I had arbitrary command execution as the portal’s service user.

The obvious loot was all fake. The server source carries three decoys, CTF_FLAG-{visitor-admin-cache}, CTF_FLAG-{satcom-console-shadow}, and CTF_FLAG-{wifi-voucher-cache}, alongside an archive_profile_hint of APX-WIFI-GUEST-008 and some operator notes. None of it is the flag. There was nothing real on disk, in the environment, or on PID 1.

Privesc: a setuid helper with a traversal and a shell confusion

Enumerating setuid binaries turned up /usr/local/bin/apx-fragctl, owned by root with the setuid bit set, a musl ELF that was not stripped. I base64 encoded it over the injection, pulled it down, and read it locally with objdump and strings. Two subcommands matter.

repair <manifest> reads a manifest and writes a payload= line to a destination computed as spool + "/" + target. It rejects destinations that are absolute paths, but it does not check for ../, so directory traversal out of the spool directory is wide open.

dispatch is the interesting one. It calls setgid(0) then setuid(0), then execl(shell, shell, "-p", "-c", cmd), where shell= is read from a root owned config at /etc/apex/fragctl/dispatch.conf. The default shell there is /bin/false, which goes nowhere.

The chain writes itself. Use the repair traversal to overwrite dispatch.conf with a shell= of my choosing, then call dispatch to execute as root. The one snag is that busybox sh rejects the -p flag that dispatch passes, so pointing the config at the default shell fails. Pointing it at /bin/bash, which accepts -p, works.

1
2
3
4
5
6
7
# manifest written via the portal injection, e.g. to /tmp/m2:
#   target=../../../../etc/apex/fragctl/dispatch.conf
#   payload=shell=/bin/bash

apx-fragctl repair /tmp/m2          # traversal overwrites the root-owned config
apx-fragctl dispatch -- /tmp/script.sh   # runs as uid=0(root)
cat /root/apex/stage01/archive-profile

Running as root, I read the Stage 01 bootstrap material under /root/apex/stage01/. The bootstrap flag is the CTFd answer for Stage 00, and it doubles as the archive profile credential for Stage 01. The bootstrap script also left a clue for the next stage: inspect the mission archive object versions, because the newest is not always the right one.

Last, I stopped the session cleanly:

1
2
3
curl -s -X POST "$API/stop" -H 'content-type: application/json' \
  -H 'x-vending-token: <redacted>' -d '{"session_id": "..."}'
# -> {"stopped": true}

Stage 00 flag: FLAG-{APX-WIFI-RECON-647127875}

Stage 01: AWS Archive Archaeology

Challenge

The second brief asks me to recover the authoritative historical memo and wrap its authorization phrase as FLAG-{...}, while preserving a GroundLink release handoff for a later Stage 02. The archive is fronted by an API with routes for /ui, /versions, /object, /inspect, and /events. Authentication is the Stage 00 flag, passed either as ?profile=<stage00-flag> or as a header:

1
x-archive-profile: FLAG-{APX-WIFI-RECON-647127875}

The memo lives at key mission/memos/apx-final-mission-memo.txt.

Approach: ignore recency, trust the audit marker

Listing the object versions of that key returns five versions, each stamped with a deliberately conflicting set of tags: memo-state, audit-recovery, canary, author, and confidence. The whole puzzle is sorting the honest version out of five that contradict each other.

1
2
curl -s "$BASE/versions?key=mission/memos/apx-final-mission-memo.txt" \
  -H 'x-archive-profile: FLAG-{APX-WIFI-RECON-647127875}'

Reading across the five:

  • The is_latest version is tagged memo-state=stale-current, and its body openly says it is intentionally misleading. This is the recency trap the Stage 00 clue warned about.
  • Two versions carry canary=true. Those are tripwires. One of them even carries a CTF_FLAG-{...} decoy to tempt a quick submission.
  • One version is a low confidence draft.
  • Exactly one version is audit-recovery=true with canary=false. That is the authoritative one.

To confirm rather than guess, I pulled the CloudTrail data events from /events. A legitimate read of the authoritative version, performed by the archive-reader role, is tagged event_type:stage_progress. The read of the decoy version is tagged event_type:tripwire. That matched my tag analysis exactly: the audit-recovery=true, canary=false version is the real memo.

Its body contains the Stage 01 authorization phrase along with the Stage 02 carry material:

1
2
3
Stage 01 CTFd answer: ARCHIVE-VERSION-FE1CDEE2490291AA1FCB7455
Stage 02 release/run pointer: FLAG-{groundlink-release-run-7429}
Stage 02 workflow hint: inspect OIDC trust conditions for the release workflow, not branch builds.

The GroundLink pointer FLAG-{groundlink-release-run-7429} is preserved for Stage 02 and is not the answer here. The authorization phrase wrapped as the flag is the answer.

Stage 01 flag: FLAG-{ARCHIVE-VERSION-FE1CDEE2490291AA1FCB7455}

Flags

  • Stage 00, Visitor Center WiFi: FLAG-{APX-WIFI-RECON-647127875}
  • Stage 01, AWS Archive Archaeology: FLAG-{ARCHIVE-VERSION-FE1CDEE2490291AA1FCB7455}